* 64 bits integer - ERRATA
@ 2004-11-10 3:31 Luciano Moreira - igLnx
2004-11-10 13:57 ` glynn
0 siblings, 1 reply; 2+ messages in thread
From: Luciano Moreira - igLnx @ 2004-11-10 3:31 UTC (permalink / raw)
To: linux-c-programming
Excuse me, when I say "64 bits", I m assuming that the OS are running
under a processor with 32 bits only, where "long" type ll have only 32
bits and "double" could has 64 bits, but it isn't a integer, in other
hands, I couldn't convert a double to a text string assuming that it is
integer with a function like printf().
Then, retrying the question:
Does exist a way or some system call or another thing in Linux that
allow us to manipulate integer values larger than a system DWORD (long) ?
Samples:
- int64, atoi64(), i64toa(), ...
- int128, atoi128(), i128toa(), ...
Luciano
-------- Mensagem Original --------
Assunto: 64 bits integer
Data: Tue, 09 Nov 2004 22:30:57 -0300
De: Luciano Moreira - igLnx <lucianolnx@ig.com.br>
Para: linux-c-programming <linux-c-programming@vger.kernel.org>
How can we do to manipulate integer higher than 32 bits in linux ?
Does exist some system call (or another library), that allow us to do
something like as following ?
int64 x;
x = atoi64("12345678901234567890");
char x[21];
i64toa(x, sizeof(x));
Thanks,
Luciano
-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: 64 bits integer - ERRATA
2004-11-10 3:31 64 bits integer - ERRATA Luciano Moreira - igLnx
@ 2004-11-10 13:57 ` glynn
0 siblings, 0 replies; 2+ messages in thread
From: glynn @ 2004-11-10 13:57 UTC (permalink / raw)
To: Luciano Moreira - igLnx; +Cc: linux-c-programming
Luciano Moreira - igLnx wrote:
> Excuse me, when I say "64 bits", I m assuming that the OS are running
> under a processor with 32 bits only, where "long" type ll have only 32
> bits and "double" could has 64 bits, but it isn't a integer, in other
> hands, I couldn't convert a double to a text string assuming that it is
> integer with a function like printf().
As Mikael said, the "long long" type has 64 bits, even on a 32-bit
architecture such as x86.
> Then, retrying the question:
> Does exist a way or some system call or another thing in Linux that
> allow us to manipulate integer values larger than a system DWORD (long) ?
> Samples:
> - int64, atoi64(), i64toa(), ...
> - int128, atoi128(), i128toa(), ...
strtoull will parse a 64-bit integer, while printf("%lld", ...) will
convert one to a string.
If you want to use integers larger than 64 bits, look into libmp
and/or libgmp.
--
Glynn Clements <glynn@gclements.plus.com>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-11-10 13:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-10 3:31 64 bits integer - ERRATA Luciano Moreira - igLnx
2004-11-10 13:57 ` glynn
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.