RS.CLIPPY.IMPRECISE_FLOPS
Usage of imprecise floating point operations
This checker is a Clippy lint created by The Rust Project Contributors. The documentation shown here is a copy of the original documentation for: imprecise_flops. Copyright ©2025 The Rust Team. All rights reserved.
What it does
Looks for floating-point expressions that can be expressed using built-in methods to improve accuracy at the cost of performance.
Why is this bad?
Negatively impacts accuracy.
Example
let a = 3f32;
let _ = a.powf(1.0 / 3.0);
let _ = (1.0 + a).ln();
let _ = a.exp() - 1.0;
Use instead:
let a = 3f32;
let _ = a.cbrt();
let _ = a.ln_1p();
let _ = a.exp_m1();