Math Isnt Working

BlitzMax Forums/BlitzMax Programming/Math Isnt Working

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.

The important lesson here is that you should not depend on floating point arithmetic to give exact integer results.

But you wouldn't think that using a built in Blitz math function on 2 integers would result in float errors. Shouldn't Blitz use different methods depending on whether the arguments are floats or ints? The function that KrayzBlu posted is a common one when masking data on a bit per bit basis. It can result in huge errors when the result is off by one. C++ pow() function does not have this problem.