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:
102102let x : f64 = 2 . ; // type f64
103103```
104104
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+
105111[ constant expression ] : ../const_eval.md#constant-expressions
106112[ floating-point types ] : ../types/numeric.md#floating-point-types
107113[ lint check ] : ../attributes/diagnostics.md#lint-check-attributes
108114[ literal tokens ] : ../tokens.md#literals
109115[ numeric cast ] : operator-expr.md#numeric-cast
110116[ numeric types ] : ../types/numeric.md
111117[ 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
112120[ `u128::from_str_radix` ] : ../../core/primitive.u128.md#method.from_str_radix
113121[ CHAR_LITERAL ] : ../tokens.md#character-literals
114122[ STRING_LITERAL ] : ../tokens.md#string-literals
You can’t perform that action at this time.
0 commit comments