All of lore.kernel.org
 help / color / mirror / Atom feed
* 64 bits integer
@ 2004-11-10  1:30 Luciano Moreira - igLnx
  2004-11-10  7:07 ` mikael-aronsson
  2004-11-10 14:46 ` Jan-Benedict Glaw
  0 siblings, 2 replies; 3+ messages in thread
From: Luciano Moreira - igLnx @ 2004-11-10  1:30 UTC (permalink / raw)
  To: linux-c-programming

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: 64 bits integer
  2004-11-10  1:30 64 bits integer Luciano Moreira - igLnx
@ 2004-11-10  7:07 ` mikael-aronsson
  2004-11-10 14:46 ` Jan-Benedict Glaw
  1 sibling, 0 replies; 3+ messages in thread
From: mikael-aronsson @ 2004-11-10  7:07 UTC (permalink / raw)
  To: Luciano Moreira - igLnx, linux-c-programming

Hi !

You can use the type "long long" to define 64 bit data in gcc, use strtoll()
atoll() to parse a string, and all the *printf functions has support for 64
bit values also.

Mikael

----- Original Message ----- 
From: "Luciano Moreira - igLnx" <lucianolnx@ig.com.br>
To: "linux-c-programming" <linux-c-programming@vger.kernel.org>
Sent: Wednesday, November 10, 2004 2:30 AM
Subject: 64 bits integer


> 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] 3+ messages in thread

* Re: 64 bits integer
  2004-11-10  1:30 64 bits integer Luciano Moreira - igLnx
  2004-11-10  7:07 ` mikael-aronsson
@ 2004-11-10 14:46 ` Jan-Benedict Glaw
  1 sibling, 0 replies; 3+ messages in thread
From: Jan-Benedict Glaw @ 2004-11-10 14:46 UTC (permalink / raw)
  To: linux-c-programming

[-- Attachment #1: Type: text/plain, Size: 1354 bytes --]

On Tue, 2004-11-09 22:30:57 -0300, Luciano Moreira - igLnx <lucianolnx@ig.com.br>
wrote in message <41916F51.2060102@ig.com.br>:
> 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));

As pointed out, gcc uses a 64 bit wide integer as long long. If you
really require exactly a 64 bit integer, you'd declare it as uint64_t
(which is from stdint.h). Also, printf() etc will handle it just fine.

If you, however, require integers of at least 64 bit of size (with an
open end), you need to use any of the libraries that offers an
implementation of that. This is beyond the scope of C.  I've just
recently used libgcryp11 for something like that (actually, the large
integers are afterwards used to verify a POS printer's fiscal journal),
but there are other libs for it, too.

MfG, JBG

-- 
Jan-Benedict Glaw       jbglaw@lug-owl.de    . +49-172-7608481             _ O _
"Eine Freie Meinung in  einem Freien Kopf    | Gegen Zensur | Gegen Krieg  _ _ O
 fuer einen Freien Staat voll Freier Bürger" | im Internet! |   im Irak!   O O O
ret = do_actions((curr | FREE_SPEECH) & ~(NEW_COPYRIGHT_LAW | DRM | TCPA));

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-11-10 14:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-11-10  1:30 64 bits integer Luciano Moreira - igLnx
2004-11-10  7:07 ` mikael-aronsson
2004-11-10 14:46 ` Jan-Benedict Glaw

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.