pub struct Int(/* private fields */);Expand description
An integer of any size: Lean’s Int.
Converts from every signed integer type, and back with TryFrom when the value fits. It
prints and parses as decimal digits with an optional minus sign.
use inlean_runtime::Int;
let n: Int = "-170141183460469231731687303715884105729".parse().unwrap(); // -2^127 - 1
assert!(i128::try_from(&n).is_err());
assert_eq!(Int::from(-7i8).to_string(), "-7");Like Nat, an Int cannot be sent to another thread.
Trait Implementations§
impl Eq for Int
impl FromLean for Int
Source§impl Ord for Int
impl Ord for Int
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialOrd for Int
impl PartialOrd for Int
impl ToLean for Int
Auto Trait Implementations§
impl !RefUnwindSafe for Int
impl !Send for Int
impl !Sync for Int
impl !UnwindSafe for Int
impl Forget for Int
impl Freeze for Int
impl Move for Int
impl Unpin for Int
impl UnsafeUnpin for Int
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more