This function calculates a mathmatic formula. It is somewhat like a calculator, but without an usable frontend. Often you have the problem, that you just want write down the complete formular, but on GUI-based calculators you can't, here you can! Allowed are the usual operators (+, -, *, /, %) and the following functions:
- exp($arg) (exp(1) = 2,718...)
- log($arg, $basis) (log(2, 8) = 1/3)
- pow($basis, $exponent) (pow(4, 2) = 16)
- sqrt($arg) (sqrt(16) = 4)
Attention: The comma (,) is reserved to devide the parameters of function. The comma in this way is represented by the dot (.).
declaration of calculate
number calculate ( string $formula )
test calculate online
comments for calculate
be the first
No comments so far for calculate(). Leave yours as first below.