Re: float to int conversion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 22 Apr 2013 08:48:55 +0000
"Warlich, Christof" <christof.warlich@xxxxxxxxxxx> wrote:

> Ok, fair enough. But then, what about my second example?:
one of the numbers goes out of int range in conversion to float. change
float to double and everything will be fine.

0x7fffffc0 can'be exactly represented in float, 'cause there is some
bits occupied by exponent. so it is rounded so some other number, which
is unfortunately too big to be converted to int. therefore conversion
triggers undefined behavior.

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux