Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming > #4693

Re: large integer

From "Chris Uppal" <chris.uppal@metagnostic.REMOVE-THIS.org>
Newsgroups comp.programming
References <9e5d6662-d967-4ff0-9089-33004e916323@googlegroups.com> <53e97060$0$11021$703f8584@textnews.kpn.nl>
Subject Re: large integer
Date 2014-08-12 12:23 +0100
Message-ID <s_SdnTTNT9BoZXTOnZ2dnUVZ7ocAAAAA@bt.com> (permalink)

Show all headers | View raw


Sjouke Burry wrote:

> > What is the best way to store a large integer?
> >
> > Let's say it can be of theoretically unlimited size (assuming adequate
> > memory).
> In a large enough block of memory. Where else?

Linked list ?   /Very/ fast right and left shifts.

Also suitable if the underlying language implementation handles linked list 
better than large blocks of memory -- I think that some Lisp systems have used 
that representation (can't remember for sure, though).

Also /necessary/ if you want to handle numbers larger than will fit into main 
memory, and so the "digits" (or groups of 'em) are mapped out to file (there is 
at least one bignum package that does this).

    -- chris 

Back to comp.programming | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

large integer b <mike7411@gmail.com> - 2014-08-11 16:55 -0700
  Re: large integer Kaz Kylheku <kaz@kylheku.com> - 2014-08-12 00:47 +0000
    Re: large integer "Chris Uppal" <chris.uppal@metagnostic.REMOVE-THIS.org> - 2014-08-12 12:17 +0100
      Re: large integer Richard Heathfield <invalid@see.sig.invalid> - 2014-08-14 12:29 +0100
        Re: large integer "Chris Uppal" <chris.uppal@metagnostic.REMOVE-THIS.org> - 2014-08-15 09:31 +0100
  Re: large integer Sjouke Burry <burrynulnulfour@ppllaanneett.nnll> - 2014-08-12 03:39 +0200
    Re: large integer "Chris Uppal" <chris.uppal@metagnostic.REMOVE-THIS.org> - 2014-08-12 12:23 +0100
  Re: large integer Mark Storkamp <mstorkamp@yahoo.com> - 2014-08-12 09:36 -0500

csiph-web