Trait malachite_base::num::conversion::traits::JoinHalves
source · [−]pub trait JoinHalves: HasHalf {
fn join_halves(upper: Self::Half, lower: Self::Half) -> Self;
}
Expand description
Required Methods
fn join_halves(upper: Self::Half, lower: Self::Half) -> Self
fn join_halves(upper: Self::Half, lower: Self::Half) -> Self
Joins two values into a single value; the upper, or most-significant, half comes first.
Implementations on Foreign Types
sourceimpl JoinHalves for u16
impl JoinHalves for u16
sourcefn join_halves(upper: Self::Half, lower: Self::Half) -> Self
fn join_halves(upper: Self::Half, lower: Self::Half) -> Self
Joins two unsigned integers to form an unsigned integer with twice the width.
Let $W$ be the width of Self
(the output type).
$f(x, y) = 2^{W/2} x + y$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl JoinHalves for u32
impl JoinHalves for u32
sourcefn join_halves(upper: Self::Half, lower: Self::Half) -> Self
fn join_halves(upper: Self::Half, lower: Self::Half) -> Self
Joins two unsigned integers to form an unsigned integer with twice the width.
Let $W$ be the width of Self
(the output type).
$f(x, y) = 2^{W/2} x + y$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl JoinHalves for u64
impl JoinHalves for u64
sourcefn join_halves(upper: Self::Half, lower: Self::Half) -> Self
fn join_halves(upper: Self::Half, lower: Self::Half) -> Self
Joins two unsigned integers to form an unsigned integer with twice the width.
Let $W$ be the width of Self
(the output type).
$f(x, y) = 2^{W/2} x + y$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.
sourceimpl JoinHalves for u128
impl JoinHalves for u128
sourcefn join_halves(upper: Self::Half, lower: Self::Half) -> Self
fn join_halves(upper: Self::Half, lower: Self::Half) -> Self
Joins two unsigned integers to form an unsigned integer with twice the width.
Let $W$ be the width of Self
(the output type).
$f(x, y) = 2^{W/2} x + y$.
Worst-case complexity
Constant time and additional memory.
Examples
See here.