File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed
Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -496,9 +496,8 @@ Examples of integer literals of various forms:
496496
497497A _ floating-point literal_ has one of two forms:
498498
499- * Two _ decimal literals_ separated by a period
500- character ` U+002E ` (` . ` ), with an optional _ exponent_ trailing after the
501- second decimal literal.
499+ * A _ decimal literal_ followed by a period character ` U+002E ` (` . ` ). This is
500+ optionally followed by another decimal literal, with an optional _ exponent_ .
502501* A single _ decimal literal_ followed by an _ exponent_ .
503502
504503By default, a floating-point literal has a generic type, and, like integer
@@ -509,12 +508,17 @@ types), which explicitly determine the type of the literal.
509508Examples of floating-point literals of various forms:
510509
511510```
512- 123.0f64; // type f64
513- 0.1f64; // type f64
514- 0.1f32; // type f32
515- 12E+99_f64; // type f64
511+ 123.0f64; // type f64
512+ 0.1f64; // type f64
513+ 0.1f32; // type f32
514+ 12E+99_f64; // type f64
515+ let x: f64 = 2.; // type f64
516516```
517517
518+ This last example is different because it is not possible to use the suffix
519+ syntax with a floating point literal ending in a period. ` 2.f64 ` would attempt
520+ to call a method named ` f64 ` on ` 2 ` .
521+
518522##### Boolean literals
519523
520524The two values of the boolean type are written ` true ` and ` false ` .
You can’t perform that action at this time.
0 commit comments