RE: Gpsbabel-code digest, Vol 1 #401 - 7 msgs

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

RE: Gpsbabel-code digest, Vol 1 #401 - 7 msgs

Etasse
RJL> We do still see some testsuite failures with this.   Sometimes
it's
RJL> heading and sometimes it's speed, but the numbers do have just a
RJL> RJL> bit of jitter to them:
RJL>  
RJL> <   <cmt>Spd=0.3 Hdg=128 DoP=1.6 Flg=200705</cmt>
RJL> <   <desc>Spd=0.3 Hdg=128 DoP=1.6 Flg=200705</desc>
RJL> ---
RJL> >   <cmt>Spd=0.3 Hdg=129 DoP=1.6 Flg=200705</cmt>
RJL> >   <desc>Spd=0.3 Hdg=129 DoP=1.6 Flg=200705</desc>

Cursed be floating points. How can the SAME value be fprint-ed
differently depending on compiler/OS?!!?  I guess I'll have to apply
rounding to everything then.  

I'm beginning to understand Ling's FP frustrations...







       

       
               
__________________________________________________________
Lèche-vitrine ou lèche-écran ?
magasinage.yahoo.ca


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Gpsbabel-code mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gpsbabel-code
Reply | Threaded
Open this post in threaded view
|

Re: RE: Gpsbabel-code digest, Vol 1 #401 - 7 msgs

Robert Lipe
Etasse wrote:

> RJL> We do still see some testsuite failures with this.   Sometimes
> it's
> RJL> heading and sometimes it's speed, but the numbers do have just a
> RJL> RJL> bit of jitter to them:
> RJL>  
> RJL> <   <cmt>Spd=0.3 Hdg=128 DoP=1.6 Flg=200705</cmt>
> RJL> <   <desc>Spd=0.3 Hdg=128 DoP=1.6 Flg=200705</desc>
> RJL> ---
> RJL> >   <cmt>Spd=0.3 Hdg=129 DoP=1.6 Flg=200705</cmt>
> RJL> >   <desc>Spd=0.3 Hdg=129 DoP=1.6 Flg=200705</desc>
>
> Cursed be floating points. How can the SAME value be fprint-ed
> differently depending on compiler/OS?!!?  I guess I'll have to apply
> rounding to everything then.  

The IEEE floating point unit in most modern computers can be set for
one of four different rounding modes: round to (nearest, zero, positive
infinity, negative infinity).  I don't think you ever really know which
is the default in any given OS/compiler/libc combination.  Since we
aren't doing any actual floating point ops (other than assignment) to
them, I don't know if that factors in.

I'm actually impressed that we get away with as much as we do in
GPSBabel.  We read floats and doubles written by 68K, Mcore, Power, x86,
Alpha, and such - many with different word size and endianness rules -
and actually come out alive in most cases.

Do you really want those fields in the names? :-)

> I'm beginning to understand Ling's FP frustrations...

Yeah, it's all kinda icky.

http://www.lahey.com/float.htm is a good introductory article to many of
the problems we've discussed here.  The code examples are Fortran, but
they're quite readable.   There are many such articles around.

I'll confess that I don't have a great grasp on the vagaries of FP.

--
Support GPSBabel by helping to improve it or fund those that that have
done so.  Visit:

        http://sourceforge.net/donate/index.php?group_id=58972


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Gpsbabel-code mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gpsbabel-code