rsa_workbench/calc_pi.php

38 lines
898 B
PHP
Raw Permalink Normal View History

2012-02-14 18:45:18 +00:00
<html>
<body BGCOLOR="#00E0E0" link="#001fC0" vlink="#000080" text="#00000f">
<h1> PI - calculated to required precision </h1>
<?php
2012-02-17 13:18:51 +00:00
$e = $_POST['e'];
$d = $_POST['d'];
$p = $_POST['p'];
$n = $_POST['n'];
$q = $_POST['q'];
$precision = $_POST['precision'];
2012-02-17 13:18:51 +00:00
$phi = $_POST['phi'];
$mprivate = $_POST['mprivate'];
2012-02-14 18:45:18 +00:00
if ( $precision < 1 ) { $precision = 100; }
$date = `date`;
printf("<p> Start Time == %s </p>\n",$date);
$big_num = `echo 'scale=$precision; a(1)*4' | bc -l | sed -f ./nlhtml.sed `;
printf("<p> <h2> Pi is approximately </h2> %s ",$big_num);
printf(" <h2> which is the result of %d decimal places </h2> \n", $precision);
$date = `date`;
printf(" <p>End Time == %s </p>\n",$date);
?>
2012-02-14 18:45:18 +00:00
<p>
<center>
<a href="index.php" border=0> <img src="home.png" border=0> </a>
</center>
<center>
<a href="javascript:history.back();">
<img src=back.png align=center border=0> </a>
</center>