#31803 [NEW]: Erro in Cos function
| From: | thiago_mata at yahoo dot com dot br | Date: | Wed, 02 Feb 2005 03:16:34 +0000 |
| Subject: | #31803 [NEW]: Erro in Cos function | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-73231@lists.php.net to get a copy of this message | ||
From: thiago_mata at yahoo dot com dot br
Operating system: Windows XP
PHP version: 4.3.10
PHP Bug Type: Safe Mode/open_basedir
Bug description: Erro in Cos function
Description:
------------
The funcion cos it is not return the espected result. While the sin it is
ok.
Reproduce code:
---------------
$Angulo = Pi()/2;
print "cos(Angulo) = ".cos($Angulo)."<BR>\n";
print "cos(Pi/2) = ".cos(Pi()/2)."<BR>\n";
print "Angulo = $Angulo <br>\n";
$cos = sqrt(1 - sin($Angulo)*sin($Angulo));
print "Coseno = ".cos($Angulo)."<br>\n Cos =
".$cos."<BR>\n";
print "Seno = ".sin($Angulo)."<BR>\n";
Expected result:
----------------
cos(Angulo) = 0
cos(Pi/2) = 0
Angulo = 1.5707963267949
Coseno = 0
Cos = 0
Seno = 1
Actual result:
--------------
cos(Angulo) = 6.1230317691119E-017
cos(Pi/2) = 6.1230317691119E-017
Angulo = 1.5707963267949
Coseno = 6.1230317691119E-017
Cos = 0
Seno = 1
--
Edit bug report at http://bugs.php.net/?id=31803&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=31803&r=trysnapshot4
Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=31803&r=trysnapshot50
Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=31803&r=trysnapshot51
Fixed in CVS: http://bugs.php.net/fix.php?id=31803&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=31803&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=31803&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=31803&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=31803&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=31803&r=support
Expected behavior: http://bugs.php.net/fix.php?id=31803&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=31803&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=31803&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=31803&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=31803&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=31803&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=31803&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=31803&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=31803&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=31803&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=31803&r=mysqlcfg