devela::num

Trait Num

Source
pub trait Num {
    type Inner;
    type Out;
    type Rhs;

Show 30 methods // Required method fn num_into(self) -> Self::Inner; // Provided methods fn num_from(value: Self::Inner) -> Result<Self> where Self: Sized { ... } fn num_from_ref(value: &Self::Inner) -> Result<Self> where Self: Sized { ... } fn num_set(&mut self, value: Self::Inner) -> Result<()> { ... } fn num_set_ref(&mut self, value: &Self::Inner) -> Result<()> { ... } fn num_is_zero(&self) -> Result<bool> { ... } fn num_get_zero() -> Result<Self> where Self: Sized { ... } fn num_set_zero(&mut self) -> Result<()> { ... } fn num_is_one(&self) -> Result<bool> { ... } fn num_get_one() -> Result<Self> where Self: Sized { ... } fn num_set_one(&mut self) -> Result<()> { ... } fn num_add(self, rhs: Self::Rhs) -> Result<Self::Out> where Self: Sized { ... } fn num_ref_add(&self, rhs: &Self::Rhs) -> Result<Self::Out> { ... } fn num_ref_add_assign(&mut self, rhs: &Self::Rhs) -> Result<()> { ... } fn num_sub(self, rhs: Self::Rhs) -> Result<Self::Out> where Self: Sized { ... } fn num_ref_sub(&self, rhs: &Self::Rhs) -> Result<Self::Out> { ... } fn num_ref_sub_assign(&mut self, rhs: &Self::Rhs) -> Result<()> { ... } fn num_mul(self, rhs: Self::Rhs) -> Result<Self::Out> where Self: Sized { ... } fn num_ref_mul(&self, rhs: &Self::Rhs) -> Result<Self::Out> { ... } fn num_ref_mul_assign(&mut self, rhs: &Self::Rhs) -> Result<()> { ... } fn num_div(self, rhs: Self::Rhs) -> Result<Self::Out> where Self: Sized { ... } fn num_ref_div(&self, rhs: &Self::Rhs) -> Result<Self::Out> { ... } fn num_ref_div_assign(&mut self, rhs: &Self::Rhs) -> Result<()> { ... } fn num_rem(self, rhs: Self::Rhs) -> Result<Self::Out> where Self: Sized { ... } fn num_ref_rem(&self, rhs: &Self::Rhs) -> Result<Self::Out> { ... } fn num_ref_rem_assign(&mut self, rhs: &Self::Rhs) -> Result<()> { ... } fn num_neg(self) -> Result<Self::Out> where Self: Sized { ... } fn num_ref_neg(&self) -> Result<Self::Out> { ... } fn num_abs(self) -> Result<Self::Out> where Self: Sized { ... } fn num_ref_abs(&self) -> Result<Self::Out> { ... }
}
Expand description

Common trait for numeric types.

§Notes

  • Every method has a default implementation that returns NotImplemented.

  • Specific implementations can customize the operations it wants to support.

  • Any operations specifically not supported should ideally return NotSupported.

  • Most methods come in two variants, starting with different prefixes:

    • num_* methods take the arguments by value.
    • num_ref_* methods take the arguments by reference.
  • This trait tries to offer the same methods everywhere, giving a result when possible.

  • Operations are generally supported if they can be valid for some values. E.g. num_abs for unsigned types is only valid for 0.

See also NumRef which is automatically implemented for Num references.

Required Associated Types§

Source

type Inner

The internal representation of this numeric type.

Source

type Out

The output type for operations.

Source

type Rhs

The right hand side type for operations.

Required Methods§

Source

fn num_into(self) -> Self::Inner

Returns the inner self representation.

Provided Methods§

Source

fn num_from(value: Self::Inner) -> Result<Self>
where Self: Sized,

Returns Self if given a valid value.

Source

fn num_from_ref(value: &Self::Inner) -> Result<Self>
where Self: Sized,

Returns Self if given a valid &value.

Source

