Mail Archives: djgpp/1996/05/18/14:48:58
From: | elf AT netcom DOT com (Marc Singer)
|
Message-Id: | <199605181836.LAA03196@netcom9.netcom.com>
|
Subject: | Re: 64-bit integers
|
To: | hinks AT netspace DOT net DOT au (Adam Hinkley)
|
Date: | Sat, 18 May 1996 11:31:39 -0700 (PDT)
|
In-Reply-To: | <199605150652.QAA01734@tornado.netspace.net.au> from "Adam Hinkley" at May 15, 96 04:58:07 pm
|
MIME-Version: | 1.0
|
Sender: | elf AT netcom DOT com
|
>
> Hello
>
> Regarding the post...
>
> > How portable are GNU long long ints?
>
> Anyone know where I could get the source code for doing 64-bit integer
> arithmetic - the long longs? Or anyone have it and could mail it to me?
>
> I need to be able to do both signed and unsigned 64-bit integer
> arithmetic on a compiler that doesn't support it. The fix is to use two
> 32-bit integers (which I presume is what GNU does). My attempts at doing
> this have failed, but if I could find some source code for doing it...
>
I have tried to create portable 64 bit integer arithmetic, but I've
found that C does not provide appropriate operators for capturing the
overflow results for 32bitx32bit multiplies and divides. I've
considered building up very long integer support by using 1/2 word (16
bit) pieces, but this project was tabled when I found another
workaround. I'm not sure there is any way to do this efficiently in C
without inline assembly code.
Marc Singer
- Raw text -