Skip to content

Commit 0e84131

Browse files
committed
list all deviations from IEEE more centrally
1 parent ee105a1 commit 0e84131

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

text/0000-float-semantics.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ Except for the cases handled below, these operations produce results that exactl
5656
When a floating-point value is just passed around (i.e., outside the operations above or any library-provided float operation), its representation bits do *not* change.
5757

5858
Exceptions apply when the output of an operation is a NaN, and the operation is not a "bitwise" operation (unary `-`, `abs`, `copysign`).
59-
In that case, we generally follow [the same rules as LLVM](https://llvm.org/docs/LangRef.html#behavior-of-floating-point-nan-values).
59+
In that case, we generally follow [the same rules as LLVM](https://llvm.org/docs/LangRef.html#behavior-of-floating-point-nan-values), which differ from the IEEE specification.
60+
Furthermore, Rust considers floating-point status bits to not be observable, and Rust does not support executing floating-point operations with alternative rounding modes or otherwise changed floating-point control bits.
6061

6162
To be concrete, we first establish some terminology:
6263
A floating-point NaN value consists of a sign bit, a quiet/signaling bit, and a payload (which makes up the rest of the significand (i.e., the mantissa) except for the quiet/signaling bit). Rust assumes that the quiet/signaling bit being set to ``1`` indicates a quiet NaN (QNaN), and a value of ``0`` indicates a signaling NaN (SNaN). In the following we will hence just call it the "quiet bit".

0 commit comments

Comments
 (0)