fn num_set(&mut self, value: Self::Inner) -> Result<()>

Sets self to the given valid value.

Source

fn num_set_ref(&mut self, value: &Self::Inner) -> Result<()>

Sets self to the given valid &value.

Source

fn num_is_zero(&self) -> Result<bool>

Returns true if self is zero.

Source

fn num_get_zero() -> Result<Self>
where Self: Sized,

Returns the number zero.

Source

fn num_set_zero(&mut self) -> Result<()>

Sets self to 0.

Source

fn num_is_one(&self) -> Result<bool>

Returns true if self is one.

Source

fn num_get_one() -> Result<Self>
where Self: Sized,

Returns the number one.

Source

fn num_set_one(&mut self) -> Result<()>

Sets the number to one.

Source

fn num_add(self, rhs: Self::Rhs) -> Result<Self::Out>
where Self: Sized,

Computes self + rhs (addition).

Source

fn num_ref_add(&self, rhs: &Self::Rhs) -> Result<Self::Out>

Like num_add but takes the arguments by reference.

Source

fn num_ref_add_assign(&mut self, rhs: &Self::Rhs) -> Result<()>

Computes &mut self += rhs; (addition).

Source

fn num_sub(self, rhs: Self::Rhs) -> Result<Self::Out>
where Self: Sized,

Computes self - rhs (subtraction).

Source

fn num_ref_sub(&self, rhs: &Self::Rhs) -> Result<Self::Out>

Like num_sub but takes the arguments by reference.

Source

fn num_ref_sub_assign(&mut self, rhs: &Self::Rhs) -> Result<()>

Computes &mut self -= rhs; (subtraction).

Source

fn num_mul(self, rhs: Self::Rhs) -> Result<Self::Out>
where Self: Sized,

Computes self * rhs (multiplication).

Source

fn num_ref_mul(&self, rhs: &Self::Rhs) -> Result<Self::Out>

Like num_mul but takes the arguments by reference.

Source

fn num_ref_mul_assign(&mut self, rhs: &Self::Rhs) -> Result<()>

Computes &mut self *= rhs; (multiplication).

Source

fn num_div(self, rhs: Self::Rhs) -> Result<Self::Out>
where Self: Sized,

Computes self / rhs (division).

Source

fn num_ref_div(&self, rhs: &Self::Rhs) -> Result<Self::Out>

Like num_div but takes the arguments by reference.

Source

fn num_ref_div_assign(&mut self, rhs: &Self::Rhs) -> Result<()>

Computes &mut self /= rhs; (division).

Source

fn num_rem(self, rhs: Self::Rhs) -> Result<Self::Out>
where Self: Sized,

Computes self % rhs (remainder).

Source

fn num_ref_rem(&self, rhs: &Self::Rhs) -> Result<Self::Out>

Like num_rem but takes the arguments by reference.

Source

fn num_ref_rem_assign(&mut self, rhs: &Self::Rhs) -> Result<()>

Computes &mut self %= rhs; (remainder).

Source

fn num_neg(self) -> Result<Self::Out>
where Self: Sized,

Computes -self (additive inverse).

Source

fn num_ref_neg(&self) -> Result<Self::Out>

Like num_neg but takes the arguments by reference.

Source

fn num_abs(self) -> Result<Self::Out>
where Self: Sized,

Computes |self| (absolute value).

Source

fn num_ref_abs(&self) -> Result<Self::Out>

Like num_abs but takes the arguments by reference.

Implementations on Foreign Types§

Source§

impl Num for f32

Available on crate feature _float_f32 only.
Source§

fn num_is_zero(&self) -> Result<bool>

This implementation has a tolerance of 5 × EPSILON

Source§

fn num_is_one(&self) -> Result<bool>

This implementation has a tolerance of 5 × EPSILON

Source§

type Inner = f32

Source§

type Out = f32

Source§

type Rhs = f32

Source§

fn num_into(self) -> Self::Inner

Source§

fn num_from(from: Self::Inner) -> Result<Self>

