Skip to content

Commit 4f81896

Browse files
committed
Reduce precising on more trig tests
1 parent 288e964 commit 4f81896

File tree

7 files changed

+100
-96
lines changed

7 files changed

+100
-96
lines changed

ext/standard/tests/math/cos_basiclong_64bit.phpt

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Test cos function : 64bit long tests
44
<?php
55
if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
66
?>
7+
--INI--
8+
serialize_precision=14
79
--FILE--
810
<?php
911

@@ -27,32 +29,32 @@ foreach ($longVals as $longVal) {
2729
?>
2830
--EXPECT--
2931
--- testing: 9223372036854775807 ---
30-
float(0.011800076512800236)
32+
float(0.0118000765128)
3133
--- testing: -9223372036854775808 ---
32-
float(0.011800076512800236)
34+
float(0.0118000765128)
3335
--- testing: 2147483647 ---
34-
float(-0.6888366918779438)
36+
float(-0.68883669187794)
3537
--- testing: -2147483648 ---
36-
float(0.23781619457280337)
38+
float(0.2378161945728)
3739
--- testing: 9223372034707292160 ---
38-
float(-0.9684363006554391)
40+
float(-0.96843630065544)
3941
--- testing: -9223372034707292160 ---
40-
float(-0.9684363006554391)
42+
float(-0.96843630065544)
4143
--- testing: 2147483648 ---
42-
float(0.23781619457280337)
44+
float(0.2378161945728)
4345
--- testing: -2147483649 ---
44-
float(0.9458219684788874)
46+
float(0.94582196847889)
4547
--- testing: 4294967294 ---
46-
float(-0.051008023845301335)
48+
float(-0.051008023845301)
4749
--- testing: 4294967295 ---
48-
float(-0.8679353473572022)
50+
float(-0.8679353473572)
4951
--- testing: 4294967293 ---
50-
float(0.8128158415544156)
52+
float(0.81281584155442)
5153
--- testing: 9223372036854775806 ---
52-
float(0.011800076512800236)
54+
float(0.0118000765128)
5355
--- testing: 9.2233720368548E+18 ---
54-
float(0.011800076512800236)
56+
float(0.0118000765128)
5557
--- testing: -9223372036854775807 ---
56-
float(0.011800076512800236)
58+
float(0.0118000765128)
5759
--- testing: -9.2233720368548E+18 ---
58-
float(0.011800076512800236)
60+
float(0.0118000765128)

ext/standard/tests/math/cos_variation.phpt

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--TEST--
22
Test variations in usage of cos()
33
--INI--
4-
precision = 10
4+
serialize_precision = 10
55
--FILE--
66
<?php
77
/*
@@ -34,19 +34,19 @@ for ($i = 0; $i < count($values); $i++) {
3434

3535
?>
3636
--EXPECTF--
37-
float(-0.5328330203333975)
38-
float(-0.5328330203333975)
39-
float(-0.11171123911915933)
40-
float(-0.11171123911915933)
41-
float(-0.5328330203333975)
42-
float(-0.5328330203333975)
43-
float(-0.5328330203333975)
44-
float(-0.11171123911915933)
45-
float(-0.11171123911915933)
46-
float(0.5623790762907029)
37+
float(-0.5328330203)
38+
float(-0.5328330203)
39+
float(-0.1117112391)
40+
float(-0.1117112391)
41+
float(-0.5328330203)
42+
float(-0.5328330203)
43+
float(-0.5328330203)
44+
float(-0.1117112391)
45+
float(-0.1117112391)
46+
float(0.5623790763)
4747

4848
Notice: A non well formed numeric value encountered in %s on line %d
49-
float(0.5623790762907029)
49+
float(0.5623790763)
5050
float(1)
51-
float(0.5403023058681398)
51+
float(0.5403023059)
5252
float(1)

ext/standard/tests/math/expm1_basic.phpt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--TEST--
22
Test expm1() - basic function test for expm1()
33
--INI--
4-
precision=14
4+
serialize_precision=14
55
--FILE--
66
<?php
77
/* Prototype : float expm1 ( float $arg )
@@ -37,22 +37,22 @@ foreach($values as $value) {
3737
*** Testing expm1() : basic functionality ***
3838

3939
-- Iteration 1 --
40-
float(22025.465794806718)
40+
float(22025.465794807)
4141

4242
-- Iteration 2 --
43-
float(29731.618852891435)
43+
float(29731.618852891)
4444

4545
-- Iteration 3 --
4646
float(INF)
4747

4848
-- Iteration 4 --
49-
float(29048849665246.426)
49+
float(29048849665246)
5050

5151
-- Iteration 5 --
52-
float(1.8112390828890233E+41)
52+
float(1.811239082889E+41)
5353

5454
-- Iteration 6 --
55-
float(22025.465794806718)
55+
float(22025.465794807)
5656

5757
-- Iteration 7 --
5858
float(INF)
@@ -61,10 +61,10 @@ float(INF)
6161
float(INF)
6262

6363
-- Iteration 9 --
64-
float(86593400423993740)
64+
float(8.6593400423994E+16)
6565

6666
-- Iteration 10 --
67-
float(1.718281828459045)
67+
float(1.718281828459)
6868

6969
-- Iteration 11 --
7070
float(0)

ext/standard/tests/math/sin_basiclong_64bit.phpt

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Test sin function : 64bit long tests
44
<?php
55
if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
66
?>
7+
--INI--
8+
serialize_precision=14
79
--FILE--
810
<?php
911

@@ -27,32 +29,32 @@ foreach ($longVals as $longVal) {
2729
?>
2830
--EXPECT--
2931
--- testing: 9223372036854775807 ---
30-
float(0.9999303766734422)
32+
float(0.99993037667344)
3133
--- testing: -9223372036854775808 ---
32-
float(-0.9999303766734422)
34+
float(-0.99993037667344)
3335
--- testing: 2147483647 ---
34-
float(-0.7249165551445564)
36+
float(-0.72491655514456)
3537
--- testing: -2147483648 ---
36-
float(0.9713101757929392)
38+
float(0.97131017579294)
3739
--- testing: 9223372034707292160 ---
38-
float(0.249261171410246)
40+
float(0.24926117141025)
3941
--- testing: -9223372034707292160 ---
40-
float(-0.249261171410246)
42+
float(-0.24926117141025)
4143
--- testing: 2147483648 ---
42-
float(-0.9713101757929392)
44+
float(-0.97131017579294)
4345
--- testing: -2147483649 ---
44-
float(0.32468570024367005)
46+
float(0.32468570024367)
4547
--- testing: 4294967294 ---
46-
float(0.9986982434666626)
48+
float(0.99869824346666)
4749
--- testing: 4294967295 ---
48-
float(0.49667719175328817)
50+
float(0.49667719175329)
4951
--- testing: 4294967293 ---
50-
float(0.582520735869709)
52+
float(0.58252073586971)
5153
--- testing: 9223372036854775806 ---
52-
float(0.9999303766734422)
54+
float(0.99993037667344)
5355
--- testing: 9.2233720368548E+18 ---
54-
float(0.9999303766734422)
56+
float(0.99993037667344)
5557
--- testing: -9223372036854775807 ---
56-
float(-0.9999303766734422)
58+
float(-0.99993037667344)
5759
--- testing: -9.2233720368548E+18 ---
58-
float(-0.9999303766734422)
60+
float(-0.99993037667344)

ext/standard/tests/math/sin_variation.phpt

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--TEST--
22
Test variations in usage of sin()
33
--INI--
4-
precision = 10
4+
serialize_precision = 10
55
--FILE--
66
<?php
77
/*
@@ -34,19 +34,19 @@ for ($i = 0; $i < count($values); $i++) {
3434

3535
?>
3636
--EXPECTF--
37-
float(-0.8462204041751706)
38-
float(0.8462204041751706)
39-
float(-0.9937407101726596)
40-
float(0.9937407101726596)
41-
float(-0.8462204041751706)
42-
float(-0.8462204041751706)
43-
float(-0.8462204041751706)
44-
float(-0.9937407101726596)
45-
float(-0.9937407101726596)
46-
float(0.8268795405320025)
37+
float(-0.8462204042)
38+
float(0.8462204042)
39+
float(-0.9937407102)
40+
float(0.9937407102)
41+
float(-0.8462204042)
42+
float(-0.8462204042)
43+
float(-0.8462204042)
44+
float(-0.9937407102)
45+
float(-0.9937407102)
46+
float(0.8268795405)
4747

4848
Notice: A non well formed numeric value encountered in %s on line %d
49-
float(0.8268795405320025)
49+
float(0.8268795405)
5050
float(0)
51-
float(0.8414709848078965)
51+
float(0.8414709848)
5252
float(0)
Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
--TEST--
22
Test tan function : 64bit long tests
3-
--INI--
4-
precision=5
53
--SKIPIF--
64
<?php
75
if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platform only");
86
?>
7+
--INI--
8+
serialize_precision=5
99
--FILE--
1010
<?php
1111

@@ -29,32 +29,32 @@ foreach ($longVals as $longVal) {
2929
?>
3030
--EXPECT--
3131
--- testing: 9223372036854775807 ---
32-
float(84.73931296875567)
32+
float(84.739)
3333
--- testing: -9223372036854775808 ---
34-
float(-84.73931296875567)
34+
float(-84.739)
3535
--- testing: 2147483647 ---
36-
float(1.0523779637351338)
36+
float(1.0524)
3737
--- testing: -2147483648 ---
38-
float(4.084289455298593)
38+
float(4.0843)
3939
--- testing: 9223372034707292160 ---
40-
float(-0.2573852004943905)
40+
float(-0.25739)
4141
--- testing: -9223372034707292160 ---
42-
float(0.2573852004943905)
42+
float(0.25739)
4343
--- testing: 2147483648 ---
44-
float(-4.084289455298593)
44+
float(-4.0843)
4545
--- testing: -2147483649 ---
46-
float(0.3432841603011652)
46+
float(0.34328)
4747
--- testing: 4294967294 ---
48-
float(-19.579238091943036)
48+
float(-19.579)
4949
--- testing: 4294967295 ---
50-
float(-0.5722513701805472)
50+
float(-0.57225)
5151
--- testing: 4294967293 ---
52-
float(0.7166700082465247)
52+
float(0.71667)
5353
--- testing: 9223372036854775806 ---
54-
float(84.73931296875567)
55-
--- testing: 9.2234E+18 ---
56-
float(84.73931296875567)
54+
float(84.739)
55+
--- testing: 9.2233720368548E+18 ---
56+
float(84.739)
5757
--- testing: -9223372036854775807 ---
58-
float(-84.73931296875567)
59-
--- testing: -9.2234E+18 ---
60-
float(-84.73931296875567)
58+
float(-84.739)
59+
--- testing: -9.2233720368548E+18 ---
60+
float(-84.739)

ext/standard/tests/math/tan_variation.phpt

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
--TEST--
22
Test variations in usage of tan()
33
--INI--
4-
precision = 10
4+
serialize_precision = 10
55
--FILE--
66
<?php
77
/*
@@ -34,19 +34,19 @@ for ($i = 0; $i < count($values); $i++) {
3434

3535
?>
3636
--EXPECTF--
37-
float(1.5881530833912738)
38-
float(-1.5881530833912738)
39-
float(8.895619796255806)
40-
float(-8.895619796255806)
41-
float(1.5881530833912738)
42-
float(1.5881530833912738)
43-
float(1.5881530833912738)
44-
float(8.895619796255806)
45-
float(8.895619796255806)
46-
float(1.4703241557027185)
37+
float(1.588153083)
38+
float(-1.588153083)
39+
float(8.895619796)
40+
float(-8.895619796)
41+
float(1.588153083)
42+
float(1.588153083)
43+
float(1.588153083)
44+
float(8.895619796)
45+
float(8.895619796)
46+
float(1.470324156)
4747

4848
Notice: A non well formed numeric value encountered in %s on line %d
49-
float(1.4703241557027185)
49+
float(1.470324156)
5050
float(0)
51-
float(1.5574077246549023)
51+
float(1.557407725)
5252
float(0)

0 commit comments

Comments
 (0)