@@ -375,7 +375,7 @@ pub trait Float
375
375
fn from_str_r ( s : & str , round : Round ) -> Result < StatusAnd < Self > , ParseError > ;
376
376
fn to_bits ( self ) -> u128 ;
377
377
378
- /// Convert a floating point number to an integer according to the
378
+ /// Converts a floating point number to an integer according to the
379
379
/// rounding mode. In case of an invalid operation exception,
380
380
/// deterministic values are returned, namely zero for NaNs and the
381
381
/// minimal or maximal value respectively for underflow or overflow.
@@ -388,7 +388,7 @@ pub trait Float
388
388
///
389
389
/// The *is_exact output tells whether the result is exact, in the sense
390
390
/// that converting it back to the original floating point type produces
391
- /// the original value. This is almost equivalent to result== Status::OK,
391
+ /// the original value. This is almost equivalent to ` result == Status::OK` ,
392
392
/// except for negative zeroes.
393
393
fn to_i128_r ( self , width : usize , round : Round , is_exact : & mut bool ) -> StatusAnd < i128 > {
394
394
let status;
@@ -458,48 +458,48 @@ pub trait Float
458
458
}
459
459
}
460
460
461
- /// IEEE-754R isSignMinus: Returns true if and only if the current value is
461
+ /// IEEE-754R isSignMinus: Returns whether the current value is
462
462
/// negative.
463
463
///
464
464
/// This applies to zeros and NaNs as well.
465
465
fn is_negative ( self ) -> bool ;
466
466
467
- /// IEEE-754R isNormal: Returns true if and only if the current value is normal.
467
+ /// IEEE-754R isNormal: Returns whether the current value is normal.
468
468
///
469
469
/// This implies that the current value of the float is not zero, subnormal,
470
470
/// infinite, or NaN following the definition of normality from IEEE-754R.
471
471
fn is_normal ( self ) -> bool {
472
472
!self . is_denormal ( ) && self . is_finite_non_zero ( )
473
473
}
474
474
475
- /// Returns true if and only if the current value is zero, subnormal, or
475
+ /// Returns ` true` if the current value is zero, subnormal, or
476
476
/// normal.
477
477
///
478
478
/// This means that the value is not infinite or NaN.
479
479
fn is_finite ( self ) -> bool {
480
480
!self . is_nan ( ) && !self . is_infinite ( )
481
481
}
482
482
483
- /// Returns true if and only if the float is plus or minus zero.
483
+ /// Returns ` true` if the float is plus or minus zero.
484
484
fn is_zero ( self ) -> bool {
485
485
self . category ( ) == Category :: Zero
486
486
}
487
487
488
- /// IEEE-754R isSubnormal(): Returns true if and only if the float is a
488
+ /// IEEE-754R isSubnormal(): Returns whether the float is a
489
489
/// denormal.
490
490
fn is_denormal ( self ) -> bool ;
491
491
492
- /// IEEE-754R isInfinite(): Returns true if and only if the float is infinity.
492
+ /// IEEE-754R isInfinite(): Returns whether the float is infinity.
493
493
fn is_infinite ( self ) -> bool {
494
494
self . category ( ) == Category :: Infinity
495
495
}
496
496
497
- /// Returns true if and only if the float is a quiet or signaling NaN.
497
+ /// Returns ` true` if the float is a quiet or signaling NaN.
498
498
fn is_nan ( self ) -> bool {
499
499
self . category ( ) == Category :: NaN
500
500
}
501
501
502
- /// Returns true if and only if the float is a signaling NaN.
502
+ /// Returns ` true` if the float is a signaling NaN.
503
503
fn is_signaling ( self ) -> bool ;
504
504
505
505
// Simple Queries
@@ -518,19 +518,19 @@ pub trait Float
518
518
self . is_zero ( ) && self . is_negative ( )
519
519
}
520
520
521
- /// Returns true if and only if the number has the smallest possible non-zero
521
+ /// Returns ` true` if the number has the smallest possible non-zero
522
522
/// magnitude in the current semantics.
523
523
fn is_smallest ( self ) -> bool {
524
524
Self :: SMALLEST . copy_sign ( self ) . bitwise_eq ( self )
525
525
}
526
526
527
- /// Returns true if and only if the number has the largest possible finite
527
+ /// Returns ` true` if the number has the largest possible finite
528
528
/// magnitude in the current semantics.
529
529
fn is_largest ( self ) -> bool {
530
530
Self :: largest ( ) . copy_sign ( self ) . bitwise_eq ( self )
531
531
}
532
532
533
- /// Returns true if and only if the number is an exact integer.
533
+ /// Returns ` true` if the number is an exact integer.
534
534
fn is_integer ( self ) -> bool {
535
535
// This could be made more efficient; I'm going for obviously correct.
536
536
if !self . is_finite ( ) {
@@ -572,11 +572,11 @@ pub trait Float
572
572
}
573
573
574
574
pub trait FloatConvert < T : Float > : Float {
575
- /// Convert a value of one floating point type to another.
575
+ /// Converts a value of one floating point type to another.
576
576
/// The return value corresponds to the IEEE754 exceptions. *loses_info
577
577
/// records whether the transformation lost information, i.e., whether
578
578
/// converting the result back to the original type will produce the
579
- /// original value (this is almost the same as return value== Status::OK,
579
+ /// original value (this is almost the same as return ` value == Status::OK` ,
580
580
/// but there are edge cases where this is not so).
581
581
fn convert_r ( self , round : Round , loses_info : & mut bool ) -> StatusAnd < T > ;
582
582
fn convert ( self , loses_info : & mut bool ) -> StatusAnd < T > {
0 commit comments