@@ -665,7 +665,7 @@ impl f16 {
665
665
#[ unstable( feature = "f16" , issue = "116909" ) ]
666
666
#[ must_use = "method returns a new number and does not mutate the original value" ]
667
667
pub fn cbrt ( self ) -> f16 {
668
- ( unsafe { cmath:: cbrtf ( self as f32 ) } ) as f16
668
+ cmath:: cbrtf ( self as f32 ) as f16
669
669
}
670
670
671
671
/// Compute the distance between the origin and a point (`x`, `y`) on the
@@ -701,7 +701,7 @@ impl f16 {
701
701
#[ unstable( feature = "f16" , issue = "116909" ) ]
702
702
#[ must_use = "method returns a new number and does not mutate the original value" ]
703
703
pub fn hypot ( self , other : f16 ) -> f16 {
704
- ( unsafe { cmath:: hypotf ( self as f32 , other as f32 ) } ) as f16
704
+ cmath:: hypotf ( self as f32 , other as f32 ) as f16
705
705
}
706
706
707
707
/// Computes the sine of a number (in radians).
@@ -787,7 +787,7 @@ impl f16 {
787
787
#[ unstable( feature = "f16" , issue = "116909" ) ]
788
788
#[ must_use = "method returns a new number and does not mutate the original value" ]
789
789
pub fn tan ( self ) -> f16 {
790
- ( unsafe { cmath:: tanf ( self as f32 ) } ) as f16
790
+ cmath:: tanf ( self as f32 ) as f16
791
791
}
792
792
793
793
/// Computes the arcsine of a number. Return value is in radians in
@@ -822,7 +822,7 @@ impl f16 {
822
822
#[ unstable( feature = "f16" , issue = "116909" ) ]
823
823
#[ must_use = "method returns a new number and does not mutate the original value" ]
824
824
pub fn asin ( self ) -> f16 {
825
- ( unsafe { cmath:: asinf ( self as f32 ) } ) as f16
825
+ cmath:: asinf ( self as f32 ) as f16
826
826
}
827
827
828
828
/// Computes the arccosine of a number. Return value is in radians in
@@ -857,7 +857,7 @@ impl f16 {
857
857
#[ unstable( feature = "f16" , issue = "116909" ) ]
858
858
#[ must_use = "method returns a new number and does not mutate the original value" ]
859
859
pub fn acos ( self ) -> f16 {
860
- ( unsafe { cmath:: acosf ( self as f32 ) } ) as f16
860
+ cmath:: acosf ( self as f32 ) as f16
861
861
}
862
862
863
863
/// Computes the arctangent of a number. Return value is in radians in the
@@ -891,7 +891,7 @@ impl f16 {
891
891
#[ unstable( feature = "f16" , issue = "116909" ) ]
892
892
#[ must_use = "method returns a new number and does not mutate the original value" ]
893
893
pub fn atan ( self ) -> f16 {
894
- ( unsafe { cmath:: atanf ( self as f32 ) } ) as f16
894
+ cmath:: atanf ( self as f32 ) as f16
895
895
}
896
896
897
897
/// Computes the four quadrant arctangent of `self` (`y`) and `other` (`x`) in radians.
@@ -937,7 +937,7 @@ impl f16 {
937
937
#[ unstable( feature = "f16" , issue = "116909" ) ]
938
938
#[ must_use = "method returns a new number and does not mutate the original value" ]
939
939
pub fn atan2 ( self , other : f16 ) -> f16 {
940
- ( unsafe { cmath:: atan2f ( self as f32 , other as f32 ) } ) as f16
940
+ cmath:: atan2f ( self as f32 , other as f32 ) as f16
941
941
}
942
942
943
943
/// Simultaneously computes the sine and cosine of the number, `x`. Returns
@@ -1006,7 +1006,7 @@ impl f16 {
1006
1006
#[ unstable( feature = "f16" , issue = "116909" ) ]
1007
1007
#[ must_use = "method returns a new number and does not mutate the original value" ]
1008
1008
pub fn exp_m1 ( self ) -> f16 {
1009
- ( unsafe { cmath:: expm1f ( self as f32 ) } ) as f16
1009
+ cmath:: expm1f ( self as f32 ) as f16
1010
1010
}
1011
1011
1012
1012
/// Returns `ln(1+n)` (natural logarithm) more accurately than if
@@ -1053,7 +1053,7 @@ impl f16 {
1053
1053
#[ unstable( feature = "f16" , issue = "116909" ) ]
1054
1054
#[ must_use = "method returns a new number and does not mutate the original value" ]
1055
1055
pub fn ln_1p ( self ) -> f16 {
1056
- ( unsafe { cmath:: log1pf ( self as f32 ) } ) as f16
1056
+ cmath:: log1pf ( self as f32 ) as f16
1057
1057
}
1058
1058
1059
1059
/// Hyperbolic sine function.
@@ -1088,7 +1088,7 @@ impl f16 {
1088
1088
#[ unstable( feature = "f16" , issue = "116909" ) ]
1089
1089
#[ must_use = "method returns a new number and does not mutate the original value" ]
1090
1090
pub fn sinh ( self ) -> f16 {
1091
- ( unsafe { cmath:: sinhf ( self as f32 ) } ) as f16
1091
+ cmath:: sinhf ( self as f32 ) as f16
1092
1092
}
1093
1093
1094
1094
/// Hyperbolic cosine function.
@@ -1123,7 +1123,7 @@ impl f16 {
1123
1123
#[ unstable( feature = "f16" , issue = "116909" ) ]
1124
1124
#[ must_use = "method returns a new number and does not mutate the original value" ]
1125
1125
pub fn cosh ( self ) -> f16 {
1126
- ( unsafe { cmath:: coshf ( self as f32 ) } ) as f16
1126
+ cmath:: coshf ( self as f32 ) as f16
1127
1127
}
1128
1128
1129
1129
/// Hyperbolic tangent function.
@@ -1158,7 +1158,7 @@ impl f16 {
1158
1158
#[ unstable( feature = "f16" , issue = "116909" ) ]
1159
1159
#[ must_use = "method returns a new number and does not mutate the original value" ]
1160
1160
pub fn tanh ( self ) -> f16 {
1161
- ( unsafe { cmath:: tanhf ( self as f32 ) } ) as f16
1161
+ cmath:: tanhf ( self as f32 ) as f16
1162
1162
}
1163
1163
1164
1164
/// Inverse hyperbolic sine function.
@@ -1287,7 +1287,7 @@ impl f16 {
1287
1287
// #[unstable(feature = "float_gamma", issue = "99842")]
1288
1288
#[ must_use = "method returns a new number and does not mutate the original value" ]
1289
1289
pub fn gamma ( self ) -> f16 {
1290
- ( unsafe { cmath:: tgammaf ( self as f32 ) } ) as f16
1290
+ cmath:: tgammaf ( self as f32 ) as f16
1291
1291
}
1292
1292
1293
1293
/// Natural logarithm of the absolute value of the gamma function
@@ -1323,7 +1323,7 @@ impl f16 {
1323
1323
#[ must_use = "method returns a new number and does not mutate the original value" ]
1324
1324
pub fn ln_gamma ( self ) -> ( f16 , i32 ) {
1325
1325
let mut signgamp: i32 = 0 ;
1326
- let x = ( unsafe { cmath:: lgammaf_r ( self as f32 , & mut signgamp) } ) as f16 ;
1326
+ let x = cmath:: lgammaf_r ( self as f32 , & mut signgamp) as f16 ;
1327
1327
( x, signgamp)
1328
1328
}
1329
1329
@@ -1363,7 +1363,7 @@ impl f16 {
1363
1363
// #[unstable(feature = "float_erf", issue = "136321")]
1364
1364
#[ inline]
1365
1365
pub fn erf ( self ) -> f16 {
1366
- ( unsafe { cmath:: erff ( self as f32 ) } ) as f16
1366
+ cmath:: erff ( self as f32 ) as f16
1367
1367
}
1368
1368
1369
1369
/// Complementary error function.
@@ -1396,6 +1396,6 @@ impl f16 {
1396
1396
// #[unstable(feature = "float_erf", issue = "136321")]
1397
1397
#[ inline]
1398
1398
pub fn erfc ( self ) -> f16 {
1399
- ( unsafe { cmath:: erfcf ( self as f32 ) } ) as f16
1399
+ cmath:: erfcf ( self as f32 ) as f16
1400
1400
}
1401
1401
}
0 commit comments