Skip to content

Commit

Permalink
Ignore cast_precision_loss pedantic clippy lint
Browse files Browse the repository at this point in the history
    warning: casting `isize` to `f64` causes a loss of precision on targets with 64-bit wide pointers (`isize` is 64 bits wide, but `f64`'s mantissa is only 52 bits wide)
       --> src/diyfp.rs:259:21
        |
    259 |               if dk - k as f64 > 0.0 {
        |                       ^^^^^^^^
        |
       ::: src/lib.rs:196:9
        |
    196 | /         dtoa! {
    197 | |             floating_type: f32,
    198 | |             significand_type: u32,
    199 | |             exponent_type: i32,
    ...   |
    210 | |             min_power: (-36),
    211 | |         };
        | |_________- in this macro invocation
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_precision_loss
        = note: requested on the command line with `-W clippy::cast-precision-loss`
        = note: this warning originates in the macro `diyfp` which comes from the expansion of the macro `dtoa` (in Nightly builds, run with -Z macro-backtrace for more info)

    warning: casting `isize` to `f64` causes a loss of precision on targets with 64-bit wide pointers (`isize` is 64 bits wide, but `f64`'s mantissa is only 52 bits wide)
       --> src/diyfp.rs:256:22
        |
    256 |               let dk = (3 - $diy_significand_size - e) as f64 * 0.30102999566398114f64
        |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        |
       ::: src/lib.rs:242:9
        |
    242 | /         dtoa! {
    243 | |             floating_type: f64,
    244 | |             significand_type: u64,
    245 | |             exponent_type: isize,
    ...   |
    256 | |             min_power: (-348),
    257 | |         };
        | |_________- in this macro invocation
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_precision_loss
        = note: this warning originates in the macro `diyfp` which comes from the expansion of the macro `dtoa` (in Nightly builds, run with -Z macro-backtrace for more info)

    warning: casting `isize` to `f64` causes a loss of precision on targets with 64-bit wide pointers (`isize` is 64 bits wide, but `f64`'s mantissa is only 52 bits wide)
       --> src/diyfp.rs:259:21
        |
    259 |               if dk - k as f64 > 0.0 {
        |                       ^^^^^^^^
        |
       ::: src/lib.rs:242:9
        |
    242 | /         dtoa! {
    243 | |             floating_type: f64,
    244 | |             significand_type: u64,
    245 | |             exponent_type: isize,
    ...   |
    256 | |             min_power: (-348),
    257 | |         };
        | |_________- in this macro invocation
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#cast_precision_loss
        = note: this warning originates in the macro `diyfp` which comes from the expansion of the macro `dtoa` (in Nightly builds, run with -Z macro-backtrace for more info)
  • Loading branch information
dtolnay committed Apr 20, 2024
1 parent 3f8e970 commit d020388
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
clippy::cast_lossless,
clippy::cast_possible_truncation,
clippy::cast_possible_wrap,
clippy::cast_precision_loss,
clippy::cast_sign_loss,
clippy::doc_markdown,
clippy::expl_impl_clone_on_copy,
Expand Down

0 comments on commit d020388

Please sign in to comment.