@@ -117,23 +117,23 @@ impl Float for f32 {
117117 #[ inline]
118118 fn neg_zero ( ) -> f32 { -0.0 }
119119
120- /// Returns `true` if the number is NaN
120+ /// Returns `true` if the number is NaN.
121121 #[ inline]
122122 fn is_nan ( self ) -> bool { self != self }
123123
124- /// Returns `true` if the number is infinite
124+ /// Returns `true` if the number is infinite.
125125 #[ inline]
126126 fn is_infinite ( self ) -> bool {
127127 self == Float :: infinity ( ) || self == Float :: neg_infinity ( )
128128 }
129129
130- /// Returns `true` if the number is neither infinite or NaN
130+ /// Returns `true` if the number is neither infinite or NaN.
131131 #[ inline]
132132 fn is_finite ( self ) -> bool {
133133 !( self . is_nan ( ) || self . is_infinite ( ) )
134134 }
135135
136- /// Returns `true` if the number is neither zero, infinite, subnormal or NaN
136+ /// Returns `true` if the number is neither zero, infinite, subnormal or NaN.
137137 #[ inline]
138138 fn is_normal ( self ) -> bool {
139139 self . classify ( ) == FPNormal
@@ -195,25 +195,25 @@ impl Float for f32 {
195195 ( mantissa as u64 , exponent, sign)
196196 }
197197
198- /// Round half-way cases toward `NEG_INFINITY`
198+ /// Rounds towards minus infinity.
199199 #[ inline]
200200 fn floor ( self ) -> f32 {
201201 unsafe { intrinsics:: floorf32 ( self ) }
202202 }
203203
204- /// Round half-way cases toward `INFINITY`
204+ /// Rounds towards plus infinity.
205205 #[ inline]
206206 fn ceil ( self ) -> f32 {
207207 unsafe { intrinsics:: ceilf32 ( self ) }
208208 }
209209
210- /// Round half-way cases away from `0.0`
210+ /// Rounds to nearest integer. Rounds half-way cases away from zero.
211211 #[ inline]
212212 fn round ( self ) -> f32 {
213213 unsafe { intrinsics:: roundf32 ( self ) }
214214 }
215215
216- /// The integer part of the number (rounds towards `0.0`)
216+ /// Returns the integer part of the number (rounds towards zero).
217217 #[ inline]
218218 fn trunc ( self ) -> f32 {
219219 unsafe { intrinsics:: truncf32 ( self ) }
@@ -236,7 +236,7 @@ impl Float for f32 {
236236 unsafe { intrinsics:: fmaf32 ( self , a, b) }
237237 }
238238
239- /// The reciprocal (multiplicative inverse) of the number
239+ /// Returns the reciprocal (multiplicative inverse) of the number.
240240 #[ inline]
241241 fn recip ( self ) -> f32 { 1.0 / self }
242242
@@ -325,45 +325,45 @@ impl Float for f32 {
325325 #[ inline]
326326 fn ln_10 ( ) -> f32 { consts:: LN_10 }
327327
328- /// Returns the exponential of the number
328+ /// Returns the exponential of the number.
329329 #[ inline]
330330 fn exp ( self ) -> f32 {
331331 unsafe { intrinsics:: expf32 ( self ) }
332332 }
333333
334- /// Returns 2 raised to the power of the number
334+ /// Returns 2 raised to the power of the number.
335335 #[ inline]
336336 fn exp2 ( self ) -> f32 {
337337 unsafe { intrinsics:: exp2f32 ( self ) }
338338 }
339339
340- /// Returns the natural logarithm of the number
340+ /// Returns the natural logarithm of the number.
341341 #[ inline]
342342 fn ln ( self ) -> f32 {
343343 unsafe { intrinsics:: logf32 ( self ) }
344344 }
345345
346- /// Returns the logarithm of the number with respect to an arbitrary base
346+ /// Returns the logarithm of the number with respect to an arbitrary base.
347347 #[ inline]
348348 fn log ( self , base : f32 ) -> f32 { self . ln ( ) / base. ln ( ) }
349349
350- /// Returns the base 2 logarithm of the number
350+ /// Returns the base 2 logarithm of the number.
351351 #[ inline]
352352 fn log2 ( self ) -> f32 {
353353 unsafe { intrinsics:: log2f32 ( self ) }
354354 }
355355
356- /// Returns the base 10 logarithm of the number
356+ /// Returns the base 10 logarithm of the number.
357357 #[ inline]
358358 fn log10 ( self ) -> f32 {
359359 unsafe { intrinsics:: log10f32 ( self ) }
360360 }
361361
362- /// Converts to degrees, assuming the number is in radians
362+ /// Converts to degrees, assuming the number is in radians.
363363 #[ inline]
364364 fn to_degrees ( self ) -> f32 { self * ( 180.0f32 / Float :: pi ( ) ) }
365365
366- /// Converts to radians, assuming the number is in degrees
366+ /// Converts to radians, assuming the number is in degrees.
367367 #[ inline]
368368 fn to_radians ( self ) -> f32 {
369369 let value: f32 = Float :: pi ( ) ;
0 commit comments