File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change 2
2
refs/heads/master: 3e561f05c00cd180ec02db4ccab2840a4aba93d2
3
3
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4
4
refs/heads/snap-stage3: ba0e1cd8147d452c356aacb29fb87568ca26f111
5
- refs/heads/try: 709f3c51302ca86617cca4a67648302c5088381c
5
+ refs/heads/try: cf650a217495940bdf3f8a843f5dd959b6e37b5e
6
6
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
7
7
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
8
8
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
Original file line number Diff line number Diff line change @@ -366,11 +366,19 @@ A _floating-point literal_ has one of two forms:
366
366
optionally followed by another decimal literal, with an optional _ exponent_ .
367
367
* A single _ decimal literal_ followed by an _ exponent_ .
368
368
369
- By default, a floating-point literal has a generic type, and, like integer
370
- literals, the type must be uniquely determined from the context. There are two valid
369
+ Like integer literals, a floating-point literal may be followed by a
370
+ suffix, so long as the pre-suffix part does not end with ` U+002E ` (` . ` ).
371
+ The suffix forcibly sets the type of the literal. There are two valid
371
372
_ floating-point suffixes_ , ` f32 ` and ` f64 ` (the 32-bit and 64-bit floating point
372
373
types), which explicitly determine the type of the literal.
373
374
375
+ The type of an _ unsuffixed_ floating-point literal is determined by type
376
+ inference. If a floating-point type can be _ uniquely_ determined from the
377
+ surrounding program context, the unsuffixed floating-point literal has that type.
378
+ If the program context underconstrains the type, it defaults to double-precision ` f64 ` ;
379
+ if the program context overconstrains the type, it is considered a static type
380
+ error.
381
+
374
382
Examples of floating-point literals of various forms:
375
383
376
384
```
You can’t perform that action at this time.
0 commit comments