Skip to content

Commit 6a70498

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

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

llvm/docs/LangRef.rst

Lines changed: 11 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* some NaN value
16274+
(using the usual NaN propagation rules, so in particular the result could be
16275+
either a signaling NaN or a quiet NaN), *or* the value `1.0`.
16276+
1627216277
.. _t_llvm_sin:
1627316278

1627416279
'``llvm.sin.*``' Intrinsic
@@ -16831,6 +16836,12 @@ 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
16841+
*either* 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), *or* the value
16843+
`1.0`.
16844+
1683416845
.. _int_exp:
1683516846

1683616847
'``llvm.exp.*``' Intrinsic

0 commit comments

Comments
 (0)