Sign in to follow this  

rearranging expression

This topic is 4835 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi guys I have this expression dist3 = 1 - (aY - aST->tri2D[2].y) / (aST->tri2D[0].y - aST->tri2D[2].y); The problem with this expression is that it runs the risk of a division by 0. Can someone help me to rearrange it to remove the division? Thanks!

Share this post


Link to post
Share on other sites
As Atm97fin implied in a rather concise way, you must manually check to make sure the denominator is not zero. More often than not, division by zero means that the problem can't be solved with the information given. This also means that rearranging the equation will not help. You'll still need to check for a zero denominator and handle that as a special case.

Share this post


Link to post
Share on other sites

This topic is 4835 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this