# Re: Converting Long to Float: Values not Matching

*From*: Joshua Cranmer <Pidgeot18@xxxxxxxxxxxxxxx>*Date*: Thu, 11 Sep 2008 22:47:24 -0400

Z wrote:

I am getting:

3250051236

3.25005133E9

I tried with multiple numbers but still the values are not equal. What

am I missing?

Thanks,

Floats have limited precision. Your number is larger than the number of the precision.

Internally, numbers are represented as a number (the mantissa) multiplied by some power of 2; your number cannot be exactly represented to the precision that the mantissa has, so it lops off a few bits at the end, giving you a moderately close but not exact approximation.

--

Beware of bugs in the above code; I have only proved it correct, not tried it. -- Donald E. Knuth

.

**References**:

- Prev by Date:
**Re: Converting Long to Float: Values not Matching** - Next by Date:
**Re: size of a row (resultset)** - Previous by thread:
**Re: Converting Long to Float: Values not Matching** - Index(es):