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

2005-09-01 Thread Wong HoWang
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] Help: Get the value of pi up to 200+ digits?

2005-09-01 Thread Wong HoWang
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

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

2005-09-01 Thread Torgny Bjers
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 . ? I am fairly sure that you have to use BCMath for this: http://www.php.net/manual/en/ref.bc.php Give it a go and see what happens! :)

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

2005-09-01 Thread Wong HoWang
but my server configure don't have bcmath enabled, is there any other way to do so? Torgny Bjers [EMAIL PROTECTED] wrote:[EMAIL PROTECTED] 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 . ?

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

2005-09-01 Thread Oliver Grätz
Wong HoWang schrieb: but my server configure don't have bcmath enabled, is there any other way to do so? Since the internal routines of PHP have limited precision, you these options: - Find a way to activate bcmath (not likely to happen on a shared hosting account) - Find an external program

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

2005-09-01 Thread Jordan Miller
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.

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

2005-09-01 Thread Wong HoWang
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 [EMAIL PROTECTED] wrote:[EMAIL PROTECTED]

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

2005-09-01 Thread Steve Edberg
Hi - The 'precision' ini value refers, I believe, only to float numbers, not BC_math numbers (which are stored as strings). I believe the bcmath.scale parameter is the one you need. It can be set via ini_set or bcscale() - http://php.he.net/manual/en/function.bcscale.php Perhaps you

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

2005-09-01 Thread Steve Edberg
Oops...I didn't see the earlier message that BC functions were not enabled on your server. So, I'd have to concur with Oliver Grätz's suggestions, and add some of my own: - can you change hosts? - are you allowed to install software in your own directory? You may be able to