linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan-Benedict Glaw <jbglaw@lug-owl.de>
To: linux-c-programming <linux-c-programming@vger.kernel.org>
Subject: Re: 64 bits integer
Date: Wed, 10 Nov 2004 15:46:50 +0100	[thread overview]
Message-ID: <20041110144649.GH10443@lug-owl.de> (raw)
In-Reply-To: <41916F51.2060102@ig.com.br>

[-- 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 --]

      parent reply	other threads:[~2004-11-10 14:46 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041110144649.GH10443@lug-owl.de \
    --to=jbglaw@lug-owl.de \
    --cc=linux-c-programming@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).