summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/src/docs/excessive_precision.txt
blob: 517879c47152b20fb30798b191cb0d627e403ca3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
### What it does
Checks for float literals with a precision greater
than that supported by the underlying type.

### Why is this bad?
Rust will truncate the literal silently.

### Example
```
let v: f32 = 0.123_456_789_9;
println!("{}", v); //  0.123_456_789
```

Use instead:
```
let v: f64 = 0.123_456_789_9;
println!("{}", v); //  0.123_456_789_9
```