pub trait RootAssignRem<POW> {
    type RemOutput;

    fn root_assign_rem(&mut self, exp: POW) -> Self::RemOutput;
}
Expand description

Replaces a number with the floor of its $n$th root, returning the remainder.

Required Associated Types

Required Methods

Implementations on Foreign Types

Replaces an integer with the floor of its $n$th root, and returns the remainder (the difference between the original integer and the $n$th power of the floor).

$f(x, n) = x - \lfloor\sqrt[n]{x}\rfloor^n$,

$x \gets \lfloor\sqrt[n]{x}\rfloor$.

Worst-case complexity

Constant time and additional memory.

Panics

Panics if exp is zero.

Examples

See here.

Replaces an integer with the floor of its $n$th root, and returns the remainder (the difference between the original integer and the $n$th power of the floor).

$f(x, n) = x - \lfloor\sqrt[n]{x}\rfloor^n$,

$x \gets \lfloor\sqrt[n]{x}\rfloor$.

Worst-case complexity

Constant time and additional memory.

Panics

Panics if exp is zero.

Examples

See here.

Replaces an integer with the floor of its $n$th root, and returns the remainder (the difference between the original integer and the $n$th power of the floor).

$f(x, n) = x - \lfloor\sqrt[n]{x}\rfloor^n$,

$x \gets \lfloor\sqrt[n]{x}\rfloor$.

Worst-case complexity

Constant time and additional memory.

Panics

Panics if exp is zero.

Examples

See here.

Replaces an integer with the floor of its $n$th root, and returns the remainder (the difference between the original integer and the $n$th power of the floor).

$f(x, n) = x - \lfloor\sqrt[n]{x}\rfloor^n$,

$x \gets \lfloor\sqrt[n]{x}\rfloor$.

Worst-case complexity

Constant time and additional memory.

Panics

Panics if exp is zero.

Examples

See here.

Replaces an integer with the floor of its $n$th root, and returns the remainder (the difference between the original integer and the $n$th power of the floor).

$f(x, n) = x - \lfloor\sqrt[n]{x}\rfloor^n$,

$x \gets \lfloor\sqrt[n]{x}\rfloor$.

Worst-case complexity

Constant time and additional memory.

Panics

Panics if exp is zero.

Examples

See here.

Replaces an integer with the floor of its $n$th root, and returns the remainder (the difference between the original integer and the $n$th power of the floor).

$f(x, n) = x - \lfloor\sqrt[n]{x}\rfloor^n$,

$x \gets \lfloor\sqrt[n]{x}\rfloor$.

Worst-case complexity

Constant time and additional memory.

Panics

Panics if exp is zero.

Examples

See here.

Implementors