Re: [PHP] Help: Get the value of pi up to 200+ digits?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



strange, with your code, mine cuts out at 49 significant digits:
3.141592653589793115997963468544185161590576171875

it must be a system-specific limitation.

we need more information on what you are trying to do, *exactly*. be as detailed and specific as possible.



On Sep 1, 2005, at 10:57 AM, Wong HoWang wrote:

Dear Jordan,

I know what you mean. But you may try this one and you will know:
<?php
ini_set('precision',200);
echo pi();
?>
the result is the same as 16!!!

So that's why I ask this question! I am not stupid like that!

Please help, thx!


"Jordan Miller" <jmil@xxxxxxxxxxxxxxxxxx>
wrote:534D8D52-751D-45B6-9B49-DD9FA136C727@xxxxxxxxxxxxxxxxxxxxx

http://us3.php.net/manual/en/ini.core.php#ini.precision

precision sets the number of significant digits, *NOT* the number of
digits displayed after the decimal point.

If you want to get pi out to 16 decimal places you need a precision of
*17* because the beginning 3 is a significant digit.

Your code does exactly this, displaying pi with 15 decimal places.

Jordan



On Sep 1, 2005, at 8:06 AM, Wong HoWang wrote:


Dear all,

I'm trying to do like this but failed:

<?php
ini_set('precision',16);
echo pi();
?>

How can I get more digits after . ?

Can anyone help? Thx!

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php






--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux