Fixed some function names.

This commit is contained in:
Myrddin Dundragon 2018-04-29 03:55:53 -04:00
parent 98d720816d
commit 46f1bcafca

View File

@ -226,8 +226,10 @@ pub trait Real : Number + Constants + Neg<Output=Self>
/// assert_eq!(f64::NEG_INFINITY.signum(), -1.0f64); /// assert_eq!(f64::NEG_INFINITY.signum(), -1.0f64);
/// assert!(f64::NAN.signum().is_nan()); /// assert!(f64::NAN.signum().is_nan());
/// ``` /// ```
fn signum(self) -> Self; fn get_signum(self) -> Self;
/* TODO: Reimplement this when the error for 'use core::num::Float;'
goes away.
/// Returns the floating point category of the number. /// Returns the floating point category of the number.
/// If only one property is going to be tested, it is /// If only one property is going to be tested, it is
/// generally faster to use the specific predicate instead. /// generally faster to use the specific predicate instead.
@ -243,13 +245,14 @@ pub trait Real : Number + Constants + Neg<Output=Self>
/// let num64 = 12.4f64; /// let num64 = 12.4f64;
/// let inf64 = f64::INFINITY; /// let inf64 = f64::INFINITY;
/// ///
/// assert_eq!(num32.classify(), FpCategory::Normal); /// assert_eq!(num32.get_category(), FpCategory::Normal);
/// assert_eq!(inf32.classify(), FpCategory::Infinite); /// assert_eq!(inf32.get_category(), FpCategory::Infinite);
/// ///
/// assert_eq!(num64.classify(), FpCategory::Normal); /// assert_eq!(num64.get_category(), FpCategory::Normal);
/// assert_eq!(inf64.classify(), FpCategory::Infinite); /// assert_eq!(inf64.get_category(), FpCategory::Infinite);
/// ``` /// ```
fn classify(self) -> FpCategory; fn get_category(self) -> FpCategory;
*/
// TODO: Fix/check this example. // TODO: Fix/check this example.
/// Returns the mantissa, base 2 exponent, and sign as /// Returns the mantissa, base 2 exponent, and sign as
@ -273,7 +276,7 @@ pub trait Real : Number + Constants + Neg<Output=Self>
/// ///
/// assert!(abs_difference < Real::EPSILON); /// assert!(abs_difference < Real::EPSILON);
/// ``` /// ```
fn integer_decode(self) -> (u64, i16, i8); fn get_integer_decode(self) -> (u64, i16, i8);
/// Fused multiply-add. Computes `(self * a) + b` with /// Fused multiply-add. Computes `(self * a) + b` with
/// only one rounding error. This produces a more accurate /// only one rounding error. This produces a more accurate
@ -678,7 +681,7 @@ impl Real for f32
self.is_finite() && self > Self::zero() self.is_finite() && self > Self::zero()
} }
fn signum(self) -> Self fn get_signum(self) -> Self
{ {
if self.is_nan() == true if self.is_nan() == true
{ {
@ -698,12 +701,15 @@ impl Real for f32
} }
} }
fn classify(self) -> FpCategory /* TODO: Reimplement this when the error for 'use core::num::Float;'
goes away.
fn get_category(self) -> FpCategory
{ {
<Self>::classify(self) self.classify()
} }
*/
fn integer_decode(self) -> (u64, i16, i8) fn get_integer_decode(self) -> (u64, i16, i8)
{ {
let bits: u32; let bits: u32;
let sign: i8; let sign: i8;
@ -937,7 +943,7 @@ impl Real for f64
self.is_finite() && self > Self::zero() self.is_finite() && self > Self::zero()
} }
fn signum(self) -> Self fn get_signum(self) -> Self
{ {
if self.is_nan() == true if self.is_nan() == true
{ {
@ -957,12 +963,15 @@ impl Real for f64
} }
} }
fn classify(self) -> FpCategory /* TODO: Reimplement this when the error for 'use core::num::Float;'
goes away.
fn get_category(self) -> FpCategory
{ {
<Self>::classify(self) self.classify()
} }
*/
fn integer_decode(self) -> (u64, i16, i8) fn get_integer_decode(self) -> (u64, i16, i8)
{ {
let bits: u64; let bits: u64;
let sign: i8; let sign: i8;