@@ -61,13 +61,13 @@ pub const MAX_10_EXP: i32 = 308;
6161
6262/// Not a Number (NaN).
6363#[ stable( feature = "rust1" , since = "1.0.0" ) ]
64- pub const NAN : f64 = 0.0_f64 / 0.0_f64 ;
64+ pub const NAN : f64 = 0.0_f64 / 0.0_f64 ;
6565/// Infinity (∞).
6666#[ stable( feature = "rust1" , since = "1.0.0" ) ]
67- pub const INFINITY : f64 = 1.0_f64 / 0.0_f64 ;
67+ pub const INFINITY : f64 = 1.0_f64 / 0.0_f64 ;
6868/// Negative infinity (-∞).
6969#[ stable( feature = "rust1" , since = "1.0.0" ) ]
70- pub const NEG_INFINITY : f64 = -1.0_f64 / 0.0_f64 ;
70+ pub const NEG_INFINITY : f64 = -1.0_f64 / 0.0_f64 ;
7171
7272/// Basic mathematical constants.
7373#[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -144,26 +144,40 @@ pub mod consts {
144144 issue = "32110" ) ]
145145impl Float for f64 {
146146 #[ inline]
147- fn nan ( ) -> f64 { NAN }
147+ fn nan ( ) -> f64 {
148+ NAN
149+ }
148150
149151 #[ inline]
150- fn infinity ( ) -> f64 { INFINITY }
152+ fn infinity ( ) -> f64 {
153+ INFINITY
154+ }
151155
152156 #[ inline]
153- fn neg_infinity ( ) -> f64 { NEG_INFINITY }
157+ fn neg_infinity ( ) -> f64 {
158+ NEG_INFINITY
159+ }
154160
155161 #[ inline]
156- fn zero ( ) -> f64 { 0.0 }
162+ fn zero ( ) -> f64 {
163+ 0.0
164+ }
157165
158166 #[ inline]
159- fn neg_zero ( ) -> f64 { -0.0 }
167+ fn neg_zero ( ) -> f64 {
168+ -0.0
169+ }
160170
161171 #[ inline]
162- fn one ( ) -> f64 { 1.0 }
172+ fn one ( ) -> f64 {
173+ 1.0
174+ }
163175
164176 /// Returns `true` if the number is NaN.
165177 #[ inline]
166- fn is_nan ( self ) -> bool { self != self }
178+ fn is_nan ( self ) -> bool {
179+ self != self
180+ }
167181
168182 /// Returns `true` if the number is infinite.
169183 #[ inline]
@@ -192,11 +206,11 @@ impl Float for f64 {
192206
193207 let bits: u64 = unsafe { mem:: transmute ( self ) } ;
194208 match ( bits & MAN_MASK , bits & EXP_MASK ) {
195- ( 0 , 0 ) => Fp :: Zero ,
196- ( _, 0 ) => Fp :: Subnormal ,
209+ ( 0 , 0 ) => Fp :: Zero ,
210+ ( _, 0 ) => Fp :: Subnormal ,
197211 ( 0 , EXP_MASK ) => Fp :: Infinite ,
198212 ( _, EXP_MASK ) => Fp :: Nan ,
199- _ => Fp :: Normal ,
213+ _ => Fp :: Normal ,
200214 }
201215 }
202216
@@ -252,7 +266,9 @@ impl Float for f64 {
252266
253267 /// Returns the reciprocal (multiplicative inverse) of the number.
254268 #[ inline]
255- fn recip ( self ) -> f64 { 1.0 / self }
269+ fn recip ( self ) -> f64 {
270+ 1.0 / self
271+ }
256272
257273 #[ inline]
258274 fn powi ( self , n : i32 ) -> f64 {
@@ -261,7 +277,9 @@ impl Float for f64 {
261277
262278 /// Converts to degrees, assuming the number is in radians.
263279 #[ inline]
264- fn to_degrees ( self ) -> f64 { self * ( 180.0f64 / consts:: PI ) }
280+ fn to_degrees ( self ) -> f64 {
281+ self * ( 180.0f64 / consts:: PI )
282+ }
265283
266284 /// Converts to radians, assuming the number is in degrees.
267285 #[ inline]
0 commit comments