Skip to content

Commit c62f40f

Browse files
committed
explain that this is a spec-only RFC
1 parent 44fc10d commit c62f40f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

text/0000-float-semantics.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66
# Summary
77
[summary]: #summary
88

9+
This RFC proposes a specification for how our floating point operations are expected to behave.
10+
The current implementation in rustc already matches the specification, so after accepting the RFC no compiler changes are required.
11+
(However we might be able to stabilize some `const fn` features, see below for details.)
12+
913
Rust's floating point operations follow IEEE 754-2008 -- with some caveats around operations producing NaNs: IEEE makes almost no guarantees about the sign and payload bits of the NaN; however, actual hardware does not pick those bits completely arbitrarily, and Rust will expose some of those hardware-provided guarantees to programmers.
1014
On the flip side, NaN generation is non-deterministic: running the same operation on the same inputs several times can produce different results.
1115
And there is a caveat: while IEEE specifies that float operations can never output a signaling NaN, Rust float operations *can* produce signaling NaNs, *but only if* an input is signaling.

0 commit comments

Comments
 (0)