pub trait XXXAddYYYToZZZ: Sized {
    fn xxx_add_yyy_to_zzz(
        x_2: Self,
        x_1: Self,
        x_0: Self,
        y_2: Self,
        y_1: Self,
        y_0: Self
    ) -> (Self, Self, Self); }
Expand description

Adds two numbers, each composed of three Self values, returning the sum as a triple of Self values.

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

Required Methods

Implementations on Foreign Types

Adds two numbers, each composed of three Self values, returning the sum as a triple of Self values.

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

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

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

Worst-case complexity

Constant time and additional memory.

Examples

See here.

This is equivalent to add_sssaaaaaa from longlong.h, FLINT 2.7.1, where (sh, sm, sl) is returned.

Adds two numbers, each composed of three Self values, returning the sum as a triple of Self values.

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

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

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

Worst-case complexity

Constant time and additional memory.

Examples

See here.

This is equivalent to add_sssaaaaaa from longlong.h, FLINT 2.7.1, where (sh, sm, sl) is returned.

Adds two numbers, each composed of three Self values, returning the sum as a triple of Self values.

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

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

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

Worst-case complexity

Constant time and additional memory.

Examples

See here.

This is equivalent to add_sssaaaaaa from longlong.h, FLINT 2.7.1, where (sh, sm, sl) is returned.

Adds two numbers, each composed of three Self values, returning the sum as a triple of Self values.

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

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

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

Worst-case complexity

Constant time and additional memory.

Examples

See here.

This is equivalent to add_sssaaaaaa from longlong.h, FLINT 2.7.1, where (sh, sm, sl) is returned.

Adds two numbers, each composed of three Self values, returning the sum as a triple of Self values.

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

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

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

Worst-case complexity

Constant time and additional memory.

Examples

See here.

This is equivalent to add_sssaaaaaa from longlong.h, FLINT 2.7.1, where (sh, sm, sl) is returned.

Adds two numbers, each composed of three usize values, returning the sum as a triple of usize values.

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

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

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

Worst-case complexity

Constant time and additional memory.

Examples

See here.

This is equivalent to add_sssaaaaaa from longlong.h, FLINT 2.7.1, where (sh, sm, sl) is returned.

Implementors