Re: File size limit
- Posted by Jason Gade <jaygade at ?a?oo.com> Jun 12, 2008
- 785 views
Fernando Bauer wrote: > > Jason Gade wrote: > > > [snipped] > > > > > I have asked for larger file numbers too, but i don't think we will get > > > them > > > in Eu v4. Even if we did, we could not do basic full precision integer > > > math > > > on the numbers over 4gigabytes (there are such libs in the archives tho). > > > > > > Kat > > > > Jim Brown is working on this right now. And atoms are unique integers up to > > (2^52) - 1 so I don't know why you can't do full precision integer math on > > them. > > The maximum contiguous integer in Eu is: > 2^53 = power(2,53) = 9,007,199,254,740,992 > > Demonstrations: > > 1) By decimal representation: > > 2^53-5= 9007199254740987 -- ok > 2^53-4= 9007199254740988 -- ok > 2^53-3= 9007199254740989 -- ok > 2^53-2= 9007199254740990 -- ok > 2^53-1= 9007199254740991 -- ok > 2^53+0= 9007199254740992 -- ok > 2^53+1= 9007199254740992 -- Problem: it's equal to 2^53 > 2^53+2= 9007199254740994 > 2^53+3= 9007199254740996 > 2^53+4= 9007199254740996 > 2^53+5= 9007199254740996 > > 2) IEEE754 double-precision (64 bits) bit values: > Value =|s|--exponent-|--------------------fraction------------------------| > 2^53-5= 0 10000110011 1111111111111111111111111111111111111111111111111011 > 2^53-4= 0 10000110011 1111111111111111111111111111111111111111111111111100 > 2^53-3= 0 10000110011 1111111111111111111111111111111111111111111111111101 > 2^53-2= 0 10000110011 1111111111111111111111111111111111111111111111111110 > 2^53-1= 0 10000110011 1111111111111111111111111111111111111111111111111111 > 2^53+0= 0 10000110100 0000000000000000000000000000000000000000000000000000 > 2^53+1= 0 10000110100 0000000000000000000000000000000000000000000000000000 > 2^53+2= 0 10000110100 0000000000000000000000000000000000000000000000000001 > 2^53+3= 0 10000110100 0000000000000000000000000000000000000000000000000010 > 2^53+4= 0 10000110100 0000000000000000000000000000000000000000000000000010 > 2^53+5= 0 10000110100 0000000000000000000000000000000000000000000000000010 > > 3)IEEE754 double-precision normalized numbers: > v = (-1)^s * 2^e * (1 + fraction * 2^-52) > = (-1)^s * (2^e + fraction * 2^(e-52)) > > Note that there is NO problem when v=2^52 (e=52): > v = (-1)^s * (2^52 + fraction) where 0<=fraction<=2^52-1 > > Note that there are problems when 2^53<v<2^54 (e=53): > v = (-1)^s * (2^53 + fraction * 2) where 0<=fraction<=2^52-1 > since fraction is an integer number, it's impossible to represent 2^53+1 > exactly. > > 2^53-5= +2^52 * (1 + 4503599627370491 * 2^-52) > 2^53-4= +2^52 * (1 + 4503599627370492 * 2^-52) > 2^53-3= +2^52 * (1 + 4503599627370493 * 2^-52) > 2^53-2= +2^52 * (1 + 4503599627370494 * 2^-52) > 2^53-1= +2^52 * (1 + 4503599627370495 * 2^-52) > 2^53+0= +2^53 * (1 + 0 * 2^-52) > 2^53+1= +2^53 * (1 + 0 * 2^-52) > 2^53+2= +2^53 * (1 + 1 * 2^-52) > 2^53+3= +2^53 * (1 + 2 * 2^-52) > 2^53+4= +2^53 * (1 + 2 * 2^-52) > 2^53+5= +2^53 * (1 + 2 * 2^-52) > > 4)By measuring integer distances: > Look at this: > <a > href="http://www.openeuphoria.org/cgi-bin/esearch.exu?fromMonth=1&fromYear=D&toMonth=6&toYear=D&postedBy=Fernando&keywords=NextInteger">http://www.openeuphoria.org/cgi-bin/esearch.exu?fromMonth=1&fromYear=D&toMonth=6&toYear=D&postedBy=Fernando&keywords=NextInteger</a> Hey, thanks Fernando and Lucius. Especially for spelling it out in so much detail, Fernando. Oh, and I do remember that previous post but I was kind of skeptical until you proved it just now. Very nice. I'll update limits.e -- A complex system that works is invariably found to have evolved from a simple system that works. --John Gall's 15th law of Systemantics. "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j.