Re: 128 bit integer
- From: "BGB / cr88192" <cr88192@xxxxxxxxxxx>
- Date: Wed, 28 Jul 2010 18:52:59 -0700
"Keith Thompson" <kst-u@xxxxxxx> wrote in message
"BGB / cr88192" <cr88192@xxxxxxxxxxx> writes:
"Eric Sosman" <esosman@xxxxxxxxxxxxxxxxxxxx> wrote in message[...]
On 7/28/2010 7:34 AM, Lavanya Poondru wrote:
How to program 128 bit integer in C language ?
See Question 18.15d on the comp.lang.c Frequently Asked
Questions (FAQ) page at <http://www.c-faq.com/>.
also (will add this much):
some compilers add 128 bit (or more) integer types as an extension
but there is no real standardization here AFAIK.
Well, there's some.
An implementation that provides 128-bit integer types will probably
define int128_t, intleast128_t, and intfast128_t in <stdint.h>. All
these are optional, so even if long long is 128 bits an implementation
isn't *required* to define these typedefs (only the 8, 16, 32, and
64-bit "least" and "fast" typedefs are mandatory), but it would be silly
not to define them for 128 bits if the corresponding types exist.
forgot about stdint.h, I suspect partly because MSVC lacks this header...
And if any integer type is 128 bits or wider, intmax_t will be such a
Repeat the above replacing "int" with "uint" for unsigned types.
But most current implementations, as far as I know, only support
integers up to 64 bits.
yeah, this is true of both MSVC and GCC AFAIK (actually, IIRC GCC supports
128 bit ints for certain targets, but I am not sure).
both my compiler and Mr. Navia's compiler support 128 bit ints (mine uses
the type name "__int128" internally).
I think also Open64 and a few others as well support them.
not really sure though, I haven't really looked into it much...
- Prev by Date: Re: C Standard Regarding Null Pointer Dereferencing
- Next by Date: Re: C Standard Regarding Null Pointer Dereferencing
- Previous by thread: Re: 128 bit integer
- Next by thread: Re: 128 bit integer