[PATCH] Added support for parsing temperature in the dive header

Linus Torvalds torvalds at linux-foundation.org
Wed Sep 10 19:08:54 PDT 2014


On Sep 10, 2014 7:00 PM, "Janice McLaughlin" <janice at moremobilesoftware.com>
wrote:
>
> First, my dc_tankinfo_t looks like this:
> typedef struct dc_tankinfo_t {
>     float helium;
>     float oxygen;
>     float nitrogen;
..

Ate these actually "float" from the dive computer?

Because we've seen bad problems with floating point values when dive log
software used it. Things like saving XML files that have crazy stuff with
exponents etc. Or values saved as 24.4999996 instead of 24.5 and things
like that.  I think I saw this particularly with jdivelog, but maybe I
misremember. It's one of the reasons that subsurface trends to try to keep
things as integers (ie integer mbar instead of a floating point bar)

Also, nitrogen seems very redundant.

    Linus
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://libdivecomputer.org/pipermail/devel/attachments/20140910/fe2993d6/attachment.html>


More information about the devel mailing list