Menu

#162 Rounding issue in test/check_parse_latlon.sh on i386

v1.10
pending-fixed
nobody
None
5
2022-01-03
2022-01-02
Paul Gevers
No

I recently updated the Debian package of viking to 1.10, thanks for creating it.

I had one issue building it on i386: one of the tests fails on what seems like a rounding issue.

check_success "S034° 12.3456 W003° 45.6789" "-34.20576 -3.76131"

returns

34.20576 -3.76132 != -34.20576 -3.76131

I tweaked the output of test/test_parse_latlon.c a bit to show more digits (20) to inspect what the delta is, which results the following:

on amd64
-34.20575999999999794454 -3.76131499999999974193 != -34.20576 -3.76131
on i386
-34.20575999999999794454 -3.76131500000000018602 != -34.20576 -3.76131

It seems I can work around the issue by using

check_success "S034° 12.3456 W003° 45.6788" "-34.20576 -3.76131"

Discussion

  • Rob Norris

    Rob Norris - 2022-01-02

    Ah the joys of floating point representation!

    Thanks for raising this issue.
    Agreed, tweaking the input value is the best way to resolve this.

    I will upload a fix the source repository in due course.

     
  • Rob Norris

    Rob Norris - 2022-01-03
    • status: open --> pending-fixed
     

Log in to post a comment.