File tree Expand file tree Collapse file tree 2 files changed +2
-18
lines changed Expand file tree Collapse file tree 2 files changed +2
-18
lines changed Original file line number Diff line number Diff line change @@ -910,15 +910,7 @@ impl f32 {
910910 pub fn asinh ( self ) -> f32 {
911911 match self {
912912 x if x == NEG_INFINITY => NEG_INFINITY ,
913- x if x. is_sign_negative ( ) => {
914- let v = ( x + ( ( x * x) + 1.0 ) . sqrt ( ) ) . ln ( ) ;
915- if v. is_sign_negative ( ) {
916- v
917- } else {
918- -v
919- }
920- }
921- x => ( x + ( ( x * x) + 1.0 ) . sqrt ( ) ) . ln ( )
913+ x => ( x + ( ( x * x) + 1.0 ) . sqrt ( ) ) . ln ( ) . copysign ( self )
922914 }
923915 }
924916
Original file line number Diff line number Diff line change @@ -833,15 +833,7 @@ impl f64 {
833833 pub fn asinh ( self ) -> f64 {
834834 match self {
835835 x if x == NEG_INFINITY => NEG_INFINITY ,
836- x if x. is_sign_negative ( ) => {
837- let v = ( x + ( ( x * x) + 1.0 ) . sqrt ( ) ) . ln ( ) ;
838- if v. is_sign_negative ( ) {
839- v
840- } else {
841- -v
842- }
843- }
844- x => ( x + ( ( x * x) + 1.0 ) . sqrt ( ) ) . ln ( )
836+ x => ( x + ( ( x * x) + 1.0 ) . sqrt ( ) ) . ln ( ) . copysign ( self )
845837 }
846838 }
847839
You can’t perform that action at this time.
0 commit comments