# How can be FLOAT grater than INT?

This topic is 4080 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I am viewing the maximum number of any type and I read this: __int32 -> –2,147,483,648 to 2,147,483,647. float -> 3.4E +/- 38 (7 digits). then the float is able to be 3.4*10^38?, how it this possible if INT increments are by 1 and FLOAT increments are by <1 and both are 32 bits?. Am I wrong in anything?.

##### Share on other sites
Quote:
 Original post by Dark Schneiderhow it this possible if INT increments are by 1 and FLOAT increments are by <1 and both are 32 bits?

float increments are <1 only for small numbers.

##### Share on other sites
Because of the way floats work. See IEEE 754.

Basically, you get a far higher range of values at the cost of some precision.

##### Share on other sites
This is exactly the point of floating-point numbers. They are stored in what I've been brought up to call 'standard form', whereby the representation is split into the mantissa (a fixed list of digits) and the exponent (the position of the decimal place).

This exponential configuration means that the resolution of the number is not linear and depends on its size. So while an 'increment' may be fractionally small for small numbers, it is huge for big ones. You can verify this by adding 0.00001f to 1000000.0f and observing that it has no effect.

##### Share on other sites
Floats are basically the same as what you see in windows calculator for very large numbers. It stores the mantissa and the exponent with real number being the mantissa being raised to the power of the exponent, loosing much precision at large values.

I don't know if this is any more clear...

##### Share on other sites
I see, Ok thanks, then I must take caution when manipulating big float values.

1. 1
Rutin
42
2. 2
3. 3
4. 4
5. 5

• 9
• 27
• 20
• 14
• 14
• ### Forum Statistics

• Total Topics
633390
• Total Posts
3011630
• ### Who's Online (See full list)

There are no registered users currently online

×