Module malachite_nz::integer::conversion::from_primitive_int
source · Expand description
Implementations of traits for converting a primitive integer to an
Integer
.
The traits are From
, TryFrom
,
ConvertibleFrom
, and
SaturatingFrom
.
§from
use malachite_nz::integer::Integer;
assert_eq!(Integer::from(123u32).to_string(), "123");
assert_eq!(Integer::from(-123i32).to_string(), "-123");