rust/src/libstd/num
Huon Wilson eb67f492de Deprecate {f32,f64}::abs_sub.
The abs_sub name is misleading: the function actually computes the
positive difference (`fdim` in C), not the `(x - y).abs()` that *many* people expect
from the name.

This function can be replaced with just `(x - y).max(0.0)`, mirroring
the `abs` version, but this behaves differently with NAN: `NAN.max(0.0)
== 0.0`, while `NAN.positive_diff(0.0) == NAN`. People who absolutely
need that behaviour can use the C function directly and/or talk to the libs
team (we haven't encountered a concrete use-case for this functionality).

Closes #30315.
2016-05-17 08:06:56 +10:00
..
f32.rs Deprecate {f32,f64}::abs_sub. 2016-05-17 08:06:56 +10:00
f64.rs Deprecate {f32,f64}::abs_sub. 2016-05-17 08:06:56 +10:00
mod.rs Implement RFC 1542 2016-05-07 08:52:41 -07:00