FORTRAN 77 on PDP-11

John Allain allain at panix.com
Tue Jul 26 23:01:24 CDT 2005


> multi-precision libraries which can handle up to 128 bit integers?

I wanted to get thousands of digits of Pi once and implemented
it using up to 1500 bit precision integers (Yeah Rite).
For this simple program I just used arrays of integers and kept 
shifting carry bits to the left or right, depending on whether I was
dividing or multiplying.  I got about 500 digits of Pi at the time
(1976).  Today we could probably get something like 5000 digits
in 5 seconds on a PC.
I encourage you to try this yourself.
For example an array of (1,0,0,0) divided by 3 would become (0,3,3,3),
minding carries.   An array of (0,0,0,5) times 6 would be (0,0,3,0).
Using these two simple tools I was able to get hundreds of digits of Pi
in 2 pages of code.

John A.
Make magazine.  Issue 3 on newstands now.



More information about the cctalk mailing list