PHP 4.0.3pl1 - Math. functions - BUG!
| From: | Vladimir Novakovic | Date: | Thu, 23 Nov 2000 23:38:51 +0000 |
| Subject: | PHP 4.0.3pl1 - Math. functions - BUG! | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-26875@lists.php.net to get a copy of this message | ||
Using PHP 4.0.3pl1 under Windows NT, I found bugs in SIN, COS and TAN
math. functions:
<?
echo "<html>";
$a = 26.736944444444;
$s = sin($a);
$c = cos($a);
$t = tan($a);
echo "SIN $a= "; echo $s; echo "<p>;
echo "COS $a= "; echo $c; echo "<p>;
echo "TAN $a= "; echo $t; echo "<p>;
echo "</html>";
?>
Results are:
SIN $a = 0.99944204177993
COS $a = -0.033400675483516
TAN $a = -29.922809263938
SIN and COS functions are not correct. As TAN $a is using SIN $a /COS $a.
TAN function is not correct too. Calulate manualy or using any calculator
you will see that real values are:
SIN $a = 0.4498...
COS $a = 0.8930...
TAN a$ = 0.5037...
regards,
Vladimir