cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

How do I evaluate for 0/0

JB_10220769
6-Contributor

How do I evaluate for 0/0

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? 

1 ACCEPTED SOLUTION

Accepted Solutions

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)

Werner_E_0-1659366524672.png

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

Werner_E_1-1659366761396.png

 

 

 

View solution in original post

3 REPLIES 3
LucMeekes
23-Emerald II
(To:JB_10220769)

Make it explicit, for example like this:

LucMeekes_1-1659038482637.png

Success!
Luc

 

JB_10220769
6-Contributor
(To:LucMeekes)

Thank you for your input. I would like to know is there any generic steps that I can follow in Prime to avoid such issue

 

JB_10220769_0-1659363400070.png

 

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)

Werner_E_0-1659366524672.png

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

Werner_E_1-1659366761396.png

 

 

 

Announcements