@@ -61,13 +61,13 @@ pub const MAX_10_EXP: i32 = 308;
61
61
62
62
/// Not a Number (NaN).
63
63
#[ 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 ;
65
65
/// Infinity (∞).
66
66
#[ 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 ;
68
68
/// Negative infinity (-∞).
69
69
#[ 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 ;
71
71
72
72
/// Basic mathematical constants.
73
73
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
@@ -144,26 +144,40 @@ pub mod consts {
144
144
issue = "32110" ) ]
145
145
impl Float for f64 {
146
146
#[ inline]
147
- fn nan ( ) -> f64 { NAN }
147
+ fn nan ( ) -> f64 {
148
+ NAN
149
+ }
148
150
149
151
#[ inline]
150
- fn infinity ( ) -> f64 { INFINITY }
152
+ fn infinity ( ) -> f64 {
153
+ INFINITY
154
+ }
151
155
152
156
#[ inline]
153
- fn neg_infinity ( ) -> f64 { NEG_INFINITY }
157
+ fn neg_infinity ( ) -> f64 {
158
+ NEG_INFINITY
159
+ }
154
160
155
161
#[ inline]
156
- fn zero ( ) -> f64 { 0.0 }
162
+ fn zero ( ) -> f64 {
163
+ 0.0
164
+ }
157
165
158
166
#[ inline]
159
- fn neg_zero ( ) -> f64 { -0.0 }
167
+ fn neg_zero ( ) -> f64 {
168
+ -0.0
169
+ }
160
170
161
171
#[ inline]
162
- fn one ( ) -> f64 { 1.0 }
172
+ fn one ( ) -> f64 {
173
+ 1.0
174
+ }
163
175
164
176
/// Returns `true` if the number is NaN.
165
177
#[ inline]
166
- fn is_nan ( self ) -> bool { self != self }
178
+ fn is_nan ( self ) -> bool {
179
+ self != self
180
+ }
167
181
168
182
/// Returns `true` if the number is infinite.
169
183
#[ inline]
@@ -192,11 +206,11 @@ impl Float for f64 {
192
206
193
207
let bits: u64 = unsafe { mem:: transmute ( self ) } ;
194
208
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 ,
197
211
( 0 , EXP_MASK ) => Fp :: Infinite ,
198
212
( _, EXP_MASK ) => Fp :: Nan ,
199
- _ => Fp :: Normal ,
213
+ _ => Fp :: Normal ,
200
214
}
201
215
}
202
216
@@ -252,7 +266,9 @@ impl Float for f64 {
252
266
253
267
/// Returns the reciprocal (multiplicative inverse) of the number.
254
268
#[ inline]
255
- fn recip ( self ) -> f64 { 1.0 / self }
269
+ fn recip ( self ) -> f64 {
270
+ 1.0 / self
271
+ }
256
272
257
273
#[ inline]
258
274
fn powi ( self , n : i32 ) -> f64 {
@@ -261,7 +277,9 @@ impl Float for f64 {
261
277
262
278
/// Converts to degrees, assuming the number is in radians.
263
279
#[ 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
+ }
265
283
266
284
/// Converts to radians, assuming the number is in degrees.
267
285
#[ inline]
0 commit comments