use crate::num::basic::traits::Two;
use crate::rounding_modes::RoundingMode;
use core::cmp::Ordering;
pub trait Abs {
type Output;
fn abs(self) -> Self::Output;
}
pub trait AbsAssign {
fn abs_assign(&mut self);
}
pub trait UnsignedAbs {
type Output;
fn unsigned_abs(self) -> Self::Output;
}
pub trait AbsDiff<RHS = Self> {
type Output;
fn abs_diff(self, other: RHS) -> Self::Output;
}
pub trait AbsDiffAssign<RHS = Self> {
fn abs_diff_assign(&mut self, other: RHS);
}
pub trait AddMul<Y = Self, Z = Self> {
type Output;
fn add_mul(self, y: Y, z: Z) -> Self::Output;
}
pub trait AddMulAssign<Y = Self, Z = Self> {
fn add_mul_assign(&mut self, y: Y, z: Z);
}
pub trait Agm<RHS = Self> {
type Output;
fn agm(self, other: RHS) -> Self::Output;
}
pub trait AgmAssign<RHS = Self> {
fn agm_assign(&mut self, other: RHS);
}
pub trait ArithmeticCheckedShl<RHS> {
type Output;
fn arithmetic_checked_shl(self, other: RHS) -> Option<Self::Output>;
}
pub trait ArithmeticCheckedShr<RHS> {
type Output;
fn arithmetic_checked_shr(self, other: RHS) -> Option<Self::Output>;
}
pub trait BinomialCoefficient<T = Self> {
fn binomial_coefficient(n: T, k: T) -> Self;
}
pub trait CheckedBinomialCoefficient<T = Self>: Sized {
fn checked_binomial_coefficient(n: T, k: T) -> Option<Self>;
}
pub trait Ceiling {
type Output;
fn ceiling(self) -> Self::Output;
}
pub trait CeilingAssign {
fn ceiling_assign(&mut self);
}
pub trait CheckedAbs {
type Output;
fn checked_abs(self) -> Option<Self::Output>;
}
pub trait CheckedAdd<RHS = Self> {
type Output;
fn checked_add(self, other: RHS) -> Option<Self::Output>;
}
pub trait CheckedAddMul<Y = Self, Z = Self> {
type Output;
fn checked_add_mul(self, y: Y, z: Z) -> Option<Self::Output>;
}
pub trait CheckedDiv<RHS = Self> {
type Output;
fn checked_div(self, other: RHS) -> Option<Self::Output>;
}
pub trait CheckedMul<RHS = Self> {
type Output;
fn checked_mul(self, other: RHS) -> Option<Self::Output>;
}
pub trait CheckedNeg {
type Output;
fn checked_neg(self) -> Option<Self::Output>;
}
pub trait CheckedNextPowerOf2 {
type Output;
fn checked_next_power_of_2(self) -> Option<Self::Output>;
}
pub trait CheckedPow<RHS> {
type Output;
fn checked_pow(self, exp: RHS) -> Option<Self::Output>;
}
pub trait CheckedSquare {
type Output;
fn checked_square(self) -> Option<Self::Output>;
}
pub trait CheckedSub<RHS = Self> {
type Output;
fn checked_sub(self, other: RHS) -> Option<Self::Output>;
}
pub trait CheckedSubMul<Y = Self, Z = Self> {
type Output;
fn checked_sub_mul(self, y: Y, z: Z) -> Option<Self::Output>;
}
pub trait CoprimeWith<RHS = Self> {
fn coprime_with(self, other: RHS) -> bool;
}
pub trait DivExact<RHS = Self> {
type Output;
fn div_exact(self, other: RHS) -> Self::Output;
}
pub trait DivExactAssign<RHS = Self> {
fn div_exact_assign(&mut self, other: RHS);
}
pub trait DivMod<RHS = Self> {
type DivOutput;
type ModOutput;
fn div_mod(self, other: RHS) -> (Self::DivOutput, Self::ModOutput);
}
pub trait DivAssignMod<RHS = Self> {
type ModOutput;
fn div_assign_mod(&mut self, other: RHS) -> Self::ModOutput;
}
pub trait DivRem<RHS = Self> {
type DivOutput;
type RemOutput;
fn div_rem(self, other: RHS) -> (Self::DivOutput, Self::RemOutput);
}
pub trait DivAssignRem<RHS = Self> {
type RemOutput;
fn div_assign_rem(&mut self, other: RHS) -> Self::RemOutput;
}
pub trait CeilingDivNegMod<RHS = Self> {
type DivOutput;
type ModOutput;
fn ceiling_div_neg_mod(self, other: RHS) -> (Self::DivOutput, Self::ModOutput);
}
pub trait CeilingDivAssignNegMod<RHS = Self> {
type ModOutput;
fn ceiling_div_assign_neg_mod(&mut self, other: RHS) -> Self::ModOutput;
}
pub trait CeilingDivMod<RHS = Self> {
type DivOutput;
type ModOutput;
fn ceiling_div_mod(self, other: RHS) -> (Self::DivOutput, Self::ModOutput);
}
pub trait CeilingDivAssignMod<RHS = Self> {
type ModOutput;
fn ceiling_div_assign_mod(&mut self, other: RHS) -> Self::ModOutput;
}
pub trait DivRound<RHS = Self> {
type Output;
fn div_round(self, other: RHS, rm: RoundingMode) -> (Self::Output, Ordering);
}
pub trait DivRoundAssign<RHS = Self> {
fn div_round_assign(&mut self, other: RHS, rm: RoundingMode) -> Ordering;
}
pub trait DivisibleByPowerOf2 {
fn divisible_by_power_of_2(self, pow: u64) -> bool;
}
pub trait DivisibleBy<RHS = Self> {
fn divisible_by(self, other: RHS) -> bool;
}
pub trait EqModPowerOf2<RHS = Self> {
fn eq_mod_power_of_2(self, other: RHS, pow: u64) -> bool;
}
pub trait EqMod<RHS = Self, M = Self> {
fn eq_mod(self, other: RHS, m: M) -> bool;
}
pub trait ExtendedGcd<RHS = Self> {
type Gcd;
type Cofactor;
fn extended_gcd(self, other: RHS) -> (Self::Gcd, Self::Cofactor, Self::Cofactor);
}
pub trait Factorial {
fn factorial(n: u64) -> Self;
}
pub trait CheckedFactorial: Sized {
fn checked_factorial(n: u64) -> Option<Self>;
}
pub trait DoubleFactorial {
fn double_factorial(n: u64) -> Self;
}
pub trait CheckedDoubleFactorial: Sized {
fn checked_double_factorial(n: u64) -> Option<Self>;
}
pub trait Multifactorial {
fn multifactorial(n: u64, m: u64) -> Self;
}
pub trait CheckedMultifactorial: Sized {
fn checked_multifactorial(n: u64, m: u64) -> Option<Self>;
}
pub trait Subfactorial {
fn subfactorial(n: u64) -> Self;
}
pub trait CheckedSubfactorial: Sized {
fn checked_subfactorial(n: u64) -> Option<Self>;
}
pub trait Floor {
type Output;
fn floor(self) -> Self::Output;
}
pub trait FloorAssign {
fn floor_assign(&mut self);
}
pub trait Gcd<RHS = Self> {
type Output;
fn gcd(self, other: RHS) -> Self::Output;
}
pub trait GcdAssign<RHS = Self> {
fn gcd_assign(&mut self, other: RHS);
}
pub trait IsPowerOf2 {
fn is_power_of_2(&self) -> bool;
}
pub trait Lcm<RHS = Self> {
type Output;
fn lcm(self, other: RHS) -> Self::Output;
}
pub trait LcmAssign<RHS = Self> {
fn lcm_assign(&mut self, other: RHS);
}
pub trait Ln {
type Output;
fn ln(self) -> Self::Output;
}
pub trait CheckedLcm<RHS = Self> {
type Output;
fn checked_lcm(self, other: RHS) -> Option<Self::Output>;
}
pub trait LegendreSymbol<RHS = Self> {
fn legendre_symbol(self, other: RHS) -> i8;
}
pub trait JacobiSymbol<RHS = Self> {
fn jacobi_symbol(self, other: RHS) -> i8;
}
pub trait KroneckerSymbol<RHS = Self> {
fn kronecker_symbol(self, other: RHS) -> i8;
}
pub trait CheckedLogBase<B = Self> {
type Output;
fn checked_log_base(self, base: B) -> Option<Self::Output>;
}
pub trait FloorLogBase<B = Self> {
type Output;
fn floor_log_base(self, base: B) -> Self::Output;
}
pub trait CeilingLogBase<B = Self> {
type Output;
fn ceiling_log_base(self, base: B) -> Self::Output;
}
pub trait CheckedLogBase2 {
type Output;
fn checked_log_base_2(self) -> Option<Self::Output>;
}
pub trait FloorLogBase2 {
type Output;
fn floor_log_base_2(self) -> Self::Output;
}
pub trait CeilingLogBase2 {
type Output;
fn ceiling_log_base_2(self) -> Self::Output;
}
pub trait CheckedLogBasePowerOf2<POW> {
type Output;
fn checked_log_base_power_of_2(self, pow: POW) -> Option<Self::Output>;
}
pub trait FloorLogBasePowerOf2<POW> {
type Output;
fn floor_log_base_power_of_2(self, pow: POW) -> Self::Output;
}
pub trait CeilingLogBasePowerOf2<POW> {
type Output;
fn ceiling_log_base_power_of_2(self, pow: POW) -> Self::Output;
}
pub trait ModAdd<RHS = Self, M = Self> {
type Output;
fn mod_add(self, other: RHS, m: M) -> Self::Output;
}
pub trait ModAddAssign<RHS = Self, M = Self> {
fn mod_add_assign(&mut self, other: RHS, m: M);
}
pub trait ModInverse<M = Self> {
type Output;
fn mod_inverse(self, m: M) -> Option<Self::Output>;
}
pub trait ModIsReduced<M = Self> {
fn mod_is_reduced(&self, m: &M) -> bool;
}
pub trait ModMul<RHS = Self, M = Self> {
type Output;
fn mod_mul(self, other: RHS, m: M) -> Self::Output;
}
pub trait ModMulAssign<RHS = Self, M = Self> {
fn mod_mul_assign(&mut self, other: RHS, m: M);
}
pub trait ModMulPrecomputed<RHS = Self, M = Self> {
type Output;
type Data;
fn precompute_mod_mul_data(m: &M) -> Self::Data;
fn mod_mul_precomputed(self, other: RHS, m: M, data: &Self::Data) -> Self::Output;
}
pub trait ModMulPrecomputedAssign<RHS = Self, M = Self>: ModMulPrecomputed<RHS, M> {
fn mod_mul_precomputed_assign(&mut self, other: RHS, m: M, data: &Self::Data);
}
pub trait ModNeg<M = Self> {
type Output;
fn mod_neg(self, m: M) -> Self::Output;
}
pub trait ModNegAssign<M = Self> {
fn mod_neg_assign(&mut self, m: M);
}
pub trait Mod<RHS = Self> {
type Output;
fn mod_op(self, other: RHS) -> Self::Output;
}
pub trait ModAssign<RHS = Self> {
fn mod_assign(&mut self, other: RHS);
}
pub trait NegMod<RHS = Self> {
type Output;
fn neg_mod(self, other: RHS) -> Self::Output;
}
pub trait NegModAssign<RHS = Self> {
fn neg_mod_assign(&mut self, other: RHS);
}
pub trait CeilingMod<RHS = Self> {
type Output;
fn ceiling_mod(self, other: RHS) -> Self::Output;
}
pub trait CeilingModAssign<RHS = Self> {
fn ceiling_mod_assign(&mut self, other: RHS);
}
pub trait ModPow<RHS = Self, M = Self> {
type Output;
fn mod_pow(self, exp: RHS, m: M) -> Self::Output;
}
pub trait ModPowAssign<RHS = Self, M = Self> {
fn mod_pow_assign(&mut self, exp: RHS, m: M);
}
pub trait ModPowPrecomputed<RHS = Self, M = Self>
where
Self: Sized,
{
type Output;
type Data;
fn precompute_mod_pow_data(m: &M) -> Self::Data;
fn mod_pow_precomputed(self, exp: RHS, m: M, data: &Self::Data) -> Self::Output;
}
pub trait ModPowPrecomputedAssign<RHS: Two = Self, M = Self>: ModPowPrecomputed<RHS, M> {
fn mod_pow_precomputed_assign(&mut self, exp: RHS, m: M, data: &Self::Data);
}
pub trait ModPowerOf2Add<RHS = Self> {
type Output;
fn mod_power_of_2_add(self, other: RHS, pow: u64) -> Self::Output;
}
pub trait ModPowerOf2AddAssign<RHS = Self> {
fn mod_power_of_2_add_assign(&mut self, other: RHS, pow: u64);
}
pub trait ModPowerOf2Inverse {
type Output;
fn mod_power_of_2_inverse(self, pow: u64) -> Option<Self::Output>;
}
pub trait ModPowerOf2IsReduced {
fn mod_power_of_2_is_reduced(&self, pow: u64) -> bool;
}
pub trait ModPowerOf2Mul<RHS = Self> {
type Output;
fn mod_power_of_2_mul(self, other: RHS, pow: u64) -> Self::Output;
}
pub trait ModPowerOf2MulAssign<RHS = Self> {
fn mod_power_of_2_mul_assign(&mut self, other: RHS, pow: u64);
}
pub trait ModPowerOf2Neg {
type Output;
fn mod_power_of_2_neg(self, pow: u64) -> Self::Output;
}
pub trait ModPowerOf2NegAssign {
fn mod_power_of_2_neg_assign(&mut self, pow: u64);
}
pub trait ModPowerOf2Pow<RHS = Self> {
type Output;
fn mod_power_of_2_pow(self, exp: RHS, pow: u64) -> Self::Output;
}
pub trait ModPowerOf2PowAssign<RHS = Self> {
fn mod_power_of_2_pow_assign(&mut self, exp: RHS, pow: u64);
}
pub trait ModPowerOf2Shl<RHS> {
type Output;
fn mod_power_of_2_shl(self, other: RHS, pow: u64) -> Self::Output;
}
pub trait ModPowerOf2ShlAssign<RHS> {
fn mod_power_of_2_shl_assign(&mut self, other: RHS, pow: u64);
}
pub trait ModPowerOf2Shr<RHS> {
type Output;
fn mod_power_of_2_shr(self, other: RHS, pow: u64) -> Self::Output;
}
pub trait ModPowerOf2ShrAssign<RHS> {
fn mod_power_of_2_shr_assign(&mut self, other: RHS, pow: u64);
}
pub trait ModPowerOf2Square {
type Output;
fn mod_power_of_2_square(self, pow: u64) -> Self::Output;
}
pub trait ModPowerOf2SquareAssign {
fn mod_power_of_2_square_assign(&mut self, pow: u64);
}
pub trait ModPowerOf2Sub<RHS = Self> {
type Output;
fn mod_power_of_2_sub(self, other: RHS, pow: u64) -> Self::Output;
}
pub trait ModPowerOf2SubAssign<RHS = Self> {
fn mod_power_of_2_sub_assign(&mut self, other: RHS, pow: u64);
}
pub trait ModPowerOf2 {
type Output;
fn mod_power_of_2(self, other: u64) -> Self::Output;
}
pub trait ModPowerOf2Assign {
fn mod_power_of_2_assign(&mut self, other: u64);
}
pub trait RemPowerOf2 {
type Output;
fn rem_power_of_2(self, other: u64) -> Self::Output;
}
pub trait RemPowerOf2Assign {
fn rem_power_of_2_assign(&mut self, other: u64);
}
pub trait NegModPowerOf2 {
type Output;
fn neg_mod_power_of_2(self, other: u64) -> Self::Output;
}
pub trait NegModPowerOf2Assign {
fn neg_mod_power_of_2_assign(&mut self, other: u64);
}
pub trait CeilingModPowerOf2 {
type Output;
fn ceiling_mod_power_of_2(self, other: u64) -> Self::Output;
}
pub trait CeilingModPowerOf2Assign {
fn ceiling_mod_power_of_2_assign(&mut self, other: u64);
}
pub trait ModShl<RHS, M = Self> {
type Output;
fn mod_shl(self, other: RHS, m: M) -> Self::Output;
}
pub trait ModShlAssign<RHS, M = Self> {
fn mod_shl_assign(&mut self, other: RHS, m: M);
}
pub trait ModShr<RHS, M = Self> {
type Output;
fn mod_shr(self, other: RHS, m: M) -> Self::Output;
}
pub trait ModShrAssign<RHS, M = Self> {
fn mod_shr_assign(&mut self, other: RHS, m: M);
}
pub trait ModSquare<M = Self> {
type Output;
fn mod_square(self, m: M) -> Self::Output;
}
pub trait ModSquareAssign<M = Self> {
fn mod_square_assign(&mut self, m: M);
}
pub trait ModSquarePrecomputed<RHS = Self, M = Self>: ModPowPrecomputed<RHS, M>
where
Self: Sized,
{
fn mod_square_precomputed(self, m: M, data: &Self::Data) -> Self::Output;
}
pub trait ModSquarePrecomputedAssign<RHS = Self, M = Self>: ModPowPrecomputed<RHS, M> {
fn mod_square_precomputed_assign(&mut self, m: M, data: &Self::Data);
}
pub trait ModSub<RHS = Self, M = Self> {
type Output;
fn mod_sub(self, other: RHS, m: M) -> Self::Output;
}
pub trait ModSubAssign<RHS = Self, M = Self> {
fn mod_sub_assign(&mut self, other: RHS, m: M);
}
pub trait NegAssign {
fn neg_assign(&mut self);
}
pub trait NextPowerOf2 {
type Output;
fn next_power_of_2(self) -> Self::Output;
}
pub trait NextPowerOf2Assign {
fn next_power_of_2_assign(&mut self);
}
pub trait OverflowingAbs {
type Output;
fn overflowing_abs(self) -> (Self::Output, bool);
}
pub trait OverflowingAbsAssign {
fn overflowing_abs_assign(&mut self) -> bool;
}
pub trait OverflowingAdd<RHS = Self> {
type Output;
fn overflowing_add(self, other: RHS) -> (Self::Output, bool);
}
pub trait OverflowingAddAssign<RHS = Self> {
fn overflowing_add_assign(&mut self, other: RHS) -> bool;
}
pub trait OverflowingAddMul<Y = Self, Z = Self> {
type Output;
fn overflowing_add_mul(self, y: Y, z: Z) -> (Self::Output, bool);
}
pub trait OverflowingAddMulAssign<Y = Self, Z = Self> {
fn overflowing_add_mul_assign(&mut self, y: Y, z: Z) -> bool;
}
pub trait OverflowingDiv<RHS = Self> {
type Output;
fn overflowing_div(self, other: RHS) -> (Self::Output, bool);
}
pub trait OverflowingDivAssign<RHS = Self> {
fn overflowing_div_assign(&mut self, other: RHS) -> bool;
}
pub trait OverflowingMul<RHS = Self> {
type Output;
fn overflowing_mul(self, other: RHS) -> (Self::Output, bool);
}
pub trait OverflowingMulAssign<RHS = Self> {
fn overflowing_mul_assign(&mut self, other: RHS) -> bool;
}
pub trait OverflowingNeg {
type Output;
fn overflowing_neg(self) -> (Self::Output, bool);
}
pub trait OverflowingNegAssign {
fn overflowing_neg_assign(&mut self) -> bool;
}
pub trait OverflowingPow<RHS> {
type Output;
fn overflowing_pow(self, exp: RHS) -> (Self::Output, bool);
}
pub trait OverflowingPowAssign<RHS = Self> {
fn overflowing_pow_assign(&mut self, exp: RHS) -> bool;
}
pub trait OverflowingSquare {
type Output;
fn overflowing_square(self) -> (Self::Output, bool);
}
pub trait OverflowingSquareAssign {
fn overflowing_square_assign(&mut self) -> bool;
}
pub trait OverflowingSub<RHS = Self> {
type Output;
fn overflowing_sub(self, other: RHS) -> (Self::Output, bool);
}
pub trait OverflowingSubAssign<RHS = Self> {
fn overflowing_sub_assign(&mut self, other: RHS) -> bool;
}
pub trait OverflowingSubMul<Y = Self, Z = Self> {
type Output;
fn overflowing_sub_mul(self, y: Y, z: Z) -> (Self::Output, bool);
}
pub trait OverflowingSubMulAssign<Y = Self, Z = Self> {
fn overflowing_sub_mul_assign(&mut self, y: Y, z: Z) -> bool;
}
pub trait Parity {
fn even(self) -> bool;
fn odd(self) -> bool;
}
pub trait Pow<RHS> {
type Output;
fn pow(self, exp: RHS) -> Self::Output;
}
pub trait PowAssign<RHS = Self> {
fn pow_assign(&mut self, exp: RHS);
}
pub trait PowerOf2<POW> {
fn power_of_2(pow: POW) -> Self;
}
pub trait Primorial {
fn primorial(n: u64) -> Self;
fn product_of_first_n_primes(n: u64) -> Self;
}
pub trait CheckedPrimorial: Sized {
fn checked_primorial(n: u64) -> Option<Self>;
fn checked_product_of_first_n_primes(n: u64) -> Option<Self>;
}
pub trait Reciprocal {
type Output;
fn reciprocal(self) -> Self::Output;
}
pub trait ReciprocalAssign {
fn reciprocal_assign(&mut self);
}
pub trait ReciprocalSqrt {
type Output;
fn reciprocal_sqrt(self) -> Self::Output;
}
pub trait ReciprocalSqrtAssign {
fn reciprocal_sqrt_assign(&mut self);
}
pub trait FloorRoot<POW> {
type Output;
fn floor_root(self, pow: POW) -> Self::Output;
}
pub trait FloorRootAssign<POW> {
fn floor_root_assign(&mut self, pow: POW);
}
pub trait CeilingRoot<POW> {
type Output;
fn ceiling_root(self, pow: POW) -> Self::Output;
}
pub trait CeilingRootAssign<POW> {
fn ceiling_root_assign(&mut self, pow: POW);
}
pub trait CheckedRoot<POW> {
type Output;
fn checked_root(self, pow: POW) -> Option<Self::Output>;
}
pub trait RootRem<POW> {
type RootOutput;
type RemOutput;
fn root_rem(self, exp: POW) -> (Self::RootOutput, Self::RemOutput);
}
pub trait RootAssignRem<POW> {
type RemOutput;
fn root_assign_rem(&mut self, exp: POW) -> Self::RemOutput;
}
pub trait RotateLeft {
type Output;
fn rotate_left(self, n: u64) -> Self::Output;
}
pub trait RotateLeftAssign {
fn rotate_left_assign(&mut self, n: u64);
}
pub trait RotateRight {
type Output;
fn rotate_right(self, n: u64) -> Self::Output;
}
pub trait RotateRightAssign {
fn rotate_right_assign(&mut self, n: u64);
}
pub trait RoundToMultiple<RHS = Self> {
type Output;
fn round_to_multiple(self, other: RHS, rm: RoundingMode) -> (Self::Output, Ordering);
}
pub trait RoundToMultipleAssign<RHS = Self> {
fn round_to_multiple_assign(&mut self, other: RHS, rm: RoundingMode) -> Ordering;
}
pub trait RoundToMultipleOfPowerOf2<RHS> {
type Output;
fn round_to_multiple_of_power_of_2(
self,
pow: RHS,
rm: RoundingMode,
) -> (Self::Output, Ordering);
}
pub trait RoundToMultipleOfPowerOf2Assign<RHS> {
fn round_to_multiple_of_power_of_2_assign(&mut self, pow: RHS, rm: RoundingMode) -> Ordering;
}
pub trait SaturatingAbs {
type Output;
fn saturating_abs(self) -> Self::Output;
}
pub trait SaturatingAbsAssign {
fn saturating_abs_assign(&mut self);
}
pub trait SaturatingAdd<RHS = Self> {
type Output;
fn saturating_add(self, other: RHS) -> Self::Output;
}
pub trait SaturatingAddAssign<RHS = Self> {
fn saturating_add_assign(&mut self, other: RHS);
}
pub trait SaturatingAddMul<Y = Self, Z = Self> {
type Output;
fn saturating_add_mul(self, y: Y, z: Z) -> Self::Output;
}
pub trait SaturatingAddMulAssign<Y = Self, Z = Self> {
fn saturating_add_mul_assign(&mut self, y: Y, z: Z);
}
pub trait SaturatingMul<RHS = Self> {
type Output;
fn saturating_mul(self, other: RHS) -> Self::Output;
}
pub trait SaturatingMulAssign<RHS = Self> {
fn saturating_mul_assign(&mut self, other: RHS);
}
pub trait SaturatingNeg {
type Output;
fn saturating_neg(self) -> Self::Output;
}
pub trait SaturatingNegAssign {
fn saturating_neg_assign(&mut self);
}
pub trait SaturatingPow<RHS> {
type Output;
fn saturating_pow(self, exp: RHS) -> Self::Output;
}
pub trait SaturatingPowAssign<RHS = Self> {
fn saturating_pow_assign(&mut self, exp: RHS);
}
pub trait SaturatingSquare {
type Output;
fn saturating_square(self) -> Self::Output;
}
pub trait SaturatingSquareAssign {
fn saturating_square_assign(&mut self);
}
pub trait SaturatingSub<RHS = Self> {
type Output;
fn saturating_sub(self, other: RHS) -> Self::Output;
}
pub trait SaturatingSubAssign<RHS = Self> {
fn saturating_sub_assign(&mut self, other: RHS);
}
pub trait SaturatingSubMul<Y = Self, Z = Self> {
type Output;
fn saturating_sub_mul(self, y: Y, z: Z) -> Self::Output;
}
pub trait SaturatingSubMulAssign<Y = Self, Z = Self> {
fn saturating_sub_mul_assign(&mut self, y: Y, z: Z);
}
pub trait ShlRound<RHS> {
type Output;
fn shl_round(self, other: RHS, rm: RoundingMode) -> (Self::Output, Ordering);
}
pub trait ShlRoundAssign<RHS> {
fn shl_round_assign(&mut self, other: RHS, rm: RoundingMode) -> Ordering;
}
pub trait ShrRound<RHS> {
type Output;
fn shr_round(self, other: RHS, rm: RoundingMode) -> (Self::Output, Ordering);
}
pub trait ShrRoundAssign<RHS> {
fn shr_round_assign(&mut self, other: RHS, rm: RoundingMode) -> Ordering;
}
pub trait Sign {
fn sign(&self) -> Ordering;
}
pub trait Sqrt {
type Output;
fn sqrt(self) -> Self::Output;
}
pub trait SqrtAssign {
fn sqrt_assign(&mut self);
}
pub trait FloorSqrt {
type Output;
fn floor_sqrt(self) -> Self::Output;
}
pub trait FloorSqrtAssign {
fn floor_sqrt_assign(&mut self);
}
pub trait CeilingSqrt {
type Output;
fn ceiling_sqrt(self) -> Self::Output;
}
pub trait CeilingSqrtAssign {
fn ceiling_sqrt_assign(&mut self);
}
pub trait CheckedSqrt {
type Output;
fn checked_sqrt(self) -> Option<Self::Output>;
}
pub trait SqrtRem {
type SqrtOutput;
type RemOutput;
fn sqrt_rem(self) -> (Self::SqrtOutput, Self::RemOutput);
}
pub trait SqrtAssignRem {
type RemOutput;
fn sqrt_assign_rem(&mut self) -> Self::RemOutput;
}
pub trait Square {
type Output;
fn square(self) -> Self::Output;
}
pub trait SquareAssign {
fn square_assign(&mut self);
}
pub trait SubMul<Y = Self, Z = Self> {
type Output;
fn sub_mul(self, y: Y, z: Z) -> Self::Output;
}
pub trait SubMulAssign<Y = Self, Z = Self> {
fn sub_mul_assign(&mut self, y: Y, z: Z);
}
pub trait WrappingAbs {
type Output;
fn wrapping_abs(self) -> Self::Output;
}
pub trait WrappingAbsAssign {
fn wrapping_abs_assign(&mut self);
}
pub trait WrappingAdd<RHS = Self> {
type Output;
fn wrapping_add(self, other: RHS) -> Self::Output;
}
pub trait WrappingAddAssign<RHS = Self> {
fn wrapping_add_assign(&mut self, other: RHS);
}
pub trait WrappingAddMul<Y = Self, Z = Self> {
type Output;
fn wrapping_add_mul(self, y: Y, z: Z) -> Self::Output;
}
pub trait WrappingAddMulAssign<Y = Self, Z = Self> {
fn wrapping_add_mul_assign(&mut self, y: Y, z: Z);
}
pub trait WrappingDiv<RHS = Self> {
type Output;
fn wrapping_div(self, other: RHS) -> Self::Output;
}
pub trait WrappingDivAssign<RHS = Self> {
fn wrapping_div_assign(&mut self, other: RHS);
}
pub trait WrappingMul<RHS = Self> {
type Output;
fn wrapping_mul(self, other: RHS) -> Self::Output;
}
pub trait WrappingMulAssign<RHS = Self> {
fn wrapping_mul_assign(&mut self, other: RHS);
}
pub trait WrappingNeg {
type Output;
fn wrapping_neg(self) -> Self::Output;
}
pub trait WrappingNegAssign {
fn wrapping_neg_assign(&mut self);
}
pub trait WrappingPow<RHS> {
type Output;
fn wrapping_pow(self, exp: RHS) -> Self::Output;
}
pub trait WrappingPowAssign<RHS = Self> {
fn wrapping_pow_assign(&mut self, exp: RHS);
}
pub trait WrappingSquare {
type Output;
fn wrapping_square(self) -> Self::Output;
}
pub trait WrappingSquareAssign {
fn wrapping_square_assign(&mut self);
}
pub trait WrappingSub<RHS = Self> {
type Output;
fn wrapping_sub(self, other: RHS) -> Self::Output;
}
pub trait WrappingSubAssign<RHS = Self> {
fn wrapping_sub_assign(&mut self, other: RHS);
}
pub trait WrappingSubMul<Y = Self, Z = Self> {
type Output;
fn wrapping_sub_mul(self, y: Y, z: Z) -> Self::Output;
}
pub trait WrappingSubMulAssign<Y = Self, Z = Self> {
fn wrapping_sub_mul_assign(&mut self, y: Y, z: Z);
}
pub trait XMulYToZZ: Sized {
fn x_mul_y_to_zz(x: Self, y: Self) -> (Self, Self);
}
pub trait XXAddYYToZZ: Sized {
fn xx_add_yy_to_zz(x_1: Self, x_0: Self, y_1: Self, y_0: Self) -> (Self, Self);
}
pub trait XXDivModYToQR: Sized {
fn xx_div_mod_y_to_qr(x_1: Self, x_0: Self, y: Self) -> (Self, Self);
}
pub trait XXSubYYToZZ: Sized {
fn xx_sub_yy_to_zz(x_1: Self, x_0: Self, y_1: Self, y_0: Self) -> (Self, Self);
}
pub trait XXXAddYYYToZZZ: Sized {
fn xxx_add_yyy_to_zzz(
x_2: Self,
x_1: Self,
x_0: Self,
y_2: Self,
y_1: Self,
y_0: Self,
) -> (Self, Self, Self);
}
pub trait XXXSubYYYToZZZ: Sized {
fn xxx_sub_yyy_to_zzz(
x_2: Self,
x_1: Self,
x_0: Self,
y_2: Self,
y_1: Self,
y_0: Self,
) -> (Self, Self, Self);
}
pub trait XXXXAddYYYYToZZZZ: Sized {
#[allow(clippy::too_many_arguments)]
fn xxxx_add_yyyy_to_zzzz(
x_3: Self,
x_2: Self,
x_1: Self,
x_0: Self,
y_3: Self,
y_2: Self,
y_1: Self,
y_0: Self,
) -> (Self, Self, Self, Self);
}