Skip to content

Commit 44fc10d

Browse files
committed
copysign can also expose the sign of a NaN
1 parent b45d7f3 commit 44fc10d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

text/0000-float-semantics.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ It's time to stop leaving our users in the dark about what actually is and is no
2626
[guide-level-explanation]: #guide-level-explanation
2727

2828
Primitive operations on floating-point types generally produce results that exactly match IEEE 754-2008:
29-
if you never use `to_bits`, `from_bits`, `is_sign_negative`, or `is_sign_positive`, nor any unsafe operations that are equivalent to these safe methods, then your code will behave perfectly deterministically according to the IEEE specification.
30-
In fact, this is true even if you do use these operations as long as you never call them on a NaN (or, in case of `from_bits`, use them to produce a NaN).
29+
if you never use `to_bits`, `copysign`, `is_sign_negative`, or `is_sign_positive` on a NaN, and don't construct a NaN using `from_bits`, nor use any unsafe operations that are equivalent to these safe methods, then your code will behave perfectly deterministically and according to the IEEE specification.
3130

3231
If you *do* use these operations on NaNs, then the exact behavior you see can depend on compiler version, compiler flags, target architecture, and it can even be non-deterministic (i.e., running the same operation on the same inputs twice can yield different results).
3332
The results produced in these cases do *not* always conform to the IEEE specification.

0 commit comments

Comments
 (0)