Bug #51941 [Fbk]: sin() and cos() functions return wrong values
| From: | aharvey@php.net | Date: | Mon, 31 May 2010 03:14:50 +0000 |
| Subject: | Bug #51941 [Fbk]: sin() and cos() functions return wrong values | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-150953@lists.php.net to get a copy of this message | ||
Edit report at http://bugs.php.net/bug.php?id=51941&edit=1
ID: 51941
Updated by: aharvey@php.net
Reported by: veyder at gmail dot com
Summary: sin() and cos() functions return wrong values
Status: Feedback
Type: Bug
Package: Math related
Operating System: Windows XP/Windows 7
PHP Version: 5.3.2
Assigned To: pajoye
New Comment:
For the record, I can't reproduce this on 64-bit Linux or OS X, so this
looks like it's Windows specific.
Previous Comments:
------------------------------------------------------------------------
[2010-05-28 23:40:06] pajoye@php.net
And what do you get?
Which version of php do you? VC6 or VC9?
------------------------------------------------------------------------
[2010-05-28 08:59:09] veyder at gmail dot com
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 this bug report at http://bugs.php.net/bug.php?id=51941&edit=1