News for hackers. Stuff that matters.
Re:Reciprocal Approximation with 1 Subtraction by mbitsnbites on Wednesday January 01, 2025 @02:59PM (#42568785)
The proper solution is to use std::bit_cast in modern C++ or otherwise use memcpy, and of course know what you're doing.

Some things that could mess with you:

* Floating-point endianity is not the same as integer endianity.

* Floating-point alignment requirements differ from integer alignment requirements.

* The compuler is configured to use something else than 32-bit binary32 IEEE 754 for the type "float".

* The computer does not use two's complement arithmetic for integers.

In practice, these are not real problems.

There are no comments on this comment yet.