Skip to content

Commit 2a17fdb

Browse files
committed
add history about libm
1 parent e0fab40 commit 2a17fdb

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

llvm/docs/LangRef.rst

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16465,7 +16465,11 @@ type.
1646516465
Semantics:
1646616466
""""""""""
1646716467
Follows the IEEE754 2008 semantics for minNum.
16468-
This also matches the behavior of libm's fmin.
16468+
This also matches the current (C23) behavior of libm's fmin.
16469+
16470+
Historically, libc returns NUM for NUM vs (sNaN or qNaN), and may return
16471+
sNaN for qNaN vs sNaN. Withe recent libc versions, libc follows IEEE754-2008:
16472+
NUM vs sNaN -> qNaN; NUM vs qNaN -> NUM; qNaN vs sNaN -> qNaN; sNaN vs sNaN -> qNaN.
1646916473

1647016474
If either operand is a qNaN, returns the other non-NaN operand. Returns
1647116475
NaN only if both operands are NaN or either operand is sNaN.
@@ -16508,7 +16512,11 @@ type.
1650816512
Semantics:
1650916513
""""""""""
1651016514
Follows the IEEE754 2008 semantics for maxNum.
16511-
This also matches the behavior of libm's fmax.
16515+
This also matches the current (C23) behavior of libm's fmax.
16516+
16517+
Historically, libc returns NUM for NUM vs (sNaN or qNaN), and may return
16518+
sNaN for qNaN vs sNaN. Withe recent libc versions, libc follows IEEE754-2008:
16519+
NUM vs sNaN -> qNaN; NUM vs qNaN -> NUM; qNaN vs sNaN -> qNaN; sNaN vs sNaN -> qNaN.
1651216520

1651316521
If either operand is a NaN, returns the other non-NaN operand. Returns
1651416522
NaN only if both operands are NaN or either operand is sNaN.

0 commit comments

Comments
 (0)