Re: 128 bit integer code needed



jacob navia <jacob@xxxxxxxxxx> writes:
Keith Thompson wrote:
jacob navia <jacob@xxxxxxxxxx> writes:
I am incorporating 128 Bit integer code into lcc-win and it would be
nice to have some code to test this feature.

Sounds interesting. Out of curiosity, just how are you defining your
128-bit integer types?

__int128

There is no unsigned as yet. Many other things must be done first:
o printing them with printf. Format "%I128d"
o scanning them with scanf. Same format

As long as you provide the proper macros in <inttypes.h> and typedefs
in <stdint.h>, users won't have to know what format strings you use
for printf and scanf. If I can refer to int128_t (or intleast128_t or
intfast128_t), I don't have to worry about whether the underlying type
is called __int128 or __longlonglong.

(To be clear, this is not a criticism of your choice of "__int128" or
"%I128d".)

[snip]

--
Keith Thompson (The_Other_Keith) <kst-u@xxxxxxx>
Nokia
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
.



Relevant Pages

  • Re: 128 bit integer code needed
    ... Format "%I128d" ... integer types"; are you using that? ... In 32 bits I use operator overloading and there is no printf support... ... jacob at jacob point remcomp point fr ...
    (comp.lang.c)
  • Re: portable printf of different size types
    ... code for systems that have different ranges on integer types etc? ... I wrote a wrapper around printf that adds a format character to ... never just use a const format string, i have to copy the format string ...
    (comp.lang.c)
  • Re: 128 bit integers
    ... jacob navia wrote: ... for conforming implementations. ... of providing more portable names to get at the format ... in with other integer types. ...
    (comp.std.c)
  • Re: portable printf of different size types
    ... What is the easiest way to use printf when you are writing portable ... code for systems that have different ranges on integer types etc? ... Chuck F (cbfalconer at maineline dot net) ...
    (comp.lang.c)
  • portable printf of different size types
    ... What is the easiest way to use printf when you are writing portable ... code for systems that have different ranges on integer types etc? ... never just use a const format string, i have to copy the format string ...
    (comp.lang.c)