Trait malachite_base::num::arithmetic::traits::XMulYToZZ
source · pub trait XMulYToZZ: Sized {
// Required method
fn x_mul_y_to_zz(x: Self, y: Self) -> (Self, Self);
}
Expand description
Multiplies two numbers, returning the product as a pair of Self
values.
The more significant number always comes first.
Required Methods§
fn x_mul_y_to_zz(x: Self, y: Self) -> (Self, Self)
Object Safety§
Implementations on Foreign Types§
source§impl XMulYToZZ for u8
impl XMulYToZZ for u8
source§fn x_mul_y_to_zz(x: u8, y: u8) -> (u8, u8)
fn x_mul_y_to_zz(x: u8, y: u8) -> (u8, u8)
Multiplies two numbers, returning the product as a pair of Self
values.
The more significant value always comes first.
$$
f(x, y) = (z_1, z_0),
$$
where $W$ is Self::WIDTH
,
$x, y, z_1, z_0 < 2^W$, and $$ xy = 2^Wz_1 + z_0. $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
This is equivalent to umul_ppmm
from longlong.h
, GMP 6.2.1, where (w1, w0)
is
returned.
source§impl XMulYToZZ for u16
impl XMulYToZZ for u16
source§fn x_mul_y_to_zz(x: u16, y: u16) -> (u16, u16)
fn x_mul_y_to_zz(x: u16, y: u16) -> (u16, u16)
Multiplies two numbers, returning the product as a pair of Self
values.
The more significant value always comes first.
$$
f(x, y) = (z_1, z_0),
$$
where $W$ is Self::WIDTH
,
$x, y, z_1, z_0 < 2^W$, and $$ xy = 2^Wz_1 + z_0. $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
This is equivalent to umul_ppmm
from longlong.h
, GMP 6.2.1, where (w1, w0)
is
returned.
source§impl XMulYToZZ for u32
impl XMulYToZZ for u32
source§fn x_mul_y_to_zz(x: u32, y: u32) -> (u32, u32)
fn x_mul_y_to_zz(x: u32, y: u32) -> (u32, u32)
Multiplies two numbers, returning the product as a pair of Self
values.
The more significant value always comes first.
$$
f(x, y) = (z_1, z_0),
$$
where $W$ is Self::WIDTH
,
$x, y, z_1, z_0 < 2^W$, and $$ xy = 2^Wz_1 + z_0. $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
This is equivalent to umul_ppmm
from longlong.h
, GMP 6.2.1, where (w1, w0)
is
returned.
source§impl XMulYToZZ for u64
impl XMulYToZZ for u64
source§fn x_mul_y_to_zz(x: u64, y: u64) -> (u64, u64)
fn x_mul_y_to_zz(x: u64, y: u64) -> (u64, u64)
Multiplies two numbers, returning the product as a pair of Self
values.
The more significant value always comes first.
$$
f(x, y) = (z_1, z_0),
$$
where $W$ is Self::WIDTH
,
$x, y, z_1, z_0 < 2^W$, and $$ xy = 2^Wz_1 + z_0. $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
This is equivalent to umul_ppmm
from longlong.h
, GMP 6.2.1, where (w1, w0)
is
returned.
source§impl XMulYToZZ for u128
impl XMulYToZZ for u128
source§fn x_mul_y_to_zz(x: u128, y: u128) -> (u128, u128)
fn x_mul_y_to_zz(x: u128, y: u128) -> (u128, u128)
Multiplies two numbers, returning the product as a pair of u128
values.
The more significant value always comes first.
$$
f(x, y) = (z_1, z_0),
$$
where $W$ is Self::WIDTH
,
$x, y, z_1, z_0 < 2^W$, and $$ xy = 2^Wz_1 + z_0. $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
This is equivalent to umul_ppmm
from longlong.h
, GMP 6.2.1, where (w1, w0)
is
returned.
source§impl XMulYToZZ for usize
impl XMulYToZZ for usize
source§fn x_mul_y_to_zz(x: usize, y: usize) -> (usize, usize)
fn x_mul_y_to_zz(x: usize, y: usize) -> (usize, usize)
Multiplies two numbers, returning the product as a pair of usize
values.
The more significant value always comes first.
$$
f(x, y) = (z_1, z_0),
$$
where $W$ is Self::WIDTH
,
$x, y, z_1, z_0 < 2^W$, and $$ xy = 2^Wz_1 + z_0. $$
§Worst-case complexity
Constant time and additional memory.
§Examples
See here.
This is equivalent to umul_ppmm
from longlong.h
, GMP 6.2.1, where (w1, w0)
is
returned.