Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate {f32,f64}::abs_sub. #33664

Merged
merged 1 commit into from
May 23, 2016
Merged

Deprecate {f32,f64}::abs_sub. #33664

merged 1 commit into from
May 23, 2016

Commits on May 16, 2016

  1. 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 rust-lang#30315.
    huonw committed May 16, 2016
    Configuration menu
    Copy the full SHA
    eb67f49 View commit details
    Browse the repository at this point in the history