Skip to content

Commit d5560fa

Browse files
committed
drop precision since trigonometric functions are non-portable
See: http://stackoverflow.com/questions/21212326/floating-point-arithmetic-and-reproducibility
1 parent f49965b commit d5560fa

File tree

1 file changed

+20
-17
lines changed

1 file changed

+20
-17
lines changed

ext/standard/tests/math/tan_basiclong_64bit.phpt

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
--TEST--
22
Test tan function : 64bit long tests
3+
--INI--
4+
precision=5
35
--SKIPIF--
46
<?php
57
if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
@@ -28,33 +30,34 @@ foreach ($longVals as $longVal) {
2830
===DONE===
2931
--EXPECT--
3032
--- testing: 9223372036854775807 ---
31-
float(84.739312968756)
33+
float(84.739)
3234
--- testing: -9223372036854775808 ---
33-
float(-84.739312968756)
35+
float(-84.739)
3436
--- testing: 2147483647 ---
35-
float(1.0523779637351)
37+
float(1.0524)
3638
--- testing: -2147483648 ---
37-
float(4.0842894552986)
39+
float(4.0843)
3840
--- testing: 9223372034707292160 ---
39-
float(-0.25738520049439)
41+
float(-0.25739)
4042
--- testing: -9223372034707292160 ---
41-
float(0.25738520049439)
43+
float(0.25739)
4244
--- testing: 2147483648 ---
43-
float(-4.0842894552986)
45+
float(-4.0843)
4446
--- testing: -2147483649 ---
45-
float(0.34328416030117)
47+
float(0.34328)
4648
--- testing: 4294967294 ---
47-
float(-19.579238091943)
49+
float(-19.579)
4850
--- testing: 4294967295 ---
49-
float(-0.57225137018055)
51+
float(-0.57225)
5052
--- testing: 4294967293 ---
51-
float(0.71667000824652)
53+
float(0.71667)
5254
--- testing: 9223372036854775806 ---
53-
float(84.739312968756)
54-
--- testing: 9.2233720368548E+18 ---
55-
float(84.739312968756)
55+
float(84.739)
56+
--- testing: 9.2234E+18 ---
57+
float(84.739)
5658
--- testing: -9223372036854775807 ---
57-
float(-84.739312968756)
58-
--- testing: -9.2233720368548E+18 ---
59-
float(-84.739312968756)
59+
float(-84.739)
60+
--- testing: -9.2234E+18 ---
61+
float(-84.739)
6062
===DONE===
63+

0 commit comments

Comments
 (0)