Module malachite_base::num::conversion::is_integer
source · Expand description
IsInteger
, a trait for determining whether a value is an integer.
§is_integer
use malachite_base::num::basic::traits::NegativeInfinity;
use malachite_base::num::conversion::traits::IsInteger;
assert_eq!(0.is_integer(), true);
assert_eq!(1.is_integer(), true);
assert_eq!(100.is_integer(), true);
assert_eq!((-1).is_integer(), true);
assert_eq!((-100).is_integer(), true);
assert_eq!(0.0.is_integer(), true);
assert_eq!(1.0.is_integer(), true);
assert_eq!(100.0.is_integer(), true);
assert_eq!((-1.0).is_integer(), true);
assert_eq!((-100.0).is_integer(), true);
assert_eq!(0.1.is_integer(), false);
assert_eq!(100.1.is_integer(), false);
assert_eq!(f32::NAN.is_integer(), false);
assert_eq!(f32::INFINITY.is_integer(), false);
assert_eq!(f32::NEGATIVE_INFINITY.is_integer(), false);