File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -102,13 +102,21 @@ Examples of floating-point literal expressions:
102
102
let x : f64 = 2 . ; // type f64
103
103
```
104
104
105
+ The value of the expression is determined from the string representation of the token as follows:
106
+
107
+ * Any underscores are removed from the string.
108
+
109
+ * The string is converted to the expression's type as if by [ ` f32::from_str ` ] or [ ` f64::from_str ` ] .
110
+
105
111
[ constant expression ] : ../const_eval.md#constant-expressions
106
112
[ floating-point types ] : ../types/numeric.md#floating-point-types
107
113
[ lint check ] : ../attributes/diagnostics.md#lint-check-attributes
108
114
[ literal tokens ] : ../tokens.md#literals
109
115
[ numeric cast ] : operator-expr.md#numeric-cast
110
116
[ numeric types ] : ../types/numeric.md
111
117
[ suffix ] : ../tokens.md#suffixes
118
+ [ `f32::from_str` ] : ../../core/primitive.f32.md#method.from_str
119
+ [ `f64::from_str` ] : ../../core/primitive.f64.md#method.from_str
112
120
[ `u128::from_str_radix` ] : ../../core/primitive.u128.md#method.from_str_radix
113
121
[ CHAR_LITERAL ] : ../tokens.md#character-literals
114
122
[ STRING_LITERAL ] : ../tokens.md#string-literals
You can’t perform that action at this time.
0 commit comments