]>
Commit | Line | Data |
---|---|---|
f20569fa XL |
1 | error: manual implementation of `abs` method |
2 | --> $DIR/floating_point_abs.rs:10:5 | |
3 | | | |
4 | LL | if num >= 0.0 { num } else { -num } | |
5 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `num.abs()` | |
6 | | | |
7 | = note: `-D clippy::suboptimal-flops` implied by `-D warnings` | |
8 | ||
9 | error: manual implementation of `abs` method | |
10 | --> $DIR/floating_point_abs.rs:14:5 | |
11 | | | |
12 | LL | if 0.0 < num { num } else { -num } | |
13 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `num.abs()` | |
14 | ||
15 | error: manual implementation of `abs` method | |
16 | --> $DIR/floating_point_abs.rs:18:5 | |
17 | | | |
18 | LL | if a.a > 0.0 { a.a } else { -a.a } | |
19 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `a.a.abs()` | |
20 | ||
21 | error: manual implementation of `abs` method | |
22 | --> $DIR/floating_point_abs.rs:22:5 | |
23 | | | |
24 | LL | if 0.0 >= num { -num } else { num } | |
25 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `num.abs()` | |
26 | ||
27 | error: manual implementation of `abs` method | |
28 | --> $DIR/floating_point_abs.rs:26:5 | |
29 | | | |
30 | LL | if a.a < 0.0 { -a.a } else { a.a } | |
31 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `a.a.abs()` | |
32 | ||
33 | error: manual implementation of negation of `abs` method | |
34 | --> $DIR/floating_point_abs.rs:30:5 | |
35 | | | |
36 | LL | if num < 0.0 { num } else { -num } | |
37 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `-num.abs()` | |
38 | ||
39 | error: manual implementation of negation of `abs` method | |
40 | --> $DIR/floating_point_abs.rs:34:5 | |
41 | | | |
42 | LL | if 0.0 >= num { num } else { -num } | |
43 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `-num.abs()` | |
44 | ||
45 | error: manual implementation of negation of `abs` method | |
46 | --> $DIR/floating_point_abs.rs:39:12 | |
47 | | | |
48 | LL | a: if a.a >= 0.0 { -a.a } else { a.a }, | |
49 | | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `-a.a.abs()` | |
50 | ||
51 | error: aborting due to 8 previous errors | |
52 |