Enum rug::float::Special [−][src]
pub enum Special { Zero, NegZero, Infinity, NegInfinity, Nan, // some variants omitted }
Expand description
Special floating-point values.
Examples
use rug::{float::Special, Float}; let zero = Float::with_val(53, Special::Zero); let neg_zero = Float::with_val(53, Special::NegZero); let infinity = Float::with_val(53, Special::Infinity); let neg_infinity = Float::with_val(53, Special::NegInfinity); let nan = Float::with_val(53, Special::Nan); assert_eq!(zero, 0); assert!(zero.is_sign_positive()); assert_eq!(neg_zero, 0); assert!(neg_zero.is_sign_negative()); assert!(infinity.is_infinite()); assert!(infinity.is_sign_positive()); assert!(neg_infinity.is_infinite()); assert!(neg_infinity.is_sign_negative()); assert!(nan.is_nan());
Variants
Positive zero.
Negative zero.
Positive infinity.
Negative infinity.
Not a number.
Trait Implementations
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for Special
impl UnwindSafe for Special
Blanket Implementations
Mutably borrows from an owned value. Read more
Casts the value.
Casts the value.
Casts the value.
Casts the value.
Casts the value.