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