pub trait SqrtAssignRem {
    type RemOutput;

    fn sqrt_assign_rem(&mut self) -> Self::RemOutput;
}
Expand description

Replaces a number with the floor of its square root, returning the remainder.

Required Associated Types

Required Methods

Implementations on Foreign Types

Replaces an integer with the floor of its square root, and returns the remainder (the difference between the original integer and the square of the floor).

$f(x) = x - \lfloor\sqrt{x}\rfloor^2$,

$x \gets \lfloor\sqrt{x}\rfloor$.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Replaces an integer with the floor of its square root, and returns the remainder (the difference between the original integer and the square of the floor).

$f(x) = x - \lfloor\sqrt{x}\rfloor^2$,

$x \gets \lfloor\sqrt{x}\rfloor$.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Replaces an integer with the floor of its square root, and returns the remainder (the difference between the original integer and the square of the floor).

$f(x) = x - \lfloor\sqrt{x}\rfloor^2$,

$x \gets \lfloor\sqrt{x}\rfloor$.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Replaces an integer with the floor of its square root, and returns the remainder (the difference between the original integer and the square of the floor).

$f(x) = x - \lfloor\sqrt{x}\rfloor^2$,

$x \gets \lfloor\sqrt{x}\rfloor$.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Replaces an integer with the floor of its square root, and returns the remainder (the difference between the original integer and the square of the floor).

$f(x) = x - \lfloor\sqrt{x}\rfloor^2$,

$x \gets \lfloor\sqrt{x}\rfloor$.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Replaces an integer with the floor of its square root, and returns the remainder (the difference between the original integer and the square of the floor).

$f(x) = x - \lfloor\sqrt{x}\rfloor^2$,

$x \gets \lfloor\sqrt{x}\rfloor$.

Worst-case complexity

Constant time and additional memory.

Examples

See here.

Implementors