Sign in to follow this  

How can be FLOAT grater than INT?

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

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
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.

Admiral

Share this post


Link to post
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 this post


Link to post
Share on other sites

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

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this