Geohash: Difference between revisions
m
→{{header|Phix}}: added precision 22 test
(julia example) |
m (→{{header|Phix}}: added precision 22 test) |
||
Line 223:
sequence tests = {{{51.433718, -0.214126}, 2},
{{51.433718, -0.214126}, 9},
{{57.64911, 10.40744 }, 11}
{{57.64911, 10.40744 }, 22}}
for i=1 to length(tests) do
Line 235 ⟶ 236:
tests = append(tests,"ezs42")
for i=1 to length(tests) do
printf(1,"%-
end for</lang>
{{out}}
Line 242 ⟶ 243:
geohash for {51.433718,-0.214126}, precision 9 = gcpue5hp4
geohash for {57.64911,10.40744}, precision 11 = u4pruydqqvj
geohash for {57.64911,10.40744}, precision 22 = u4pruydqqvj8pr9yc27rjr
decode tests:
gc ==> {{50.625,56.25},{-11.25,0}}
gcpue5hp4 ==> {{51.43369675,51.43373966},{-0.2141475677,-0.2141046524}}
u4pruydqqvj ==> {{57.64910996,57.6491113},{10.40743902,10.40744036}}
ezs42 ==> {{42.58300781,42.62695312},{-5.625,-5.581054688}}
</pre>
Not surprisingly, "gc" is not even accurate to one significant digit, but a precision of 9 is accurate to 5 or 6 significant digits,
=={{header|Python}}==
|