Questions tagged [int128]

Use this tag to refer to the 128-bit integers. For example, SIMD registers, a non-standard compiler extension on 64-bit platforms, or IPv6 addresses.

The 128-bit integers are a non-standard compiler extension on 64-bit platforms. The basic arithmetic and bitwise operations work on these data types in the same fashion as normal integers.

68 questions
0
votes
1 answer

C# BigInteger with Decimal outcome

I'm trying to do calculations with huge numbers. for example: 22352794900029489130063309832192 / 1000000000000000000000000000000 I want the outcome to be 22.35279490 (preferred decimal), but if I use BigInteger the result gets rounded to 22. Does…
MrAskAlot
  • 11
  • 5
0
votes
1 answer

c code: prevent overflow in modular operation with huge modules (modules near the overflow treshold)

In my c code I have to perform a series of recursive modular operations. In particular I have to perform operations like (A*B)modC, with C~2^126, and A,B that, in principle, could be very big numbers (from 0 to 2^128 - 1) ( I work with 128 bit …
user1172131
  • 103
  • 7
0
votes
1 answer

use of 128 bit unsigned int in c language

I need to use a 128 bit unsigned int variable in my code. Searching on line I read about unsigned __int128. Here https://gcc.gnu.org/onlinedocs/gcc/_005f_005fint128.html I read type __int128 is supported for targets which have an integer mode wide…
user1172131
  • 103
  • 7
0
votes
2 answers

How can I sort 128 bit unsigned integers in Python?

I have a huge number of 128-bit unsigned integers that need to be sorted for analysis (around a trillion of them!). The research I have done on 128-bit integers has led me down a bit of a blind alley, numpy doesn't seem to fully support them and the…
LocalGeek
  • 95
  • 1
  • 5
0
votes
1 answer

redis ZRANGEBYLEX and ipv6

To follow up on this post: redis store 128 bit number How to do a lexicographical search with an ipv6 address. If I use it like this: ZADD index 0 8000::/24 ZADD index 0 2001:db8:1f89::/48 ZADD index 0 2001:db9:1f89::/48 ZADD index 0…
Plivox
  • 21
  • 3
0
votes
0 answers

__int128 supported by emscripten? If not, how to implement 128 bit int multiplication?

I am trying to compile a C project to Javascript using Emscripten, and I have very basic code which uses the GCC extension supporting __int128 as seen below: unsigned __int128 r = (unsigned __int128)a * (unsigned __int128)b; *hi = r >> 64; return…
-1
votes
1 answer

int128 on Linux for Intel compiler

Linux 2.6.32 Intel compiler: icpc version 13.0.1 (gcc version 4.4.6 compatibility) #include #include int main() { std::cerr << sizeof (__uint128_t) << std::endl; return 0; } Output: 16 So, type __uint128_t…
Alex
  • 133
  • 1
  • 10
-2
votes
1 answer

How to use the C++ max function with boost 128 bit integer

If I have the following code: #include using namespace boost::multiprecision int main() { int128_t a = Func_a() int128_t b = Func_b() std::cout << std::max(a, b) << std::endl; return 0; } And if…
user6542719
1 2 3 4
5