@@ -16477,6 +16477,11 @@ Historically, libc returns NUM for NUM vs (sNaN or qNaN), and may return
16477
16477
sNaN for qNaN vs sNaN. With the recent libc versions, libc follows IEEE754-2008:
16478
16478
NUM vs sNaN -> qNaN; NUM vs qNaN -> NUM; qNaN vs sNaN -> qNaN; sNaN vs sNaN -> qNaN.
16479
16479
16480
+ Note that that arithmetic on an sNaN doesn't consistently produce a qNaN,
16481
+ so arithmetic feeding into a minnum can produce inconsistent results.
16482
+ Such as `fmin(sNaN+0.0, 1.0)` can produce qNaN or 1.0 depending on whether `+0.0`
16483
+ is optimized out.
16484
+
16480
16485
If either operand is a qNaN, returns the other non-NaN operand. Returns
16481
16486
NaN only if both operands are NaN or either operand is sNaN.
16482
16487
If the operands compare equal, returns either one of the operands.
@@ -16529,6 +16534,11 @@ Historically, libc returns NUM for NUM vs (sNaN or qNaN), and may return
16529
16534
sNaN for qNaN vs sNaN. With the recent libc versions, libc follows IEEE754-2008:
16530
16535
NUM vs sNaN -> qNaN; NUM vs qNaN -> NUM; qNaN vs sNaN -> qNaN; sNaN vs sNaN -> qNaN.
16531
16536
16537
+ Note that that arithmetic on an sNaN doesn't consistently produce a qNaN,
16538
+ so arithmetic feeding into a maxnum can produce inconsistent results.
16539
+ Such as `fmax(sNaN+0.0, 1.0)` can produce qNaN or 1.0 depending on whether `+0.0`
16540
+ is optimized out.
16541
+
16532
16542
If either operand is a NaN, returns the other non-NaN operand. Returns
16533
16543
NaN only if both operands are NaN or either operand is sNaN.
16534
16544
If the operands compare equal, returns either one of the operands.
0 commit comments