An int value can be more precise then a float can, however a float can
hold bigger numbers.  It's the difference between having a 24 bit
fraction with 8 bits of exponent and 1 of sign vs 31/32 bits of
fraction data without exponent.  Plus, integer operations are faster
then floating point operations, even if just margionably.

On 5/9/07, Vitaly Budovski <[EMAIL PROTECTED]> wrote:
Dmitry Timoshkov wrote:
> "Vitaly Budovski" <[EMAIL PROTECTED]> wrote:
>
>> Please show me how an unsigned int can represent values greater than
>> 2^32. This is why a float is used.
>
> Of course int can't, but neither float can. Perhaps you confuse it with
> double?
>

I'm pretty sure I'm not confusing it with double.
http://steve.hollasch.net/cgindex/coding/ieeefloat.html
http://en.wikipedia.org/wiki/IEEE_754#Single-precision_32_bit





Reply via email to