]> git.lizzy.rs Git - rust.git/commit
Fix a small mistake regarding NaNs in a deprecation message
authorTobias Bucher <tobiasbucher5991@gmail.com>
Sat, 15 Dec 2018 17:41:21 +0000 (18:41 +0100)
committerTobias Bucher <tobiasbucher5991@gmail.com>
Sat, 15 Dec 2018 17:41:21 +0000 (18:41 +0100)
commit967b1fc3b723117d57ff27417d811747b1bf1242
treee0c72ab809fa3996b829b8949e51d280308f3ddf
parent0a1b2267e45ed0a5bdbfcbe522024729c8bd1387
Fix a small mistake regarding NaNs in a deprecation message

`max` on floats returns the other argument if one of them is NaN, which
would be `0.0` in this case. This is unlike the C functions `fdim` and
`fdimf` which return NaN if either of their arguments is NaN.

https://doc.rust-lang.org/1.31.0/std/primitive.f32.html#method.max
https://en.cppreference.com/w/c/numeric/math/fdim
src/libstd/f32.rs
src/libstd/f64.rs