In C++20 (or later), are there any operations involving floating point numbers that are guaranteed by the standard to never throw?
What about
Note, I am concerned here only with ordinary regular C++ exceptions, not the special notion of "floating-point exceptions".
Here is a more precise formulation of my question:
If a
and b
are mutable objects of type double
, which of the following expressions, if any, are guaranteed by the C++ standard to evaluate to true?
noexcept(a = b)
noexcept(a == b)
noexcept(a + b)
For new readers, I'd like to clarify that I am only interested in "defined behavior", that is, everything that is not undefined behavior.
Note 1 An exception can be thrown from one of the following contexts: throw-expressions (expr.throw), allocation functions (basic.stc.dynamic.allocation), dynamic_cast (expr.dynamic.cast), typeid (expr.typeid), new-expressions (expr.new), and standard library functions (structure.specifications).
Floating point operators are none of those.
Notes are not normative, but they are good enough for me.