Skip to content

Commit 191d165

Browse files
committed
Merge pull request #4 from natmchugh/fix_precision
Fix tests with very long float precison
2 parents 84dc192 + 7557728 commit 191d165

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

tests/Greenwich.phpt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ $diferenceAiry = haversine($polar['lat'], $polar['long'], $polar['lat'], 0);
1616
//lat long of merdian in Airy 1830 ideally long of 0
1717
var_dump($polar);
1818
//distance in m of difference from lat long and meridian
19-
var_dump($diferenceWGS84 * 1000, $diferenceAiry * 1000);
19+
echo round($diferenceWGS84 * 1000, 8),PHP_EOL;
20+
echo round($diferenceAiry * 1000, 8),PHP_EOL;
2021
--EXPECT--
2122
array(3) {
2223
["lat"]=>
@@ -26,5 +27,5 @@ array(3) {
2627
["height"]=>
2728
float(-21.205192557536)
2829
}
29-
float(102.84185171429)
30-
float(9.4481679649233)
30+
102.84185171
31+
9.44816796

tests/WGS84_to_OSGB36.phpt

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,10 @@ $long = dms_to_decimal(-1, 28, 1);
88

99
$polar = transform_datum($lat, $long, GEO_WGS84, GEO_AIRY_1830);
1010

11-
var_dump($polar);
11+
echo round($polar['lat'], 8),PHP_EOL;
12+
echo round($polar['long'], 8),PHP_EOL;
13+
echo round($polar['height'], 8),PHP_EOL;
1214
--EXPECT--
13-
array(3) {
14-
["lat"]=>
15-
float(53.38334018402)
16-
["long"]=>
17-
float(-1.4654162848544)
18-
["height"]=>
19-
float(-24.780265408568)
20-
}
15+
53.38334018
16+
-1.46541628
17+
-24.78026541

0 commit comments

Comments
 (0)