Trait IsUnit Copy item path Source pub trait IsUnit {
// Required method
fn is_unit (&self) -> bool ;
}Expand description Determines whether a number is a unit of its ring, meaning that it has a multiplicative inverse
in the same ring.
Which elements these are depends on the ring: the only unit of $\mathbb{N}$ is 1, the units of
$\mathbb{Z}$ are $\pm 1$, the Gaussian integers have four, $\pm 1$ and $\pm i$, and in a field
every nonzero element is a unit.
The implementations for the primitive integers follow suit, and the ones for the primitive
floats count every finite nonzero value.
This trait is dyn compatible .
In older versions of Rust, dyn compatibility was called "object safety".
Determines whether a number is a unit: whether it is finite and nonzero, so that it
has a multiplicative inverse. NaN and the infinities are not units.
§ Worst-case complexity
Constant time and additional memory.
§ Examples
See here .
Determines whether a number is a unit: whether it is finite and nonzero, so that it
has a multiplicative inverse. NaN and the infinities are not units.
§ Worst-case complexity
Constant time and additional memory.
§ Examples
See here .
Determines whether a number is a unit: whether it is 1 or $-1$, the only integers
with a multiplicative inverse.
§ Worst-case complexity
Constant time and additional memory.
§ Examples
See here .
Determines whether a number is a unit: whether it is 1 or $-1$, the only integers
with a multiplicative inverse.
§ Worst-case complexity
Constant time and additional memory.
§ Examples
See here .
Determines whether a number is a unit: whether it is 1 or $-1$, the only integers
with a multiplicative inverse.
§ Worst-case complexity
Constant time and additional memory.
§ Examples
See here .
Determines whether a number is a unit: whether it is 1 or $-1$, the only integers
with a multiplicative inverse.
§ Worst-case complexity
Constant time and additional memory.
§ Examples
See here .
Determines whether a number is a unit: whether it is 1 or $-1$, the only integers
with a multiplicative inverse.
§ Worst-case complexity
Constant time and additional memory.
§ Examples
See here .
Determines whether a number is a unit: whether it is 1 or $-1$, the only integers
with a multiplicative inverse.
§ Worst-case complexity
Constant time and additional memory.
§ Examples
See here .
Determines whether a number is a unit: whether it is 1, the only unsigned integer
with a multiplicative inverse.
§ Worst-case complexity
Constant time and additional memory.
§ Examples
See here .
Determines whether a number is a unit: whether it is 1, the only unsigned integer
with a multiplicative inverse.
§ Worst-case complexity
Constant time and additional memory.
§ Examples
See here .
Determines whether a number is a unit: whether it is 1, the only unsigned integer
with a multiplicative inverse.
§ Worst-case complexity
Constant time and additional memory.
§ Examples
See here .
Determines whether a number is a unit: whether it is 1, the only unsigned integer
with a multiplicative inverse.
§ Worst-case complexity
Constant time and additional memory.
§ Examples
See here .
Determines whether a number is a unit: whether it is 1, the only unsigned integer
with a multiplicative inverse.
§ Worst-case complexity
Constant time and additional memory.
§ Examples
See here .
Determines whether a number is a unit: whether it is 1, the only unsigned integer
with a multiplicative inverse.
§ Worst-case complexity
Constant time and additional memory.
§ Examples
See here .