Trait JoinHalves
Source pub trait JoinHalves: HasHalf {
// Required method
fn join_halves(upper: Self::Half, lower: Self::Half) -> Self;
}
Expand description
Provides a function to join two pieces into a number. For example, two u32
s may be joined to
form a u64
.
Joins two values into a single value; the upper, or most-significant, half comes first.
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
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.
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.
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.
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.