CalcBuilder Forum

division by zero

Usuario 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

...
Support/development

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

Buy now!
...
Support/development 10 hours

Get a bigger amount of hours for more complex tasks and get a 10% discount

Buy now!