Skip to content

Commit ef1b0bf

Browse files
clarify the scope of non-determinism
Co-authored-by: Josh Triplett <josh@joshtriplett.org>
1 parent 71a5f3c commit ef1b0bf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

text/0000-float-semantics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ On the flip side, NaN generation is non-deterministic: running the same operatio
1515
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.
1616
That means the only way to ever see a signaling NaN in a program is to create one with `from_bits` (or equivalent unsafe operations).
1717

18-
Floating-point operations at compile-time follow the same specification. In particular, since operations are non-deterministic, the same operation can lead to different bit-patterns when executed at compile-time (in a `const` context) vs at run-time.
18+
Floating-point operations at compile-time follow the same specification. In particular, since operations involving NaN bit patterns are non-deterministic, the same operation can lead to different NaN bit patterns when executed at compile-time (in a `const` context) vs at run-time.
1919
Of course, the compile-time interpreter is still deterministic. It is entirely possible to implement a non-deterministic language on a deterministic machine, by simply making some fixed choices. However, we will not specify a particular choice, and we will not guarantee it to remain the same in the future.
2020

2121
# Motivation

0 commit comments

Comments
 (0)