FORTRAN 77 on PDP-11
Jerome H. Fine
jhfinexgs2 at compsys.to
Thu Jul 28 20:17:30 CDT 2005
>Sean 'Captain Napalm' Conner wrote:
>>It was thus said that the Great Jerome H. Fine once stated:
>
>>After that, if the run times are reasonable, I can extend the code to
>>allow 64 bits - although I am not sure why since even running the
>>code to 20 billion takes more than 10 times 2 billion and doesn't
>>really prove anything. Looking at google, I have noted that PI(N)
>>has been successfully calculated up to:
>>N = 40,000,000,000,000,000,000,000
>>which is already over 70 bits, although it was not done by finding
>>the prime numbers, but by calculating Li(N) and then the error
>>between PI(N) and Li(N).
>>
>I think you are getting a bit confused. 4,000,000,000 can be represented
>in 32 bits, but is only 10 digits. Generally, each 8-bit byte will give you
>2.4 decimal digits of accuracy. So, 4 bytes will give you 9.6 digits, whch
>is in the billions range (although only into the low billions---it's a
>useful estimate). 70 bits will give you 21 digits. I think what you are
>seeing above is that pi has been calculated to
>40,000,000,000,000,000,000,000 digits, which would take something on the
>order of 10**22 bytes to store (or 2**73 bytes, but I'm guessing they have
>some other method of pulling out digits of pi other than storing them all
>before printing).
>
>
Jerome Fine replies:
I suspect that there is gross confusion over pi (to how many figures of
accuracy you choose) and PI(N) which is the NUMBER of primes
between 2 and the number N. NOTE that in both cases, the GREEK
letter "pi" is used (I do not know how to type GREEK letters under
Netscape!!). Why the GREEK letter "pi" is used for PI(N) is beyond
my comprehension, but if you google "prime numbers" and look at a
few of the references, you will find it there. For example:
N PI(N)
10 4 (the primes are 2, 3, 7, 9)
100 25
1,000 168
10,000 1,229
100,000 9,592
By the way, I just learned this use for "pi" this year even though I
have been curious about prime numbers for over 20 years. I finally
requested some books from the library and then did a few googles.
>>For the PDP-11, I tend to understand that MUL is only for signed
>>16 bit numbers, so I don't think MUL can be useful with unsigned
>>values which are required for a 64 bit multiple as per the above
>>example.
>>
>>CAN SOMEONE PLEASE CORRECT ME IF I AM WRONG???
>>
>Easy enough method---just multiply the absolute values and record the
>signs prior to multiplication, then reset the sign afterwards to the correct
>value.
>
That is too easy a solution - anything a bit more difficult?
More seriously, if I am using all 16 bits as unsigned integers, then
the high order bit can't be easily eliminated. Of course another
method is to keep all the values below 10,000 decimal which
can then allow me to use FORTRAN much more easily. But
I really prefer to use the full 64 bits. On the other hand, if I
use the sieve method to find the primes, I don't need either
multiplication or division, just 64 bit adding and 64 bit compares,
probably increments by 2 and 4 and of course conversion of
64 bit values to decimal output. The last can also be done by
repeated subtraction of powers of 10, so again no division.
>>>I have some C code that does some of this---one is a C implementation of a
>>>techique Woz used in calculating e to 100,000 digits (as described in Byte
>>>magazine of either Dec 1980 or Dec 1981) and another one that does division
>>>in C, if you are interested.
>>>
>>I am interested!!!!!!!
>>
>I'll send file files directly to you (and not to the list).
>
Thank you for the files. I have not had a chance to
understand them as yet, but they will prove to be very
useful.
Sincerely yours,
Jerome Fine
--
If you attempted to send a reply and the original e-mail
address has been discontinued due a high volume of junk
e-mail, then the semi-permanent e-mail address can be
obtained by replacing the four characters preceding the
'at' with the four digits of the current year.
More information about the cctalk
mailing list