Posted: 20th Nov 2002 2:06
Uses strings adds VERY properly! "if this s pleasing then I'll add multiplication nddivision and subtraction" depends on th attitude of poeple about it.

+ Code Snippet
sync rate 0:sync on

`Virtual 2040 bit numbers
`By using the string system and carfully ging over each digit and adding
`and carrying the value properly we can generate massive numbers!
`However somethings cant be helped bigger the number more time
`the computer must spend calculating this value however it remains fast!

create bitmap 1,640,480

NUMBER$="9"
NUMBER2$="6"

hey:
cls
number$=AddHuge$(number$,number2$)

`Lets add expotentially! by increasing the adding number by last mwahaha!
`This would kill the normal number system in a second
number2$=AddHuge$(number2$,number$)
print "Russel "+chr$(34)+"IronHoof"+chr$(34)+" Hamrick presents Virtual 2040 bit numbers"
print number$
print "This number is "+str$(len(number$))+" digits long."
print "This number is a "+str$(len(number$)*8)+" bit number."
copy bitmap 1,0:sync
if len(number$)len(meganum1$) then TMP$=meganum2$:meganum2$=meganum1$:meganum1$=TMP$
MN1=len(meganum1$):MN2=len(meganum2$):CUTOFF=0
More:
NV1$=mid$(meganum1$,MN1)
NV2$=mid$(meganum2$,MN2)
DAT1=Val(NV1$)
if CUTOFF=0 then DAT2=Val(NV2$) else DAT2=0
CARY=val(CARRY$)
DAT3=DAT1+DAT2+CARY
NV3$=STR$(DAT3)
if len(NV3$)>1 then CARRY$=left$(NV3$,1):NV3$=RIGHT$(NV3$,1) else CARRY$="0"
if MN1-1Len(meganum1$) then TMPR$="" else TMPR$=right$(meganum1$,len(meganum1$)-MN1)
meganum1$=TMPL$+NV3$+TMPR$
if MN2>1 then dec MN1,1:dec MN2,1:goto More:
CUTOFF=1:if MN1>1 and CARRY$"0" then dec MN1,1:goto More:
if CARRY$"0" then TMP$=CARRY$+meganum1$:meganum1$=TMP$
endfunction meganum1$

`Multiply dosn't work yet I got a migrain from it!
Function MultiplyHuge$(meganum1$,meganum2$)
if len(meganum2$)>len(meganum1$) then TMP$=meganum2$:meganum2$=meganum1$:meganum1$=TMP$
MN1=len(meganum1$):MN2=len(meganum2$):CUTOFF=0
More:
NV1$=mid$(meganum1$,MN1)
NV2$=mid$(meganum2$,MN2)
DAT1=Val(NV1$)
if CUTOFF=0 then DAT2=Val(NV2$) else DAT2=0
CARY=val(CARRY$)
DAT3=DAT1*(DAT2+CARY)
NV3$=STR$(DAT3)
if len(NV3$)>1 then CARRY$=left$(NV3$,len(NV3$)-1):NV3$=RIGHT$(NV3$,1) else CARRY$="0"
if MN1-1Len(meganum1$) then TMPR$="" else TMPR$=right$(meganum1$,len(meganum1$)-MN1)
meganum1$=TMPL$+NV3$+TMPR$
if MN1=1 then MN1=LEN(meganum1$):dec MN2,1
if MN2>1 then dec MN1,1:goto More:
CUTOFF=1:if MN1>1 and CARRY$"0" then dec MN1,1:goto More:
if CARRY$"0" then TMP$=CARRY$+meganum1$:meganum1$=TMP$
endfunction meganum1$
Posted: 20th Nov 2002 2:08
What the hey it cut it off.... this is all you nee not that other junk

+ Code Snippet
sync rate 0:sync on

`Virtual 2040 bit numbers
`By using the string system and carfully ging over each digit and adding
`and carrying the value properly we can generate massive numbers!
`However somethings cant be helped bigger the number more time
`the computer must spend calculating this value however it remains fast!

create bitmap 1,640,480

NUMBER$="9"
NUMBER2$="6"

hey:
cls
number$=AddHuge$(number$,number2$)

`Lets add expotentially! by increasing the adding number by last mwahaha!
`This would kill the normal number system in a second
number2$=AddHuge$(number2$,number$)
print "Russel "+chr$(34)+"IronHoof"+chr$(34)+" Hamrick presents Virtual 2040 bit numbers"
print number$
print "This number is "+str$(len(number$))+" digits long."
print "This number is a "+str$(len(number$)*8)+" bit number."
copy bitmap 1,0:sync
if len(number$)<255 then goto hey:


copy bitmap 1,0:sync




Function AddHuge$(meganum1$,meganum2$)
if len(meganum2$)>len(meganum1$) then TMP$=meganum2$:meganum2$=meganum1$:meganum1$=TMP$
MN1=len(meganum1$):MN2=len(meganum2$):CUTOFF=0
More:
NV1$=mid$(meganum1$,MN1)
NV2$=mid$(meganum2$,MN2)
DAT1=Val(NV1$)
if CUTOFF=0 then DAT2=Val(NV2$) else DAT2=0
CARY=val(CARRY$)
DAT3=DAT1+DAT2+CARY
NV3$=STR$(DAT3)
if len(NV3$)>1 then CARRY$=left$(NV3$,1):NV3$=RIGHT$(NV3$,1) else CARRY$="0"
if MN1-1<1 then TMPL$="" else TMPL$=left$(meganum1$,MN1-1)
if MN1+1>Len(meganum1$) then TMPR$="" else TMPR$=right$(meganum1$,len(meganum1$)-MN1)
meganum1$=TMPL$+NV3$+TMPR$
if MN2>1 then dec MN1,1:dec MN2,1:goto More:
CUTOFF=1:if MN1>1 and CARRY$<>"0" then dec MN1,1:goto More:
if CARRY$<>"0" then TMP$=CARRY$+meganum1$:meganum1$=TMP$
endfunction meganum1$