Bug #51941 [Com]: sin() and cos() functions return wrong values
| From: | v-mafick at microsoft dot com | Date: | Fri, 26 Aug 2011 19:01:24 +0000 |
| Subject: | Bug #51941 [Com]: sin() and cos() functions return wrong values | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-162948@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=51941&edit=1
ID: 51941
Comment by: v-mafick at microsoft dot com
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
Block user comment: N
Private report: N
New Comment:
Thank you for reporting this.
This bug is reproducable on VC6, but this bug is not reproducable on VC9.
Moving forward, PHP is only supported on VC9.
Please upgrade to a PHP binary based on VC9 (the ZIP file you download will have 'vc9' in
the filename).
Previous Comments:
------------------------------------------------------------------------
[2010-05-31 05:14:49] aharvey@php.net
For the record, I can't reproduce this on 64-bit Linux or OS X, so this looks like it's
Windows specific.
------------------------------------------------------------------------
[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 https://bugs.php.net/bug.php?id=51941&edit=1