It sounds like you're running into the imprecision of floats. Not every number can be precisely represented by the floating point specification, so you might get the closest approximation that can be represented. This is why testing for equality between floats is a bad idea.
If the number is not even close, something else is going on and you'll need to be more specific, I think.