Re:Converting binary floating-point numbers to integers
by occamrazor on Saturday October 23, 2021 @06:29AM
(#28967157)
What is the alternative? Are there functions in the C standard to get mantissa and exponent?
[ Parent
| on HN ]
Re:Converting binary floating-point numbers to integers
by gpderetta on Saturday October 23, 2021 @09:03AM
(#28967992)
Frexp modf. Last time I checked code generation wasn't particularly good.
Re:Converting binary floating-point numbers to integers
by CyberRabbi on Saturday October 23, 2021 @03:37PM
(#28971541)
I already mentioned the alternative. memcpy() into a char array.
Re:Converting binary floating-point numbers to integers
by Cloudef on Sunday October 24, 2021 @06:05AM
(#28976433)
Memcpy doesnt fix endianess
Re:Converting binary floating-point numbers to integers
by CyberRabbi on Saturday November 06, 2021 @08:25PM
(#29135207)
It was never claimed to deal with endianness and while we're on the subject of binary-layout, union-based binary manipulation is even worse on that front as no specific binary layout is mandated for structures or floating points.