Division by zero

Blitz3D Forums/Blitz3D Programming/Division by zero

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

If you're checking the result for infinity then you've gone one step too far. As stated above, use a conditional test to check if the divisor is a zero value before you perform the division. If it is a zero value, then abort the division and handle the situation in a manner appropriate to whatever you're trying to achieve (pop an error message, substitute an epsilon value, etc).