File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -901,8 +901,8 @@ impl f32 {
901901 #[ stable( feature = "f32_deg_rad_conversions" , since = "1.7.0" ) ]
902902 #[ inline]
903903 pub fn to_radians ( self ) -> f32 {
904- let value : f32 = consts:: PI ;
905- self * ( value / 180.0f32 )
904+ const RADS_PER_DEG : f32 = consts:: PI / 180.0 ;
905+ self * RADS_PER_DEG
906906 }
907907
908908 /// Returns the maximum of the two numbers, ignoring NaN.
Original file line number Diff line number Diff line change @@ -912,8 +912,8 @@ impl f64 {
912912 #[ stable( feature = "rust1" , since = "1.0.0" ) ]
913913 #[ inline]
914914 pub fn to_radians ( self ) -> f64 {
915- let value : f64 = consts:: PI ;
916- self * ( value / 180.0 )
915+ const RADS_PER_DEG : f64 = consts:: PI / 180.0 ;
916+ self * RADS_PER_DEG
917917 }
918918
919919 /// Returns the maximum of the two numbers, ignoring NaN.
You can’t perform that action at this time.
0 commit comments