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] ahar...@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] paj...@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