Bug #51941 [NEW]: sin() and cos() functions return wrong values
| From: | veyder at gmail dot com | Date: | Fri, 28 May 2010 06:59:10 +0000 |
| Subject: | Bug #51941 [NEW]: sin() and cos() functions return wrong values | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-150902@lists.php.net to get a copy of this message | ||
From:
Operating system: Windows XP/Windows 7
PHP version: 5.3.2
Package: Math related
Bug Type: Bug
Bug description:sin() and cos() functions return wrong values
Description:
------------
For very large values of $x (9.2233720368548E+18 and more), sin($x) and
cos($x) simply return $x
Test script:
---------------
$x = 9.2233720368547E+18;
var_dump(sin($x));
var_dump(cos($x));
$x = 9.2233720368548E+18;
var_dump(sin($x));
var_dump(cos($x));
$x = 9.2233720368547E+22;
var_dump(sin($x));
var_dump(cos($x));
$x = 9.2233720368547E+5;
var_dump(sin($x));
var_dump(cos($x));
Expected result:
----------------
float(0.70730241295515)
float(0.70691109527848)
float(9.2233720368548E+18)
float(9.2233720368548E+18)
float(9.2233720368547E+22)
float(9.2233720368547E+22)
float(-0.15745275115961)
float(-0.98752652174626)
--
Edit bug report at http://bugs.php.net/bug.php?id=51941&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=51941&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=51941&r=trysnapshot53
Try a snapshot (trunk): http://bugs.php.net/fix.php?id=51941&r=trysnapshottrunk
Fixed in SVN: http://bugs.php.net/fix.php?id=51941&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=51941&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=51941&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=51941&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=51941&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=51941&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=51941&r=support
Expected behavior: http://bugs.php.net/fix.php?id=51941&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=51941&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=51941&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=51941&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=51941&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=51941&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=51941&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=51941&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=51941&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=51941&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=51941&r=mysqlcfg