23 lines
568 B
C++
23 lines
568 B
C++
|
#include "Addition.h"
|
||
|
|
||
|
/* [0] CONSTRUCTEUR
|
||
|
=========================================================*/
|
||
|
Addition::Addition(){
|
||
|
this->init(2);
|
||
|
}
|
||
|
|
||
|
/* [1] Renvoie le nom du type de calcul
|
||
|
=========================================================*/
|
||
|
std::string Addition::getLibelle(){
|
||
|
return "Addition";
|
||
|
}
|
||
|
|
||
|
/* [2] Effectue le calcul et renvoie le resultat
|
||
|
=========================================================*/
|
||
|
float* Addition::calc(){
|
||
|
this->result = (float*) malloc(1*sizeof(float));
|
||
|
|
||
|
this->result[0] = this->operands[0]+this->operands[1];
|
||
|
|
||
|
return this->result;
|
||
|
}
|