diff options
| author | bors <bors@rust-lang.org> | 2020-02-24 08:33:03 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-02-24 08:33:03 +0000 |
| commit | 2734e4e1f7faf59b4b7c9db7070626b8b7fd2145 (patch) | |
| tree | 08b93e137d6e77beb482e15b0340d27a6ed09be5 /src/rustllvm/CoverageMappingWrapper.cpp | |
| parent | c6ad3db8b5cad17bdacf9fae09ddabc6dc8f67d3 (diff) | |
| parent | ff0d44e45a27e688b5ee5447dc9175d5e72b37c9 (diff) | |
| download | rust-2734e4e1f7faf59b4b7c9db7070626b8b7fd2145.tar.gz rust-2734e4e1f7faf59b4b7c9db7070626b8b7fd2145.zip | |
Auto merge of #4897 - krishna-veerareddy:issue-2040-accurate-float-functions, r=flip1995
Add lint to improve floating-point expressions Looks for floating-point expressions that can be expressed using built-in methods to improve accuracy, performance and/or succinctness. changelog: Add lint `floating_point_improvements`. Fixes #4726 Partly addresses [#2040](https://github.com/rust-lang/rust-clippy/issues/2040) Currently linted expressions: | Expression | Suggestion | |---------------------------------|------------| | x.log(2.0) | x.log2() | | x.log(10.0) | x.log10() | | x.log(std::f32::consts::E) | x.ln() | | (1 + x).ln() | x.ln_1p() | | (2.0).powf(x) | x.exp2() | | (std::f32::consts::E).powf(x) | x.exp() | | x.powf(1/2) | x.sqrt() | | x.powf(1/3) | x.cbrt() | | x.powf(y), where y is whole | x.powi(y) | | x.exp() - 1 | x.exp_m1() | |x * y + z|x.mul_add(y, z)|
Diffstat (limited to 'src/rustllvm/CoverageMappingWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
