pub trait XXDivModYToQR: Sized {
    fn xx_div_mod_y_to_qr(x_1: Self, x_0: Self, y: Self) -> (Self, Self);
}
Expand description

Computes the quotient and remainder of two numbers. The first is composed of two Self values, and the second of a single one.

x_1 must be less than y.

Required Methods

Implementations on Foreign Types

Computes the quotient and remainder of two numbers. The first is composed of two Self values, and the second of a single one.

x_1 must be less than y.

$$ f(x_1, x_0, y) = (q, r), $$ where $W$ is Self::WIDTH,

$x_1, x_0, y, q, r < 2^W$,

$x_1, r < y$, and $$ qy + r = 2^Wx_1 + x_0. $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

This is equivalent to udiv_qrnnd from longlong.h, FLINT 2.7.1, where (q, r) is returned.

Computes the quotient and remainder of two numbers. The first is composed of two Self values, and the second of a single one.

x_1 must be less than y.

$$ f(x_1, x_0, y) = (q, r), $$ where $W$ is Self::WIDTH,

$x_1, x_0, y, q, r < 2^W$,

$x_1, r < y$, and $$ qy + r = 2^Wx_1 + x_0. $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

This is equivalent to udiv_qrnnd from longlong.h, FLINT 2.7.1, where (q, r) is returned.

Computes the quotient and remainder of two numbers. The first is composed of two Self values, and the second of a single one.

x_1 must be less than y.

$$ f(x_1, x_0, y) = (q, r), $$ where $W$ is Self::WIDTH,

$x_1, x_0, y, q, r < 2^W$,

$x_1, r < y$, and $$ qy + r = 2^Wx_1 + x_0. $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

This is equivalent to udiv_qrnnd from longlong.h, FLINT 2.7.1, where (q, r) is returned.

Computes the quotient and remainder of two numbers. The first is composed of two Self values, and the second of a single one.

x_1 must be less than y.

$$ f(x_1, x_0, y) = (q, r), $$ where $W$ is Self::WIDTH,

$x_1, x_0, y, q, r < 2^W$,

$x_1, r < y$, and $$ qy + r = 2^Wx_1 + x_0. $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

This is equivalent to udiv_qrnnd from longlong.h, FLINT 2.7.1, where (q, r) is returned.

Computes the quotient and remainder of two numbers. The first is composed of two usize values, and the second of a single one.

x_1 must be less than y.

$$ f(x_1, x_0, y) = (q, r), $$ where $W$ is Self::WIDTH,

$x_1, x_0, y, q, r < 2^W$,

$x_1, r < y$, and $$ qy + r = 2^Wx_1 + x_0. $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

This is udiv_qrnnd from longlong.h, FLINT 2.7.1, where (q, r) is returned.

Computes the quotient and remainder of two numbers. The first is composed of two u128 values, and the second of a single one.

x_1 must be less than y.

$$ f(x_1, x_0, y) = (q, r), $$ where $W$ is Self::WIDTH,

$x_1, x_0, y, q, r < 2^W$,

$x_1, r < y$, and $$ qy + r = 2^Wx_1 + x_0. $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

This is equivalent to udiv_qrnnd from longlong.h, FLINT 2.7.1, where (q, r) is returned.

Implementors