Data update
This commit is contained in:
parent
81fd053722
commit
52a6ef48dd
10248 changed files with 63654 additions and 6775 deletions
|
|
@ -1,22 +1,33 @@
|
|||
func$ mult a$ b$ .
|
||||
a[] = number strchars a$
|
||||
b[] = number strchars b$
|
||||
func[] bnmul a[] b[] .
|
||||
len r[] len a[] + len b[]
|
||||
for ib = len b[] downto 1
|
||||
for ia = 1 to len a[]
|
||||
h = 0
|
||||
for ia = len a[] downto 1
|
||||
h += r[ia + ib] + b[ib] * a[ia]
|
||||
r[ia + ib] = h mod 10
|
||||
h = h div 10
|
||||
for ib = 1 to len b[]
|
||||
h += r[ia + ib - 1] + b[ib] * a[ia]
|
||||
r[ia + ib - 1] = h mod 10000000
|
||||
h = h div 10000000
|
||||
.
|
||||
r[ib] += h
|
||||
r[ia + ib - 1] += h
|
||||
.
|
||||
r$ = ""
|
||||
for i = 1 to len r[]
|
||||
if r$ <> "" or r[i] <> 0 or i = len r[]
|
||||
r$ &= r[i]
|
||||
.
|
||||
while r[$] = 0
|
||||
len r[] -1
|
||||
.
|
||||
return r$
|
||||
return r[]
|
||||
.
|
||||
print mult "18446744073709551616" "18446744073709551616"
|
||||
func$ str bn[] .
|
||||
s$ = bn[$]
|
||||
for i = len bn[] - 1 downto 1
|
||||
h$ = bn[i]
|
||||
s$ &= substr "0000000" 1 (7 - len h$) & h$
|
||||
.
|
||||
return s$
|
||||
.
|
||||
func[] bn s$ .
|
||||
i = len s$ - 7 + 1
|
||||
while i >= -5
|
||||
r[] &= number substr s$ i 7
|
||||
i -= 7
|
||||
.
|
||||
return r[]
|
||||
.
|
||||
print str bnmul bn "18446744073709551616" bn "18446744073709551616"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue