File tree 2 files changed +2
-18
lines changed
2 files changed +2
-18
lines changed Original file line number Diff line number Diff line change @@ -910,15 +910,7 @@ impl f32 {
910
910
pub fn asinh ( self ) -> f32 {
911
911
match self {
912
912
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 )
922
914
}
923
915
}
924
916
Original file line number Diff line number Diff line change @@ -833,15 +833,7 @@ impl f64 {
833
833
pub fn asinh ( self ) -> f64 {
834
834
match self {
835
835
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 )
845
837
}
846
838
}
847
839
You can’t perform that action at this time.
0 commit comments