Detecting a NAN

Blitz3D Forums/Blitz3D Programming/Detecting a NAN

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.

prevent divisions through "0" or nearly 0. I guess you have a FPS bound movement and do not have an FPS precalculation before players can do anything to prevent the 0 division problem.

a possibility is:

function divide#( a#, b# )
epsilon# = 0.0001

if b > epsilon
return a / b
else
return a / epsilon
endif
end function



haven't had NAN cases so far beside the 0 division