Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create Uint128 out of 2 Uint64 #10

Open
johanmazel opened this issue May 28, 2015 · 2 comments
Open

Create Uint128 out of 2 Uint64 #10

johanmazel opened this issue May 28, 2015 · 2 comments

Comments

@johanmazel
Copy link

Could you add this feature ?
If you cannot, I can probably code this and try a pull request.

@andrenth
Copy link
Owner

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
#10.

@johanmazel
Copy link
Author

Yes, that would be perfect.
Could you also add a uint64_of_two_uint32 function ?
And maybe a uint128_of_four_uint32 function ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants