8-Gravel
July 28, 2022
Solved
How do I evaluate for 0/0
- July 28, 2022
- 1 reply
- 1839 views
I am not able to locate any checkbox in prime as it used to be there in Mathcad 15 to compute for 0/0
How can I have this checked?
Unlike MC15 and below there is no option in Prime to set 0/0 to zero for the whole worksheet.
But even in MC15 a division by zero as shown in your pic (we don't see it but I assume the numerator is not zero) throws an error.
Whenever you have calculations where it would be possible to divide by zero or anything like that, you may wrap them into a "try ...on error ..." statement (in MC15 its "... on error ...").
Of course if you do this, you can't distinguish if a/b failed because both a and b were zero or if it just failed because only b was zero.
If they need to distinguish between these cases more precisely, then you would have to use if-statements or the if-function as shown by Luc.
But both, "on error" statement and/or "if" have to be applied for every calculation whích could fail. There is no general option to set a/0 to +∞, 0 or -∞, depending on the sign of a.
Of course you could define a function "divide" at the top of your worksheet (e.g. in a collapsed area)

and use this function throughout instead of the built-in divide/fraction operator (at the cost of comfort, readability and clearness)

Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.