com php-src: drop precision since trigonometric functions are non-portable: ext/standard/tests/math/tan_basiclong_64bit.phpt
| From: | Stanislav Malyshev | Date: | Sun, 26 Jan 2014 23:51:17 +0000 |
| Subject: | com php-src: drop precision since trigonometric functions are non-portable: ext/standard/tests/math/tan_basiclong_64bit.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-75806@lists.php.net to get a copy of this message | ||
Commit: d5560faaa3595c4aaf46329e4714432c42244503
Author: Stanislav Malyshev <stas@php.net> Sun, 26 Jan 2014 15:14:16 -0800
Parents: f49965b487fa6c0cc9512c287beb357d43acfbf5
Branches: PHP-5.4 PHP-5.5 PHP-5.6 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d5560faaa3595c4aaf46329e4714432c42244503
Log:
drop precision since trigonometric functions are non-portable
See: http://stackoverflow.com/questions/21212326/floating-point-arithmetic-and-reproducibility
Changed paths:
M ext/standard/tests/math/tan_basiclong_64bit.phpt
Diff:
diff --git a/ext/standard/tests/math/tan_basiclong_64bit.phpt
b/ext/standard/tests/math/tan_basiclong_64bit.phpt
index 8ab083d..3c8abe9 100644
--- a/ext/standard/tests/math/tan_basiclong_64bit.phpt
+++ b/ext/standard/tests/math/tan_basiclong_64bit.phpt
@@ -1,5 +1,7 @@
--TEST--
Test tan function : 64bit long tests
+--INI--
+precision=5
--SKIPIF--
<?php
if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
@@ -28,33 +30,34 @@ foreach ($longVals as $longVal) {
===DONE===
--EXPECT--
--- testing: 9223372036854775807 ---
-float(84.739312968756)
+float(84.739)
--- testing: -9223372036854775808 ---
-float(-84.739312968756)
+float(-84.739)
--- testing: 2147483647 ---
-float(1.0523779637351)
+float(1.0524)
--- testing: -2147483648 ---
-float(4.0842894552986)
+float(4.0843)
--- testing: 9223372034707292160 ---
-float(-0.25738520049439)
+float(-0.25739)
--- testing: -9223372034707292160 ---
-float(0.25738520049439)
+float(0.25739)
--- testing: 2147483648 ---
-float(-4.0842894552986)
+float(-4.0843)
--- testing: -2147483649 ---
-float(0.34328416030117)
+float(0.34328)
--- testing: 4294967294 ---
-float(-19.579238091943)
+float(-19.579)
--- testing: 4294967295 ---
-float(-0.57225137018055)
+float(-0.57225)
--- testing: 4294967293 ---
-float(0.71667000824652)
+float(0.71667)
--- testing: 9223372036854775806 ---
-float(84..739312968756)
---- testing: 9.2233720368548E+18 ---
-float(84.739312968756)
+float(84.739)
+--- testing: 9.2234E+18 ---
+float(84.739)
--- testing: -9223372036854775807 ---
-float(-84.739312968756)
---- testing: -9.2233720368548E+18 ---
-float(-84.739312968756)
+float(-84.739)
+--- testing: -9.2234E+18 ---
+float(-84.739)
===DONE===
+