diff options
Diffstat (limited to 'src/doc/reference.md')
| -rw-r--r-- | src/doc/reference.md | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/doc/reference.md b/src/doc/reference.md index e6ff29799f4..357ff813fef 100644 --- a/src/doc/reference.md +++ b/src/doc/reference.md @@ -515,6 +515,9 @@ This last example is different because it is not possible to use the suffix syntax with a floating point literal ending in a period. `2.f64` would attempt to call a method named `f64` on `2`. +The representation semantics of floating-point numbers are described in +["Machine Types"](#machine-types). + #### Boolean literals The two values of the boolean type are written `true` and `false`. @@ -3554,7 +3557,8 @@ Tuple types and values are denoted by listing the types or values of their elements, respectively, in a parenthesized, comma-separated list. Because tuple elements don't have a name, they can only be accessed by -pattern-matching. +pattern-matching or by using `N` directly as a field to access the +`N`th element. An example of a tuple type and its use: @@ -3563,6 +3567,7 @@ type Pair<'a> = (i32, &'a str); let p: Pair<'static> = (10, "hello"); let (a, b) = p; assert!(b != "world"); +assert!(p.0 == 10); ``` ### Array, and Slice types |
