ocaml-uint
ocaml-uint copied to clipboard
Create Uint128 out of 2 Uint64
Could you add this feature ? If you cannot, I can probably code this and try a pull request.
Hi Johan
Would conversions from the other uint types to uint128 be enough? Then you could implement it with something like
let uint128_of_two_uint64 x y =
let (||) = Uint128.logor in
let (<<) = Uint128.shift_left in
let u128 = Uint128.of_uint64 in
(u128 x << 64) || u128 y
The Uint128.of_uint64
function doesn't exist, but it would be trivial to
add.
Cheers, Andre
On Thu, May 28, 2015 at 9:58 AM, johanmazel [email protected] wrote:
Could you add this feature ? If you cannot, I can probably code this and try a pull request.
— Reply to this email directly or view it on GitHub https://github.com/andrenth/ocaml-uint/issues/10.
Yes, that would be perfect. Could you also add a uint64_of_two_uint32 function ? And maybe a uint128_of_four_uint32 function ?