项目作者: mcquiggi

项目描述 :
Compute Pi to an arbitrary number of digits using VAX FORTRAN
高级语言: Fortran
项目地址: git://github.com/mcquiggi/Pi-VAX.git
创建时间: 2018-11-02T22:23:52Z
项目社区:https://github.com/mcquiggi/Pi-VAX

开源协议:GNU General Public License v3.0

下载


Pi-VAX

Compute pi to an arbitrary number of digits using VAX FORTRAN. Why, you ask? Why not?

The program uses Machin’s series for computation of pi. See https://en.wikipedia.org/wiki/John_Machin for details.

Set DIGITS in the source file PI.FOR to the number of digits desired.

To compile/link under VMS:

  1. $ FORTRAN/LIS PI.FOR
  2. $ LINK PI

And to run it, just:

  1. $ RUN PI

This is standard FORTRAN, however, so it should run with little problem on other platforms. It is F77, as I recall.

You may have some issues with standard integers if your compiler doesn’t have the equivalent of an “unsigned” integer. VAX FORTRAN doesen’t know of unsigned integers, so I store 4 decimal digits per 4-byte integer, rather than 5 as in PL/I, which has unsigned integer as a standard data type. In any case, this should likely work “out of the box” so give it a try first!

Be prepared to wait quite a while for a large number of digits. 100,000 digits takes about
8 hours on a newer (circa 1995) MicroVAX 3100/80.

This is a FORTRAN port of an older program I wrote for this purpose in PL/I.

K. McQuiggin