Re: Big Integer Atoms
- Posted by "Igor Kachan" <kinz at peterlink.ru> Jul 12, 2004
- 579 views
Robert Craig wrote: ----- > From: Robert Craig <guest at RapidEuphoria.com> > To: EUforum at topica.com > Subject: Re: Big Integer Atoms > Sent: 12 jul 2004 y. 1:31 > > posted by: Robert Craig <rds at RapidEuphoria.com> > > Igor Kachan wrote: > > > > Hi, dear Euphorians, > > > > The EU manual says: > > > > "... Those declared with type integer must be atoms > > with integer values from -1073741824 to +1073741823 > > inclusive. > > You can perform exact calculations on larger integer > > values, up to about 15 decimal digits, but declare > > them as atom, rather than integer ..." > > > > This "up to about 15 decimal digits" seems to be not > > enough concrete thing for some cases. > > > > Couldn't someone tell me about more precise > > bounds of these "larger integer values"? > > (As I recall) with IEEE floating-point, you have 1 bit > for the +/- sign, 52 bits for the mantissa, and 11 bits > for the exponent. > > When storing integers in f.p. form, > at some point you are going to use up all 52 bits in > the mantissa, and you won't be able to store the integers > exactly anymore, or get exact results from your > calculations. > I guess you could look for the point where: > x + 1 = x > i.e. you don't have the resolution to distinguish between > one huge integer and the next. There's roughly 3 decimal > digits per 10 binary digits, so I guess that would be > around 52 * 3 / 10 = 15 decimal digits, roughly. Thanks, I'll try to get the experimental bounds by this method, useing printf(), floor() etc. Regards, Igor Kachan kinz at peterlink.ru