Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to create a 128-bit integer literal

Tags:

People also ask

How do you write a 128-bit integer?

DrinkMoreBoilingWater's blog. As an extension the integer scalar type __int128 is supported for targets which have an integer mode wide enough to hold 128 bits. Simply write __int128 for a signed 128-bit integer, or unsigned __int128 for an unsigned 128-bit integer.

Is there a 128-bit integer?

Software. In the same way that compilers emulate e.g. 64-bit integer arithmetic on architectures with register sizes less than 64 bits, some compilers also support 128-bit integer arithmetic. For example, the GCC C compiler 4.6 and later has a 128-bit integer type __int128 for some architectures.

What is __ uint128_t?

Since the __uint128_t type is a GCC extension, the proper thing to do is probably to check for some known-good version of GCC. See this page for information about the macros used to version-check the GCC compiler. Follow this answer to receive notifications.


I have an integer literal in the format 0x75f17d6b3588f843b13dea7c9c324e51. Is there a way to avoid the compiler syntax error "integer literal is too large to be represented in any integer type"?

Because I know I can work with those kinds of types (I'm using uint128_t from the EOS library and if I manually insert it, it works).

Is there a way to somehow parse this string directly into the exact same integer at run time?