intx
intx copied to clipboard
Implement int128 type
Implement the signed variant of 128-bit integer as an adapter/wrapper of uint128
from int128.hpp
.
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 !
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
.
Has any progress? int128 type is useful.