pub trait XXSubYYToZZ: Sized {
    fn xx_sub_yy_to_zz(x_1: Self, x_0: Self, y_1: Self, y_0: Self) -> (Self, Self);
}
Expand description

Subtracts two numbers, each composed of two Self values, returing the difference as a pair of Self values.

The more significant number always comes first. Subtraction is wrapping, and overflow is not indicated.

Required Methods

Implementations on Foreign Types

Subtracts two numbers, each composed of two Self values, returning the difference as a pair of Self values.

The more significant value always comes first. Subtraction is wrapping, and overflow is not indicated.

$$ f(x_1, x_0, y_1, y_0) = (z_1, z_0), $$ where $W$ is Self::WIDTH,

$x_1, x_0, y_1, y_0, z_1, z_0 < 2^W$, and $$ (2^Wx_1 + x_0) - (2^Wy_1 + y_0) \equiv 2^Wz_1 + z_0 \mod 2^{2W}. $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

This is equivalent to sub_ddmmss from longlong.h, GMP 6.2.1, where (sh, sl) is returned.

Subtracts two numbers, each composed of two Self values, returning the difference as a pair of Self values.

The more significant value always comes first. Subtraction is wrapping, and overflow is not indicated.

$$ f(x_1, x_0, y_1, y_0) = (z_1, z_0), $$ where $W$ is Self::WIDTH,

$x_1, x_0, y_1, y_0, z_1, z_0 < 2^W$, and $$ (2^Wx_1 + x_0) - (2^Wy_1 + y_0) \equiv 2^Wz_1 + z_0 \mod 2^{2W}. $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

This is equivalent to sub_ddmmss from longlong.h, GMP 6.2.1, where (sh, sl) is returned.

Subtracts two numbers, each composed of two Self values, returning the difference as a pair of Self values.

The more significant value always comes first. Subtraction is wrapping, and overflow is not indicated.

$$ f(x_1, x_0, y_1, y_0) = (z_1, z_0), $$ where $W$ is Self::WIDTH,

$x_1, x_0, y_1, y_0, z_1, z_0 < 2^W$, and $$ (2^Wx_1 + x_0) - (2^Wy_1 + y_0) \equiv 2^Wz_1 + z_0 \mod 2^{2W}. $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

This is equivalent to sub_ddmmss from longlong.h, GMP 6.2.1, where (sh, sl) is returned.

Subtracts two numbers, each composed of two Self values, returning the difference as a pair of Self values.

The more significant value always comes first. Subtraction is wrapping, and overflow is not indicated.

$$ f(x_1, x_0, y_1, y_0) = (z_1, z_0), $$ where $W$ is Self::WIDTH,

$x_1, x_0, y_1, y_0, z_1, z_0 < 2^W$, and $$ (2^Wx_1 + x_0) - (2^Wy_1 + y_0) \equiv 2^Wz_1 + z_0 \mod 2^{2W}. $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

This is equivalent to sub_ddmmss from longlong.h, GMP 6.2.1, where (sh, sl) is returned.

Subtracts two numbers, each composed of two usize values, returning the difference as a pair of usize values.

The more significant value always comes first. Subtraction is wrapping, and overflow is not indicated.

$$ f(x_1, x_0, y_1, y_0) = (z_1, z_0), $$ where $W$ is Self::WIDTH,

$x_1, x_0, y_1, y_0, z_1, z_0 < 2^W$, and $$ (2^Wx_1 + x_0) - (2^Wy_1 + y_0) \equiv 2^Wz_1 + z_0 \mod 2^{2W}. $$

Worst-case complexity

Constant time and additional memory.

Examples

See here.

This is equivalent to sub_ddmmss from longlong.h, GMP 6.2.1, where (sh, sl) is returned.

Subtracts two numbers, each composed of two u128 values, returning the difference as a pair of u128 values.

The more significant value always comes first. Subtraction is wrapping, and overflow is not indicated.

$$ f(x_1, x_0, y_1, y_0) = (z_1, z_0), $$ where $W$ is Self::WIDTH,

$x_1, x_0, y_1, y_0, z_1, z_0 < 2^W$, and $$ (2^Wx_1 + x_0) - (2^Wy_1 + y_0) \equiv 2^Wz_1 + z_0 \mod 2^{2W}. $$

Examples

See here.

Worst-case complexity

Constant time and additional memory.

This is equivalent to sub_ddmmss from longlong.h, GMP 6.2.1, where (sh, sl) is returned.

Implementors