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 (.).

宣言の calculate

number calculate ( string $formula )

テスト calculate オンライン

共有 calculate

のコメント calculate


Leave your comment