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.