Skip to content

f32/64::asinh() should return -0.0 for -0.0 #63271

Description

@TimothyGu

Currently, both of the following return false:

(-0.0 as f64).asinh().is_sign_negative()
(-0.0 as f32).asinh().is_sign_negative()

However, in other languages like C, asinh(-0.0) would always return -0.0. We might need another fast case for 0.0 and -0.0 here:

rust/src/libstd/f64.rs

Lines 833 to 839 in f01b9f8

pub fn asinh(self) -> f64 {
if self == NEG_INFINITY {
NEG_INFINITY
} else {
(self + ((self * self) + 1.0).sqrt()).ln()
}
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.T-libs-api[DEPRECATED; DO NOT USE]

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions