4 ms·
This is behavior is mostly just unspecified, at least for C++ (not sure about C). I'm aware of some efforts to bring deterministic floating point operations in
by badmintonbaseba 2y ago
This is behavior is mostly just unspecified, at least for C++ (not sure about C).
I'm aware of some efforts to bring deterministic floating point operations into the C++ standard, but AFAIK there are no publicly available papers yet.
- AlotOfReading 2y agoP3375R0 is public now [0], with a couple implementations available [1], [2]. Subexpression combining has more general implications that are usually worked around with gratuitous volatile abuse or magical incantations to construct compiler optimization barriers. Floating point is simply the most straightforward example where it leads to an observable change in behavior. [0] https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3375r0.html https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/p33... [1] https://github.com/sixitbb/sixit-dmath https://github.com/sixitbb/sixit-dmath [2] https://github.com/J-Montgomery/rfloat/ https://github.com/J-Montgomery/rfloat/