Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
KISS MY ASCII GOOD PI!
#17
Pete
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
Reply


Messages In This Thread
KISS MY ASCII GOOD PI! - by Pete - 08-22-2022, 09:43 AM
RE: KISS MY ASCII GOOD PI! - by Kernelpanic - 08-22-2022, 12:23 PM
RE: KISS MY ASCII GOOD PI! - by Pete - 08-22-2022, 02:25 PM
RE: KISS MY ASCII GOOD PI! - by Kernelpanic - 08-22-2022, 03:37 PM
RE: KISS MY ASCII GOOD PI! - by Pete - 08-22-2022, 03:49 PM
RE: KISS MY ASCII GOOD PI! - by Kernelpanic - 08-22-2022, 03:57 PM
RE: KISS MY ASCII GOOD PI! - by Pete - 08-22-2022, 06:37 PM
RE: KISS MY ASCII GOOD PI! - by Kernelpanic - 08-22-2022, 09:17 PM
RE: KISS MY ASCII GOOD PI! - by Kernelpanic - 08-22-2022, 10:42 PM
RE: KISS MY ASCII GOOD PI! - by SMcNeill - 08-22-2022, 10:56 PM
RE: KISS MY ASCII GOOD PI! - by Pete - 08-24-2022, 12:28 AM
RE: KISS MY ASCII GOOD PI! - by Jack - 08-22-2022, 11:44 PM
RE: KISS MY ASCII GOOD PI! - by SMcNeill - 08-22-2022, 11:51 PM
RE: KISS MY ASCII GOOD PI! - by Jack - 08-24-2022, 01:27 AM
RE: KISS MY ASCII GOOD PI! - by Jack - 08-24-2022, 02:20 AM
RE: KISS MY ASCII GOOD PI! - by Pete - 08-25-2022, 02:06 AM
RE: KISS MY ASCII GOOD PI! - by Jack - 08-25-2022, 11:43 AM
RE: KISS MY ASCII GOOD PI! - by Pete - 08-25-2022, 08:50 PM
RE: KISS MY ASCII GOOD PI! - by Kernelpanic - 08-25-2022, 04:41 PM
RE: KISS MY ASCII GOOD PI! - by mnrvovrfc - 08-25-2022, 08:12 PM
RE: KISS MY ASCII GOOD PI! - by Kernelpanic - 08-25-2022, 09:37 PM
RE: KISS MY ASCII GOOD PI! - by Jack - 08-26-2022, 12:50 AM
RE: KISS MY ASCII GOOD PI! - by Pete - 08-26-2022, 03:16 AM
RE: KISS MY ASCII GOOD PI! - by Pete - 08-26-2022, 03:39 PM
RE: KISS MY ASCII GOOD PI! - by Pete - 08-26-2022, 04:14 PM
RE: KISS MY ASCII GOOD PI! - by Jack - 08-26-2022, 04:24 PM
RE: KISS MY ASCII GOOD PI! - by Pete - 08-26-2022, 04:46 PM
RE: KISS MY ASCII GOOD PI! - by Jack - 08-26-2022, 05:31 PM
RE: KISS MY ASCII GOOD PI! - by Pete - 08-26-2022, 07:50 PM
RE: KISS MY ASCII GOOD PI! - by Pete - 08-26-2022, 08:36 PM
RE: KISS MY ASCII GOOD PI! - by Jack - 08-26-2022, 08:48 PM
RE: KISS MY ASCII GOOD PI! - by Pete - 08-26-2022, 09:36 PM
RE: KISS MY ASCII GOOD PI! - by Pete - 08-27-2022, 05:24 AM



Users browsing this thread: 8 Guest(s)