--Written by Al Getz 07/2004 --Quick algorithm to find Euphoria's max whole number --representation as an atom. --Note this cant be stored as a Euphoria 'integer' type. include misc.e with trace atom a,b,x,c,k,EXIT,cnt a=900000000000000000 --known to be way too high -- 9007199254740992 --dec -- 0x00200000 00000000 --hex x=100000000000000000 c=a k=0 EXIT=0 cnt=0 while 1 do cnt+=1 printf(1,"%16.1f\n",{a}) if k=14 then a=a-c for j=1 to 99999 do b=a+1 if a=b then EXIT=1 exit else a=b end if end for if EXIT then exit end if end if b=a+1 if a<=0 then --handle starting values that are way too high k=k+1 x=x/10 c=c/10 a=c elsif a=b then --number failed the test a=a-x else --number passed the test k=k+1 x=x/10 c=c/10 a=a+c if x<1 then exit end if end if end while printf(1,"%16.1f %16.1f\n",{a,power(2,53)}) sleep(5)