Page 1 of 1

3.14

Posted: Sat Sep 20, 2003 11:31 pm
by Vicious
Hey i was jw Just did a lil script http://www.team101.net/divisionscript.php im sure many people have tried it but can I get it to show more then just 3.1428571428571 maybe like a million numbers or so?

Posted: Sat Sep 20, 2003 11:50 pm
by EvilWalrus
Not sure, but pi is actually 3.14159..... your script must have a bug ;)

Posted: Sun Sep 21, 2003 6:13 am
by volka
maybe you should use a more accurate approximation ;-)
e.g. from http://mathworld.wolfram.com/PiFormulas.html and search for the word "spigot"

or google for "pi spigot"

Posted: Sun Sep 21, 2003 2:12 pm
by RFairey
Does that script just divide using normal php arithmetic? If so, you'll get 14 or 15 decimal places tops - thats a double precision floating point number. You either need to code a clever function that outputs the numbers one by one in a loop, or use the php equivalent of a BigDecimal (Arbitrary precision fp numbers (if there is one))