Re: Decimal to floating point and floating point to decimal conversion

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

 



On Tue, 11 Jul 2023 at 13:33, <henri.cloetens@xxxxxxxxxx> wrote:
>
> Hello Jonathan,
>
> Can you please explain your point of view ?.

It's not a point of view, it's a fact. You cast a float* to int* and
read through it, which has undefined behaviour.

ints and floats are not compatible types.

If you want to interpret the bytes of a float as an int, you can copy
the bytes into an int, and then read them that way.



[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