You are here: Re: [PHP] Help: Get the value of pi up to 200+ digits? « PHP « IT news, forums, messages
Re: [PHP] Help: Get the value of pi up to 200+ digits?

Posted by Jordan Miller on 10/18/53 11:26

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
>
>
>
>

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация