pub use crate::prelude::num_traits::Pow;
pub use console::traits::{
arithmetic::*,
bitwise::*,
from_bits::{SizeInBits, SizeInDataBits},
};
use crate::BooleanTrait;
pub trait Inverse {
type Output;
fn inverse(&self) -> Self::Output;
}
pub trait SquareRoot {
type Output;
fn square_root(&self) -> Self::Output;
}
pub trait Adder {
type Carry;
type Sum;
fn adder(&self, other: &Self, carry: &Self) -> (Self::Sum, Self::Carry);
}
pub trait Subtractor {
type Borrow;
type Difference;
fn subtractor(&self, other: &Self, borrow: &Self) -> (Self::Difference, Self::Borrow);
}
pub trait Zero {
type Boolean: BooleanTrait;
fn zero() -> Self
where
Self: Sized;
fn is_zero(&self) -> Self::Boolean;
}
pub trait One {
type Boolean: BooleanTrait;
fn one() -> Self
where
Self: Sized;
fn is_one(&self) -> Self::Boolean;
}
pub trait MSB {
type Boolean: BooleanTrait;
fn msb(&self) -> &Self::Boolean;
}