rust/tests/ui/floating_point_powf.stderr

151 lines
5.5 KiB
Plaintext
Raw Normal View History

2019-12-20 19:57:47 -06:00
error: exponent for bases 2 and e can be computed more accurately
2020-02-22 22:32:13 -06:00
--> $DIR/floating_point_powf.rs:6:13
2019-12-20 19:57:47 -06:00
|
LL | let _ = 2f32.powf(x);
| ^^^^^^^^^^^^ help: consider using: `x.exp2()`
|
2020-02-17 14:56:55 -06:00
= note: `-D clippy::suboptimal-flops` implied by `-D warnings`
2019-12-20 19:57:47 -06:00
error: exponent for bases 2 and e can be computed more accurately
2020-02-22 22:32:13 -06:00
--> $DIR/floating_point_powf.rs:7:13
2019-12-20 19:57:47 -06:00
|
LL | let _ = 2f32.powf(3.1);
| ^^^^^^^^^^^^^^ help: consider using: `3.1f32.exp2()`
error: exponent for bases 2 and e can be computed more accurately
2020-02-22 22:32:13 -06:00
--> $DIR/floating_point_powf.rs:8:13
|
LL | let _ = 2f32.powf(-3.1);
| ^^^^^^^^^^^^^^^ help: consider using: `(-3.1f32).exp2()`
error: exponent for bases 2 and e can be computed more accurately
2020-02-22 22:32:13 -06:00
--> $DIR/floating_point_powf.rs:9:13
|
2019-12-20 19:57:47 -06:00
LL | let _ = std::f32::consts::E.powf(x);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.exp()`
error: exponent for bases 2 and e can be computed more accurately
2020-02-22 22:32:13 -06:00
--> $DIR/floating_point_powf.rs:10:13
|
LL | let _ = std::f32::consts::E.powf(3.1);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `3.1f32.exp()`
error: exponent for bases 2 and e can be computed more accurately
2020-02-22 22:32:13 -06:00
--> $DIR/floating_point_powf.rs:11:13
|
LL | let _ = std::f32::consts::E.powf(-3.1);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(-3.1f32).exp()`
2019-12-20 19:57:47 -06:00
error: square-root of a number can be computed more efficiently and accurately
2020-02-22 22:32:13 -06:00
--> $DIR/floating_point_powf.rs:12:13
2019-12-20 19:57:47 -06:00
|
LL | let _ = x.powf(1.0 / 2.0);
| ^^^^^^^^^^^^^^^^^ help: consider using: `x.sqrt()`
error: cube-root of a number can be computed more accurately
2020-02-22 22:32:13 -06:00
--> $DIR/floating_point_powf.rs:13:13
2019-12-20 19:57:47 -06:00
|
LL | let _ = x.powf(1.0 / 3.0);
| ^^^^^^^^^^^^^^^^^ help: consider using: `x.cbrt()`
|
= note: `-D clippy::imprecise-flops` implied by `-D warnings`
2019-12-20 19:57:47 -06:00
error: exponentiation with integer powers can be computed more efficiently
2020-02-22 22:32:13 -06:00
--> $DIR/floating_point_powf.rs:14:13
2019-12-20 19:57:47 -06:00
|
LL | let _ = x.powf(3.0);
| ^^^^^^^^^^^ help: consider using: `x.powi(3)`
2019-12-20 19:57:47 -06:00
error: exponentiation with integer powers can be computed more efficiently
2020-02-22 22:32:13 -06:00
--> $DIR/floating_point_powf.rs:15:13
2019-12-20 19:57:47 -06:00
|
LL | let _ = x.powf(-2.0);
| ^^^^^^^^^^^^ help: consider using: `x.powi(-2)`
2020-02-22 22:32:13 -06:00
error: exponentiation with integer powers can be computed more efficiently
--> $DIR/floating_point_powf.rs:16:13
|
LL | let _ = x.powf(16_777_215.0);
| ^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.powi(16_777_215)`
error: exponentiation with integer powers can be computed more efficiently
--> $DIR/floating_point_powf.rs:17:13
|
LL | let _ = x.powf(-16_777_215.0);
| ^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.powi(-16_777_215)`
2019-12-20 19:57:47 -06:00
error: exponent for bases 2 and e can be computed more accurately
--> $DIR/floating_point_powf.rs:25:13
2019-12-20 19:57:47 -06:00
|
LL | let _ = 2f64.powf(x);
| ^^^^^^^^^^^^ help: consider using: `x.exp2()`
error: exponent for bases 2 and e can be computed more accurately
--> $DIR/floating_point_powf.rs:26:13
|
LL | let _ = 2f64.powf(3.1);
| ^^^^^^^^^^^^^^ help: consider using: `3.1f64.exp2()`
error: exponent for bases 2 and e can be computed more accurately
--> $DIR/floating_point_powf.rs:27:13
|
LL | let _ = 2f64.powf(-3.1);
| ^^^^^^^^^^^^^^^ help: consider using: `(-3.1f64).exp2()`
error: exponent for bases 2 and e can be computed more accurately
--> $DIR/floating_point_powf.rs:28:13
2019-12-20 19:57:47 -06:00
|
LL | let _ = std::f64::consts::E.powf(x);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.exp()`
error: exponent for bases 2 and e can be computed more accurately
--> $DIR/floating_point_powf.rs:29:13
|
LL | let _ = std::f64::consts::E.powf(3.1);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `3.1f64.exp()`
error: exponent for bases 2 and e can be computed more accurately
--> $DIR/floating_point_powf.rs:30:13
|
LL | let _ = std::f64::consts::E.powf(-3.1);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `(-3.1f64).exp()`
2019-12-20 19:57:47 -06:00
error: square-root of a number can be computed more efficiently and accurately
--> $DIR/floating_point_powf.rs:31:13
2019-12-20 19:57:47 -06:00
|
LL | let _ = x.powf(1.0 / 2.0);
| ^^^^^^^^^^^^^^^^^ help: consider using: `x.sqrt()`
error: cube-root of a number can be computed more accurately
--> $DIR/floating_point_powf.rs:32:13
2019-12-20 19:57:47 -06:00
|
LL | let _ = x.powf(1.0 / 3.0);
| ^^^^^^^^^^^^^^^^^ help: consider using: `x.cbrt()`
error: exponentiation with integer powers can be computed more efficiently
--> $DIR/floating_point_powf.rs:33:13
2019-12-20 19:57:47 -06:00
|
LL | let _ = x.powf(3.0);
| ^^^^^^^^^^^ help: consider using: `x.powi(3)`
2019-12-20 19:57:47 -06:00
error: exponentiation with integer powers can be computed more efficiently
--> $DIR/floating_point_powf.rs:34:13
2019-12-20 19:57:47 -06:00
|
LL | let _ = x.powf(-2.0);
| ^^^^^^^^^^^^ help: consider using: `x.powi(-2)`
2020-02-22 22:32:13 -06:00
error: exponentiation with integer powers can be computed more efficiently
--> $DIR/floating_point_powf.rs:35:13
2020-02-22 22:32:13 -06:00
|
LL | let _ = x.powf(-2_147_483_648.0);
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.powi(-2_147_483_648)`
error: exponentiation with integer powers can be computed more efficiently
--> $DIR/floating_point_powf.rs:36:13
2020-02-22 22:32:13 -06:00
|
LL | let _ = x.powf(2_147_483_647.0);
| ^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `x.powi(2_147_483_647)`
error: aborting due to 24 previous errors
2019-12-20 19:57:47 -06:00