//! Arbitrarily large integers use crate::Unsigned; #[derive(Debug)] enum BigIntSign { Positive, Negative } #[derive(Debug)] pub struct BigInt { inner: Vec, sign: BigIntSign, } impl Default for BigInt { fn default() -> Self { Self { inner: vec![], sign: BigIntSign::Positive, } } } impl From for BigInt { fn from(n: T) -> Self { let mut new = Self::default(); if n > usize::max_value() { new.inner = Self.split(n); } new } } impl BigInt { /// Split an unsigned number into BigInt parts fn split(num: T) -> Vec { // Pretty easy if you don't actually need to split the value! if num < usize::max_value() { return vec![T::into()]; } todo!(); } } impl BigInt { pub fn new() -> Self { Self::default() } } #[cfg(test)] mod tests { }