Commit bcdaa07
authored
10826 use cmp and abs to find larger NaN payload (#10895)
`getNaNPayload(x)` returns a value even if `x` is not NaN, so it is up to
the caller to verify that `x` is a NaN before calling `getNaNPayload(x)`.
This means it is not a good option for determining for determining which
of a set of values has the largest NaN payload when it is only known
that at least one value is NaN. `cmp(x, y)` can be used. since to orders
-NaN as before -infinity and NaN as after infinity. When two NaN with the
same sign are compared, the one with the larger payload is considered
larger. This means that `cmp(abs(x), abx(y))` will find the NaN with the
larger payload when it is only known that at least one of `x` or `y` is
NaN.1 parent b0bb590 commit bcdaa07
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
656 | 656 | | |
657 | 657 | | |
658 | 658 | | |
659 | | - | |
| 659 | + | |
660 | 660 | | |
661 | 661 | | |
662 | 662 | | |
| |||
764 | 764 | | |
765 | 765 | | |
766 | 766 | | |
767 | | - | |
| 767 | + | |
768 | 768 | | |
769 | 769 | | |
770 | 770 | | |
| |||
0 commit comments