pub trait ConstCarryingAdd: Sized {
// Required method
fn carrying_add(self, rhs: Self, carry: bool) -> (Self, bool);
}Expand description
Const-compatible addition with carry for extended precision arithmetic.
Performs self + rhs + carry, returning the sum and output carry.
This is a full adder operation useful for multi-word addition.
Required Methods§
Sourcefn carrying_add(self, rhs: Self, carry: bool) -> (Self, bool)
fn carrying_add(self, rhs: Self, carry: bool) -> (Self, bool)
Calculates self + rhs + carry, returning (sum, carry_out).
The carry input should be false for normal addition or true
to add an additional 1 (carry from a previous addition).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.