Skip to content
New issue

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

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

Already on GitHub? # to your account

Implement int128 type #112

Open
chfast opened this issue Oct 2, 2019 · 3 comments
Open

Implement int128 type #112

chfast opened this issue Oct 2, 2019 · 3 comments

Comments

@chfast
Copy link
Owner

chfast commented Oct 2, 2019

Implement the signed variant of 128-bit integer as an adapter/wrapper of uint128 from int128.hpp.

@chfast chfast added hacktoberfest Selected for Hacktoberfest help wanted labels Oct 2, 2019
@anuchak
Copy link

anuchak commented Oct 3, 2019

Hi @chfast, I would like to work on this.
Is there any specific point I must begin from, apart from the int128.hpp file ?
Also, I found these two sample code implementations,
1> https://stackoverflow.com/a/741371
2> http://codef00.com/code/uint128.h [this uses the boost library]
and both of them implement the library using a similar implementation style to yours.
So, I was hoping if you could shed some light on how the libary is implemented, especially the
lo & hi thing.
Thanks !

@chfast
Copy link
Owner Author

chfast commented Oct 4, 2019

Hi @anuchak,

Please note that the uint128 type is already implemented. We want to use this type to implement int128 because many operations are binary equivalent: add, mul, sub, or, xor, and, etc.

You can start by defining it like

struct int128 : private uint128 {}

And then add a constructor from int64_t.

@chfast chfast removed the hacktoberfest Selected for Hacktoberfest label Nov 21, 2019
@Eragon-Brisingr
Copy link

Has any progress? int128 type is useful.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

4 participants
@chfast @Eragon-Brisingr @anuchak and others