[llvm] [LangRef] make consequences of NaN rules for pow(i) more explicit (PR #170177)
Ralf Jung via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 2 13:21:21 PST 2025
================
@@ -16831,6 +16836,11 @@ trapping or setting ``errno``.
When specified with the fast-math-flag 'afn', the result may be approximated
using a less accurate calculation.
+Note that due to how :ref:`LLVM treats NaN values <floatnan>`, the special cases
----------------
RalfJung wrote:
When those documents talk about "NaN", they mean "quiet NaN" (similar to how some documents say that fmin/fmax return the non-NaN argument if the other one is NaN, but only refer to quiet NaNs when they say that). Some `pow` implementations return `QNaN` for `pow(1, SNaN)`; for instance, the one that comes with the GNU libc. musl returns `1` for the same inputs. (See https://rust.godbolt.org/z/chsbv5v4d.)
https://github.com/llvm/llvm-project/pull/170177
More information about the llvm-commits
mailing list