4 ms·
The commenter above you isn't talking about IEEE754's abs() function, but rather the code from the OP, except applied to floats rather than ints.
by Sniffnoy 5y ago
The commenter above you isn't talking about IEEE754's abs() function, but rather the code from the OP, except applied to floats rather than ints.
- LinAGKar 5y agoThat code also has the same problem for one's complement and sign+magnitude, which are allowed encodings in C.
- ameliaquining 5y agoThis is going away in the next version of the C standard. http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2412.pdf http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2412.pdf
- Sniffnoy 5y agoOh, nice!