D
darklighta
Guest
I have this PHP script:
<html>
<body>
<?php
set_time_limit(0);
$number = 0;
$pi = 0;
$iterations = 16000001;
while ($number < $iterations)
{
if (!($number & 1))
{
$pi += (4 / ((2 * $number) + 1));
}
else
{
$pi -= (4 / ((2 * $number) + 1));
}
++$number;
}
echo $pi;
?>
</body>
</html>
And I want the variable $pi to be calculated to, say, 20 decimal places. Right now it does it to forteen. Is there a way to do this?
How on earth would I store it in two different variables? Can you show me?
<html>
<body>
<?php
set_time_limit(0);
$number = 0;
$pi = 0;
$iterations = 16000001;
while ($number < $iterations)
{
if (!($number & 1))
{
$pi += (4 / ((2 * $number) + 1));
}
else
{
$pi -= (4 / ((2 * $number) + 1));
}
++$number;
}
echo $pi;
?>
</body>
</html>
And I want the variable $pi to be calculated to, say, 20 decimal places. Right now it does it to forteen. Is there a way to do this?
How on earth would I store it in two different variables? Can you show me?