Pete
I converted the Ramanujan Pi routine to use Treebeard's string-math, maybe you can adapt it to use your string-math routines
I converted the Ramanujan Pi routine to use Treebeard's string-math, maybe you can adapt it to use your string-math routines
Code: (Select All)
Dim As String n, m, c, sum, f, f4, f4k, c1, c2, c3, c34k, t1, t2, t3
Dim As Long k, k4
Dim t As Double
t = Timer
digits% = 100
bInit
c1 = "1103"
c2 = "26390"
c3 = "396"
f = "1"
f4k = "1"
sum = "1103"
c34k = "1"
k4 = 0
t1 = c3
t2 = c3
bMul t1, t2, c3 'result in c3
t1 = c3
t2 = c3
bMul t1, t2, c3 'result in c3
For k = 1 To digits% / 7.984
t1 = f: bMul Str$(k), t1, f 'result in f
t1 = f: t2 = f
bMul t1, t2, f4 'result in f4
t1 = f4: t2 = f4
bMul t1, t2, f4 'result in f4
t1 = c34k
bMul c3, t1, c34k 'result in c34k
t1 = Str$(k4 + 1)
t2 = f4k
bMul t1, t2, f4k 'result in f4k
t1 = Str$(k4 + 2)
t2 = f4k
bMul t1, t2, f4k 'result in f4k
t1 = Str$(k4 + 3)
t2 = f4k
bMul t1, t2, f4k 'result in f4k
t1 = Str$(k4 + 4)
t2 = f4k
bMul t1, t2, f4k 'result in f4k
k4 = k4 + 4
t1 = Str$(k)
bMul t1, c2, t2 'result in t2
bAdd c1, t2, t1 'result in t1
bMul f4k, t1, t2 'result in t2
bMul f4, c34k, t1 'result in t1
bDiv t2, t1, t3 'result in t3
t1 = sum
bAdd t1, t3, sum 'result in sum
Next
bSqr "8", t1 'result in t1
t2 = "9801"
bDiv t1, t2, t3 'result in t3
bMul t3, sum, t2 'result in t2
bDiv t1, t2, t3 'result in t3
bDiv "1", t2, t1 'result in t1
Print t1
t = Timer - t