Skip to content

Commit 035e66e

Browse files
committed
[LangRef] make consequences of NaN rules for pow(i) more explicit
1 parent bbb0dba commit 035e66e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

llvm/docs/LangRef.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16269,6 +16269,11 @@ Semantics:
1626916269
This function returns the first value raised to the second power with an
1627016270
unspecified sequence of rounding operations.
1627116271

16272+
Note that due to how :ref:`LLVM treats NaN values <floatnan>`, the special case
16273+
of `powi(SNaN, 0.0)` can non-deterministically return either `1.0` or some NaN
16274+
value (using the usual NaN propagation rules, so in particular the result could
16275+
be either a signaling NaN or a quiet NaN).
16276+
1627216277
.. _t_llvm_sin:
1627316278

1627416279
'``llvm.sin.*``' Intrinsic
@@ -16831,6 +16836,11 @@ trapping or setting ``errno``.
1683116836
When specified with the fast-math-flag 'afn', the result may be approximated
1683216837
using a less accurate calculation.
1683316838

16839+
Note that due to how :ref:`LLVM treats NaN values <floatnan>`, the special cases
16840+
of `pow(1.0, SNaN)` and `pow(SNaN, 0.0)` can non-deterministically return either
16841+
`1.0` or some NaN value (using the usual NaN propagation rules, so in particular
16842+
the result could be either a signaling NaN or a quiet NaN).
16843+
1683416844
.. _int_exp:
1683516845

1683616846
'``llvm.exp.*``' Intrinsic

0 commit comments

Comments
 (0)