2020-03-03 23:52:53 +00:00
|
|
|
error: manual implementation of `abs` method
|
|
|
|
--> $DIR/floating_point_abs.rs:10:5
|
2020-02-28 20:40:13 +00:00
|
|
|
|
|
|
|
|
LL | / if num >= 0.0 {
|
|
|
|
LL | | num
|
|
|
|
LL | | } else {
|
|
|
|
LL | | -num
|
|
|
|
LL | | }
|
|
|
|
| |_____^ help: try: `num.abs()`
|
|
|
|
|
|
|
|
|
= note: `-D clippy::suboptimal-flops` implied by `-D warnings`
|
|
|
|
|
2020-03-03 23:52:53 +00:00
|
|
|
error: manual implementation of `abs` method
|
|
|
|
--> $DIR/floating_point_abs.rs:18:5
|
2020-02-29 21:46:59 +00:00
|
|
|
|
|
|
|
|
LL | / if 0.0 < num {
|
|
|
|
LL | | num
|
|
|
|
LL | | } else {
|
|
|
|
LL | | -num
|
|
|
|
LL | | }
|
|
|
|
| |_____^ help: try: `num.abs()`
|
|
|
|
|
2020-03-03 23:52:53 +00:00
|
|
|
error: manual implementation of `abs` method
|
|
|
|
--> $DIR/floating_point_abs.rs:26:5
|
2020-02-29 21:46:59 +00:00
|
|
|
|
|
|
|
|
LL | / if a.a > 0.0 {
|
|
|
|
LL | | a.a
|
|
|
|
LL | | } else {
|
|
|
|
LL | | -a.a
|
|
|
|
LL | | }
|
|
|
|
| |_____^ help: try: `a.a.abs()`
|
|
|
|
|
2020-03-03 23:52:53 +00:00
|
|
|
error: manual implementation of `abs` method
|
|
|
|
--> $DIR/floating_point_abs.rs:34:5
|
2020-02-29 21:46:59 +00:00
|
|
|
|
|
|
|
|
LL | / if 0.0 >= num {
|
|
|
|
LL | | -num
|
|
|
|
LL | | } else {
|
|
|
|
LL | | num
|
|
|
|
LL | | }
|
|
|
|
| |_____^ help: try: `num.abs()`
|
|
|
|
|
2020-03-03 23:52:53 +00:00
|
|
|
error: manual implementation of `abs` method
|
|
|
|
--> $DIR/floating_point_abs.rs:42:5
|
2020-02-29 21:46:59 +00:00
|
|
|
|
|
|
|
|
LL | / if a.a < 0.0 {
|
|
|
|
LL | | -a.a
|
|
|
|
LL | | } else {
|
|
|
|
LL | | a.a
|
|
|
|
LL | | }
|
|
|
|
| |_____^ help: try: `a.a.abs()`
|
|
|
|
|
2020-03-03 23:52:53 +00:00
|
|
|
error: manual implementation of negation of `abs` method
|
|
|
|
--> $DIR/floating_point_abs.rs:50:5
|
2020-02-29 21:46:59 +00:00
|
|
|
|
|
|
|
|
LL | / if num < 0.0 {
|
|
|
|
LL | | num
|
|
|
|
LL | | } else {
|
|
|
|
LL | | -num
|
|
|
|
LL | | }
|
|
|
|
| |_____^ help: try: `-num.abs()`
|
|
|
|
|
2020-03-03 23:52:53 +00:00
|
|
|
error: manual implementation of negation of `abs` method
|
|
|
|
--> $DIR/floating_point_abs.rs:58:5
|
2020-02-29 21:46:59 +00:00
|
|
|
|
|
|
|
|
LL | / if 0.0 >= num {
|
|
|
|
LL | | num
|
|
|
|
LL | | } else {
|
|
|
|
LL | | -num
|
|
|
|
LL | | }
|
|
|
|
| |_____^ help: try: `-num.abs()`
|
|
|
|
|
2020-03-03 23:52:53 +00:00
|
|
|
error: manual implementation of negation of `abs` method
|
|
|
|
--> $DIR/floating_point_abs.rs:67:12
|
2020-02-29 21:46:59 +00:00
|
|
|
|
|
2020-03-01 03:11:38 +00:00
|
|
|
LL | a: if a.a >= 0.0 { -a.a } else { a.a },
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `-a.a.abs()`
|
2020-02-29 21:46:59 +00:00
|
|
|
|
|
|
|
error: aborting due to 8 previous errors
|
2020-02-28 20:40:13 +00:00
|
|
|
|