CalcBuilder Forum

division by zero

User moon_1407 2014-01-10 01:35:13

I am trying to output a result from an equation and keep getting a "division by zero" error. None of the calculations results in zero in denominator. Please help.

Moonsoft support 2014-01-10 09:28:06

Hi,
there must be a division by zero resulting at your code. We suggest to double-check your inputs, maybe you can comment out the division line and print the operands at the output to confirm they have the value expected.

Any typo at a name variable can also cause the value to behave as 0. For ex, with a field named input1

$result=100/$input_1; //this will cause a division by 0 error

Hope this helps, regards

...
List Manager

Build different lists for your site

Buy now!
...
Support/development

Perfect for small code changes or to correct any bug at your site

Buy now!