Basic module

multiply_64bits_with_overflow

procedureSource

Multiplies two 64-bit numbers without losing the top half: the 128-bit product comes back as high and low.

multiply_64bits_with_overflow :: (a: u64, b: u64) -> (high: u64, low: u64)

Parameters

a: u64
b: u64

Returns

high: u64
low: u64
Example↗
high, low := multiply_64bits_with_overflow(0xffffffffffffffff, 2);
assert(high == 1 && low == 0xfffffffffffffffe);

See also