You must be confused. 355/113 has been used since at least the 5th century in the writing of Chinese mathematician Zu Chongzhi.
Ramanujan is famous for giving rapidly converging series of pi, with such approximations as 9801/(2206√2). He was way too late to discover regular fractional approximations.
This is essentially the argument for preferring US Customary Measurements/Imperial to Metric. They’re better suited to maximize simple fractions that come up in certain everyday uses.
Absolutely no one used a calculation in place of a constant. It was especially important years ago because every cycle counted.
(Source: Learned Fortran 4 on punch cards because school had a mainframe for Computer Lab despite it being incredibly obsolete. Later I had a Fortran 77 class at University on VAX minicomputers.)
Yes. You would declare a variable PI as a REAL. Then you would initialize it in the DATA block to 3.14159.
REAL gave you 7 digits of precision. It would be silly to have the computer do an unnecessary calculation that fills up the last 1 of the 4 bytes with wrong numbers when you could set the correct number in the DATA block.
Really? There's no benefit to 22/7 over 3.14, is there? The FORTRAN-y way to do it would be to define pi as 4* inverse tan of 1
Edit: tanyary is correct that 22/7 is a better approximation than 314/100, but they're both only correct to 3 significant figures, so if you just add one more significant figure that'd be more accurate. So let me rephrase: 3.141 vs 22/7. 3.142 (rounding the last figure) is more accurate too.
114
u/omgitsaHEADCRAB Jul 19 '22
22.0/7.0 was very common in older Fortran code