Source§

fn num_from_ref(from: &Self::Inner) -> Result<Self>

Source§

fn num_set(&mut self, value: Self::Inner) -> Result<()>

Source§

fn num_set_ref(&mut self, value: &Self::Inner) -> Result<()>

Source§

fn num_get_zero() -> Result<Self>

Source§

fn num_get_one() -> Result<Self>

Source§

fn num_set_zero(&mut self) -> Result<()>

Source§

fn num_set_one(&mut self) -> Result<()>

Source§

fn num_add(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_add(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_mul(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_mul(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_sub(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_sub(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_div(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_div(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_rem(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_rem(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_neg(self) -> Result<Self::Out>

Source§

fn num_ref_neg(&self) -> Result<Self::Out>

Source§

fn num_abs(self) -> Result<Self>

Source§

fn num_ref_abs(&self) -> Result<Self>

Source§

impl Num for f64

Available on crate feature _float_f64 only.
Source§

fn num_is_zero(&self) -> Result<bool>

This implementation has a tolerance of 5 × EPSILON

Source§

fn num_is_one(&self) -> Result<bool>

This implementation has a tolerance of 5 × EPSILON

Source§

type Inner = f64

Source§

type Out = f64

Source§

type Rhs = f64

Source§

fn num_into(self) -> Self::Inner

Source§

fn num_from(from: Self::Inner) -> Result<Self>

Source§

fn num_from_ref(from: &Self::Inner) -> Result<Self>

Source§

fn num_set(&mut self, value: Self::Inner) -> Result<()>

Source§

fn num_set_ref(&mut self, value: &Self::Inner) -> Result<()>

Source§

fn num_get_zero() -> Result<Self>

Source§

fn num_get_one() -> Result<Self>

Source§

fn num_set_zero(&mut self) -> Result<()>

Source§

fn num_set_one(&mut self) -> Result<()>

Source§

fn num_add(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_add(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_mul(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_mul(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_sub(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_sub(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_div(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_div(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_rem(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_rem(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_neg(self) -> Result<Self::Out>

Source§

fn num_ref_neg(&self) -> Result<Self::Out>

Source§

fn num_abs(self) -> Result<Self>

Source§

fn num_ref_abs(&self) -> Result<Self>

Source§

impl Num for i8

Available on crate feature _int_i8 only.
Source§

type Inner = i8

Source§

type Out = i8

Source§

type Rhs = i8

Source§

fn num_into(self) -> Self::Inner

Source§

fn num_from(from: Self::Inner) -> Result<Self>

Source§

fn num_from_ref(from: &Self::Inner) -> Result<Self>

Source§

fn num_set(&mut self, value: Self::Inner) -> Result<()>

Source§

fn num_set_ref(&mut self, value: &Self::Inner) -> Result<()>

Source§

fn num_is_zero(&self) -> Result<bool>

Source§

fn num_is_one(&self) -> Result<bool>

Source§

fn num_get_zero() -> Result<Self>

Source§

fn num_get_one() -> Result<Self>

Source§

fn num_set_zero(&mut self) -> Result<()>

Source§

fn num_set_one(&mut self) -> Result<()>

Source§

fn num_add(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_add(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_add_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_mul(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_mul(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_mul_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_sub(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_sub(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_sub_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_div(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_div(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_div_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_rem(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_rem(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_rem_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_neg(self) -> Result<Self::Out>

Source§

fn num_ref_neg(&self) -> Result<Self::Out>

Source§

fn num_abs(self) -> Result<Self::Out>

Source§

fn num_ref_abs(&self) -> Result<Self::Out>

Source§

impl Num for i16

Available on crate feature _int_i16 only.
Source§

type Inner = i16

Source§

type Out = i16

Source§

type Rhs = i16

Source§

fn num_into(self) -> Self::Inner

Source§

fn num_from(from: Self::Inner) -> Result<Self>

Source§

fn num_from_ref(from: &Self::Inner) -> Result<Self>

Source§

fn num_set(&mut self, value: Self::Inner) -> Result<()>

Source§

fn num_set_ref(&mut self, value: &Self::Inner) -> Result<()>

Source§

fn num_is_zero(&self) -> Result<bool>

Source§

fn num_is_one(&self) -> Result<bool>

Source§

fn num_get_zero() -> Result<Self>

Source§

fn num_get_one() -> Result<Self>

Source§

fn num_set_zero(&mut self) -> Result<()>

Source§

fn num_set_one(&mut self) -> Result<()>

Source§

fn num_add(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_add(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_add_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_mul(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_mul(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_mul_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_sub(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_sub(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_sub_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_div(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_div(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_div_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_rem(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_rem(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_rem_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_neg(self) -> Result<Self::Out>

Source§

fn num_ref_neg(&self) -> Result<Self::Out>

Source§

fn num_abs(self) -> Result<Self::Out>

Source§

fn num_ref_abs(&self) -> Result<Self::Out>

Source§

impl Num for i32

Available on crate feature _int_i32 only.
Source§

type Inner = i32

Source§

type Out = i32

Source§

type Rhs = i32

Source§

fn num_into(self) -> Self::Inner

Source§

fn num_from(from: Self::Inner) -> Result<Self>

Source§

fn num_from_ref(from: &Self::Inner) -> Result<Self>

Source§

fn num_set(&mut self, value: Self::Inner) -> Result<()>

Source§

fn num_set_ref(&mut self, value: &Self::Inner) -> Result<()>

Source§

fn num_is_zero(&self) -> Result<bool>

Source§

fn num_is_one(&self) -> Result<bool>

Source§

fn num_get_zero() -> Result<Self>

Source§

fn num_get_one() -> Result<Self>

Source§

fn num_set_zero(&mut self) -> Result<()>

Source§

fn num_set_one(&mut self) -> Result<()>

Source§

fn num_add(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_add(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_add_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_mul(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_mul(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_mul_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_sub(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_sub(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_sub_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_div(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_div(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_div_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_rem(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_rem(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_rem_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_neg(self) -> Result<Self::Out>

Source§

fn num_ref_neg(&self) -> Result<Self::Out>

Source§

fn num_abs(self) -> Result<Self::Out>

Source§

fn num_ref_abs(&self) -> Result<Self::Out>

Source§

impl Num for i64

Available on crate feature _int_i64 only.
Source§

type Inner = i64

Source§

type Out = i64

Source§

type Rhs = i64

Source§

fn num_into(self) -> Self::Inner

Source§

fn num_from(from: Self::Inner) -> Result<Self>

Source§

fn num_from_ref(from: &Self::Inner) -> Result<Self>

Source§

fn num_set(&mut self, value: Self::Inner) -> Result<()>

Source§

fn num_set_ref(&mut self, value: &Self::Inner) -> Result<()>

Source§

fn num_is_zero(&self) -> Result<bool>

Source§

fn num_is_one(&self) -> Result<bool>

Source§

fn num_get_zero() -> Result<Self>

Source§

fn num_get_one() -> Result<Self>

Source§

fn num_set_zero(&mut self) -> Result<()>

Source§

fn num_set_one(&mut self) -> Result<()>

Source§

fn num_add(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_add(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_add_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_mul(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_mul(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_mul_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_sub(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_sub(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_sub_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_div(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_div(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_div_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_rem(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_rem(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_rem_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_neg(self) -> Result<Self::Out>

Source§

fn num_ref_neg(&self) -> Result<Self::Out>

Source§

fn num_abs(self) -> Result<Self::Out>

Source§

fn num_ref_abs(&self) -> Result<Self::Out>

Source§

impl Num for i128

Available on crate feature _int_i128 only.
Source§

type Inner = i128

Source§

type Out = i128

Source§

type Rhs = i128

Source§

fn num_into(self) -> Self::Inner

Source§

fn num_from(from: Self::Inner) -> Result<Self>

Source§

fn num_from_ref(from: &Self::Inner) -> Result<Self>

Source§

fn num_set(&mut self, value: Self::Inner) -> Result<()>

Source§

fn num_set_ref(&mut self, value: &Self::Inner) -> Result<()>

Source§

fn num_is_zero(&self) -> Result<bool>

Source§

fn num_is_one(&self) -> Result<bool>

Source§

fn num_get_zero() -> Result<Self>

Source§

fn num_get_one() -> Result<Self>

Source§

fn num_set_zero(&mut self) -> Result<()>

Source§

fn num_set_one(&mut self) -> Result<()>

Source§

fn num_add(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_add(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_add_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_mul(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_mul(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_mul_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_sub(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_sub(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_sub_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_div(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_div(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_div_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_rem(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_rem(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_rem_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_neg(self) -> Result<Self::Out>

Source§

fn num_ref_neg(&self) -> Result<Self::Out>

Source§

fn num_abs(self) -> Result<Self::Out>

Source§

fn num_ref_abs(&self) -> Result<Self::Out>

Source§

impl Num for isize

Available on crate feature _int_isize only.
Source§

type Inner = isize

Source§

type Out = isize

Source§

type Rhs = isize

Source§

fn num_into(self) -> Self::Inner

Source§

fn num_from(from: Self::Inner) -> Result<Self>

Source§

fn num_from_ref(from: &Self::Inner) -> Result<Self>

Source§

fn num_set(&mut self, value: Self::Inner) -> Result<()>

Source§

fn num_set_ref(&mut self, value: &Self::Inner) -> Result<()>

Source§

fn num_is_zero(&self) -> Result<bool>

Source§

fn num_is_one(&self) -> Result<bool>

Source§

fn num_get_zero() -> Result<Self>

Source§

fn num_get_one() -> Result<Self>

Source§

fn num_set_zero(&mut self) -> Result<()>

Source§

fn num_set_one(&mut self) -> Result<()>

Source§

fn num_add(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_add(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_add_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_mul(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_mul(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_mul_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_sub(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_sub(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_sub_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_div(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_div(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_div_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_rem(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_rem(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_rem_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_neg(self) -> Result<Self::Out>

Source§

fn num_ref_neg(&self) -> Result<Self::Out>

Source§

fn num_abs(self) -> Result<Self::Out>

Source§

fn num_ref_abs(&self) -> Result<Self::Out>

Source§

impl Num for u8

Available on crate feature _int_u8 only.
Source§

type Inner = u8

Source§

type Out = u8

Source§

type Rhs = u8

Source§

fn num_into(self) -> Self::Inner

Source§

fn num_from(from: Self::Inner) -> Result<Self>

Source§

fn num_from_ref(from: &Self::Inner) -> Result<Self>

Source§

fn num_set(&mut self, value: Self::Inner) -> Result<()>

Source§

fn num_set_ref(&mut self, value: &Self::Inner) -> Result<()>

Source§

fn num_is_zero(&self) -> Result<bool>

Source§

fn num_is_one(&self) -> Result<bool>

Source§

fn num_get_zero() -> Result<Self>

Source§

fn num_get_one() -> Result<Self>

Source§

fn num_set_zero(&mut self) -> Result<()>

Source§

fn num_set_one(&mut self) -> Result<()>

Source§

fn num_add(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_add(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_add_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_mul(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_mul(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_mul_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_sub(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_sub(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_sub_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_div(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_div(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_div_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_rem(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_rem(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_rem_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_neg(self) -> Result<Self::Out>

Source§

fn num_ref_neg(&self) -> Result<Self::Out>

Source§

fn num_abs(self) -> Result<Self>

Source§

fn num_ref_abs(&self) -> Result<Self>

Source§

impl Num for u16

Available on crate feature _int_u16 only.
Source§

type Inner = u16

Source§

type Out = u16

Source§

type Rhs = u16

Source§

fn num_into(self) -> Self::Inner

Source§

fn num_from(from: Self::Inner) -> Result<Self>

Source§

fn num_from_ref(from: &Self::Inner) -> Result<Self>

Source§

fn num_set(&mut self, value: Self::Inner) -> Result<()>

Source§

fn num_set_ref(&mut self, value: &Self::Inner) -> Result<()>

Source§

fn num_is_zero(&self) -> Result<bool>

Source§

fn num_is_one(&self) -> Result<bool>

Source§

fn num_get_zero() -> Result<Self>

Source§

fn num_get_one() -> Result<Self>

Source§

fn num_set_zero(&mut self) -> Result<()>

Source§

fn num_set_one(&mut self) -> Result<()>

Source§

fn num_add(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_add(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_add_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_mul(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_mul(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_mul_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_sub(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_sub(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_sub_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_div(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_div(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_div_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_rem(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_rem(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_rem_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_neg(self) -> Result<Self::Out>

Source§

fn num_ref_neg(&self) -> Result<Self::Out>

Source§

fn num_abs(self) -> Result<Self>

Source§

fn num_ref_abs(&self) -> Result<Self>

Source§

impl Num for u32

Available on crate feature _int_u32 only.
Source§

type Inner = u32

Source§

type Out = u32

Source§

type Rhs = u32

Source§

fn num_into(self) -> Self::Inner

Source§

fn num_from(from: Self::Inner) -> Result<Self>

Source§

fn num_from_ref(from: &Self::Inner) -> Result<Self>

Source§

fn num_set(&mut self, value: Self::Inner) -> Result<()>

Source§

fn num_set_ref(&mut self, value: &Self::Inner) -> Result<()>

Source§

fn num_is_zero(&self) -> Result<bool>

Source§

fn num_is_one(&self) -> Result<bool>

Source§

fn num_get_zero() -> Result<Self>

Source§

fn num_get_one() -> Result<Self>

Source§

fn num_set_zero(&mut self) -> Result<()>

Source§

fn num_set_one(&mut self) -> Result<()>

Source§

fn num_add(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_add(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_add_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_mul(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_mul(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_mul_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_sub(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_sub(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_sub_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_div(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_div(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_div_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_rem(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_rem(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_rem_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_neg(self) -> Result<Self::Out>

Source§

fn num_ref_neg(&self) -> Result<Self::Out>

Source§

fn num_abs(self) -> Result<Self>

Source§

fn num_ref_abs(&self) -> Result<Self>

Source§

impl Num for u64

Available on crate feature _int_u64 only.
Source§

type Inner = u64

Source§

type Out = u64

Source§

type Rhs = u64

Source§

fn num_into(self) -> Self::Inner

Source§

fn num_from(from: Self::Inner) -> Result<Self>

Source§

fn num_from_ref(from: &Self::Inner) -> Result<Self>

Source§

fn num_set(&mut self, value: Self::Inner) -> Result<()>

Source§

fn num_set_ref(&mut self, value: &Self::Inner) -> Result<()>

Source§

fn num_is_zero(&self) -> Result<bool>

Source§

fn num_is_one(&self) -> Result<bool>

Source§

fn num_get_zero() -> Result<Self>

Source§

fn num_get_one() -> Result<Self>

Source§

fn num_set_zero(&mut self) -> Result<()>

Source§

fn num_set_one(&mut self) -> Result<()>

Source§

fn num_add(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_add(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_add_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_mul(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_mul(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_mul_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_sub(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_sub(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_sub_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_div(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_div(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_div_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_rem(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_rem(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_rem_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_neg(self) -> Result<Self::Out>

Source§

fn num_ref_neg(&self) -> Result<Self::Out>

Source§

fn num_abs(self) -> Result<Self>

Source§

fn num_ref_abs(&self) -> Result<Self>

Source§

impl Num for u128

Available on crate feature _int_u128 only.
Source§

type Inner = u128

Source§

type Out = u128

Source§

type Rhs = u128

Source§

fn num_into(self) -> Self::Inner

Source§

fn num_from(from: Self::Inner) -> Result<Self>

Source§

fn num_from_ref(from: &Self::Inner) -> Result<Self>

Source§

fn num_set(&mut self, value: Self::Inner) -> Result<()>

Source§

fn num_set_ref(&mut self, value: &Self::Inner) -> Result<()>

Source§

fn num_is_zero(&self) -> Result<bool>

Source§

fn num_is_one(&self) -> Result<bool>

Source§

fn num_get_zero() -> Result<Self>

Source§

fn num_get_one() -> Result<Self>

Source§

fn num_set_zero(&mut self) -> Result<()>

Source§

fn num_set_one(&mut self) -> Result<()>

Source§

fn num_add(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_add(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_add_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_mul(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_mul(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_mul_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_sub(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_sub(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_sub_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_div(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_div(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_div_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_rem(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_rem(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_rem_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_neg(self) -> Result<Self::Out>

Source§

fn num_ref_neg(&self) -> Result<Self::Out>

Source§

fn num_abs(self) -> Result<Self>

Source§

fn num_ref_abs(&self) -> Result<Self>

Source§

impl Num for usize

Available on crate feature _int_usize only.
Source§

type Inner = usize

Source§

type Out = usize

Source§

type Rhs = usize

Source§

fn num_into(self) -> Self::Inner

Source§

fn num_from(from: Self::Inner) -> Result<Self>

Source§

fn num_from_ref(from: &Self::Inner) -> Result<Self>

Source§

fn num_set(&mut self, value: Self::Inner) -> Result<()>

Source§

fn num_set_ref(&mut self, value: &Self::Inner) -> Result<()>

Source§

fn num_is_zero(&self) -> Result<bool>

Source§

fn num_is_one(&self) -> Result<bool>

Source§

fn num_get_zero() -> Result<Self>

Source§

fn num_get_one() -> Result<Self>

Source§

fn num_set_zero(&mut self) -> Result<()>

Source§

fn num_set_one(&mut self) -> Result<()>

Source§

fn num_add(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_add(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_add_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_mul(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_mul(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_mul_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_sub(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_sub(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_sub_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_div(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_div(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_div_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_rem(self, other: Self) -> Result<Self::Out>

Source§

fn num_ref_rem(&self, other: &Self) -> Result<Self::Out>

Source§

fn num_ref_rem_assign(&mut self, other: &Self) -> Result<()>

Source§

fn num_neg(self) -> Result<Self::Out>

Source§

fn num_ref_neg(&self) -> Result<Self::Out>

Source§

fn num_abs(self) -> Result<Self>

Source§

fn num_ref_abs(&self) -> Result<Self>

Implementors§

Source§

impl Num for NonZeroI8

Available on crate feature _int_i8 only.
Source§

impl Num for NonZeroI16

Available on crate feature _int_i16 only.
Source§

impl Num for NonZeroI32

Available on crate feature _int_i32 only.
Source§

impl Num for NonZeroI64

Available on crate feature _int_i64 only.
Source§

impl Num for NonZeroI128

Available on crate feature _int_i128 only.
Source§

impl Num for NonZeroIsize

Available on crate feature _int_isize only.
Source§

impl Num for NonZeroU8

Available on crate feature _int_u8 only.
Source§

impl Num for NonZeroU16

Available on crate feature _int_u16 only.
Source§

impl Num for NonZeroU32

Available on crate feature _int_u32 only.
Source§

impl Num for NonZeroU64

Available on crate feature _int_u64 only.
Source§

impl Num for NonZeroU128

Available on crate feature _int_u128 only.
Source§

impl Num for NonZeroUsize

Available on crate feature _int_usize only.
Source§

impl Num for NoNum

Source§

impl<T: Num> Num for VecVector<T>

Available on crate feature alg only.
Source§

impl<T: Num, const D: usize> Num for Vector<T, D>

Available on crate feature alg only.
Source§

type Inner = [T; D]

Source§

type Out = Vector<T, D>

Source§

type Rhs = Vector<T, D>