RS.CLIPPY.EXCESSIVE_PRECISION

Excessive precision for float literal

This checker is a Clippy lint created by The Rust Project Contributors. The documentation shown here is a copy of the original documentation for: excessive_precision. Copyright ©2025 The Rust Team. All rights reserved.

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