Skip to content

Commit e6d8190

Browse files
committed
rollup merge of rust-lang#19615: steveklabnik/gh19595
Fixes rust-lang#19595.
2 parents fb587f1 + 131f202 commit e6d8190

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/doc/reference.md

+11-7
Original file line numberDiff line numberDiff line change
@@ -496,9 +496,8 @@ Examples of integer literals of various forms:
496496

497497
A _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

504503
By 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.
509508
Examples 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

520524
The two values of the boolean type are written `true` and `false`.

0 commit comments

Comments
 (0)