Skip to content

Commit 8dcacf6

Browse files
literal-expr.md: say that suffixes are removed before interpreting numbers
1 parent 6264a32 commit 8dcacf6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/expressions/literal-expr.md

+4
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ The value of the expression is determined from the string representation of the
9696

9797
* If the radix is not 10, the first two characters are removed from the string.
9898

99+
* Any suffix is removed from the string.
100+
99101
* Any underscores are removed from the string.
100102

101103
* The string is converted to a `u128` value as if by [`u128::from_str_radix`] with the chosen radix.
@@ -136,6 +138,8 @@ let x: f64 = 2.; // type f64
136138

137139
The value of the expression is determined from the string representation of the token as follows:
138140

141+
* Any suffix is removed from the string.
142+
139143
* Any underscores are removed from the string.
140144

141145
* The string is converted to the expression's type as if by [`f32::from_str`] or [`f64::from_str`].

0 commit comments

Comments
 (0)