Fw: [PHP-DEV] PHP 4.0 Bug #7953: Results from SIN, COS, TAN functions are not correct

From: Date: Thu, 23 Nov 2000 23:31:40 +0000
Subject: Fw: [PHP-DEV] PHP 4.0 Bug #7953: Results from SIN, COS, TAN functions are not correct
Groups: php.dev 
Request: Send a blank email to php-dev+get-39047@lists.php.net to get a copy of this message
your numbers are in degrees. PHP returns values from trig functions in radians. - Jon ----- Original Message ----- From: <vnovakov@f.bg.ac.yu> To: <php-dev@lists.php.net> Sent: Thursday, November 23, 2000 3:24 PM Subject: [PHP-DEV] PHP 4.0 Bug #7953: Results from SIN, COS, TAN functions are not correct From: vnovakov@f.bg.ac.yu Operating system: Windows 2000 Professional PHP version: 4.0.3pl1 PHP Bug Type: Math related Bug description: Results from SIN, COS, TAN functions are not correct 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 -- Edit Bug report at: http://bugs.php.net/?id=7953&edit=1 -- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe@lists.php.net For additional commands, e-mail: php-dev-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.dev (#39047) next »