Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1995
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1995

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Arbitrary Length Ints

  • To: mathgroup at christensen.cybernetics.net
  • Subject: [mg1738] Re: [mg1714] Arbitrary Length Ints
  • From: John Fultz <jfultz>
  • Date: Mon, 24 Jul 1995 00:42:52 -0400

> Hi folks,
> 
> I would like to use 64 bit integers in a Mathematica program -- does
> anyone know how to get longer int lengths??
> 
> Thanks!
> 
> Tom O'Brien
> UC Berkeley
> tomo at uclink.berkeley.edu

I'm not quite sure of the limitation you're referring to.  If you're
actually referring to a Mathematica program, it easily surpasses 64
bit integers:

In[8]:= 2^512

Out[8]= 13407807929942597099574024998205846127479365820592393\
 
  377723561443721764030073546976801874298166903427690\
 
  031858186486050853753882811946569946433649006084096

I could have, in fact, chosen a much larger integer, but you get the
idea.

If, on the other hand, you are referring to a *MathLink* program
(the only place I can think of off the top of my head where such a
limitation exists), then I believe you'd have to split the number
up into 32-bit chunks and send them that way, since MathLink, can't
handle anything larger than a long int.  Or, I suppose, you could also
send it as a string; either way, some conversion will be necessary.

Of course, then you have to create a representation in C and begin
overloading operators so C actually knows how to use these critters,
but that's an entirely separate discussion...

John Fultz
Wolfram Research, Inc.


  • Prev by Date: [Help] Plot complex function.
  • Next by Date: Re: Re: How to apply EdgeForm to ParametricPlot3D?
  • Previous by thread: Arbitrary Length Ints
  • Next by thread: Base 10 to Base 2 conversion error ?