Ramanujan's constant: Difference between revisions
Content added Content deleted
m (→{{header|REXX}}: added a hyphen to a word.) |
|||
Line 520: | Line 520: | ||
=={{header|REXX}}== |
=={{header|REXX}}== |
||
Instead of calculating <big> '''e''' </big> and <big><big><math>\pi</math></big></big> to some arbitrary length, it was easier to just include those two constants with '''201''' decimal digits (which is the amount of decimal digits used for the calculations). The results are displayed (right justified) with one |
Instead of calculating <big> '''e''' </big> and <big><big><math>\pi</math></big></big> to some arbitrary length, it was easier to just include those two constants with '''201''' decimal digits (which is the amount of decimal digits used for the calculations). The results are displayed (right justified) with one-half of that number of decimal digits past the decimal point. |
||
<lang rexx>/*REXX pgm displays Ramanujan's constant to at least 100 decimal digits of precision. */ |
<lang rexx>/*REXX pgm displays Ramanujan's constant to at least 100 decimal digits of precision. */ |
||
d= min( length(pi()), length(e()) ) - length(.) /*calculate max #decimal digs supported*/ |
d= min( length(pi()), length(e()) ) - length(.) /*calculate max #decimal digs supported*/ |