I've had a look at the build problems for gpsbabel. It builds fine on
i386, but "make check" fails on many other architectures. A typical
failure is this:

/usr/bin/make check
make[1]: Entering directory `/build/buildd/gpsbabel-1.2.4'
./testo
51c51
< B0421143040679S15036423EA0000000000
---
> B0421143040678S15036423EA0000000000
ERROR comparing /tmp/gpsbabel.21922/igc_sed.out reference/igc1_igc.out

Note that there is a single character difference, the digit before the
S in the middle is either a 9 or an 8. That string is produced by
igc.c, function latlon2str. Isolating the problematic input case I have
produced the following test program:

#include <stdio.h>
#include <math.h>
int main(void)
{
        double x = -30.677975;
        unsigned char c = fabs(x);

        printf("x = %.15f\n", x);
        printf("fabs(x) = %.15f\n", fabs(x));
        printf("c = %u\n", c);
        printf("fabs(x) - c = %.15f\n", fabs(x) - c);
        printf("(fabs(x) - c) * 60000 = %.15f\n", (fabs(x) - c) * 60000);
        printf("(fabs(x) - c) * 60000 + 0.5 = %.15f\n",
                (fabs(x) - c) * 60000 + 0.5);
        printf("(unsigned) ((fabs(x) - c) * 60000 + 0.5) = %u\n",
                (unsigned) ((fabs(x) - c) * 60000 + 0.5));

        return 0;
}

This gives different results on i386 (my laptop) and hppa (paer.debian.org,
unstable chroot). Here is the output on hppa:

x = -30.677975000000000
fabs(x) = 30.677975000000000
c = 30
fabs(x) - c = 0.677975000000000
(fabs(x) - c) * 60000 = 40678.500000000000000
(fabs(x) - c) * 60000 + 0.5 = 40679.000000000000000
(unsigned) ((fabs(x) - c) * 60000 + 0.5) = 40679

The output on i386 is identical except for the last line, which prints out
40678 as the result. I do not understand why it does that.

I suspect the other errors are also due to similar problems. Perhaps
someone who understands floating point semantics and their differences
between platforms could take a look?




-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to