Skip to content

Commit 0e3d2ef

Browse files
committed
Specify representation of floating-point types
1 parent 21ad051 commit 0e3d2ef

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/values.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,17 @@ The representation of type `char` is the same as the representation of the `u32`
8080
r[value.primitive.bool]
8181
The two values of type `bool` are `true` and `false`. The representation of `true` is an initialized byte with value `0x01`, and the representation of `false` is an initialized byte with value `0x00`. Neither value is represented with a pointer fragment.
8282

83+
r[value.primitive.float]
84+
A floating-point value consists of either a rational number, which is within the range and precision dictated by the type, an infinity, or a NaN value.
85+
86+
r[value.primitive.float-repr]
87+
A floating-point value is represented the same as a value of the unsigned integer type with the same width given by its [IEEE 754-2019] encoding.
88+
89+
r[value.primitive.float-format]
90+
The [IEEE 754-2019] `binary32` format is used for `f32`, and the `binary64` format is used for `f64`.
91+
92+
[IEEE 754-2019]: https://ieeexplore.ieee.org/document/8766229
93+
8394
## Pointer Value
8495

8596
r[value.pointer]

0 commit comments

Comments
 (0)