Subsurface ignores a temp of 0˚C

Henrik Brautaset Aronsen subsurface at
Wed Jan 23 12:37:51 PST 2013

Linus Torvalds wrote:
> On Wed, Jan 23, 2013 at 12:09 PM, Linus Torvalds
> <torvalds at>  wrote:
>>> - Negative temperature values doesn't seem to be displayed in the profile
>> Mind sending me your XML file, I'll take a look..
> Heh. They are displayed. But the rounding is wrong for them, so -1 is
> rounded to 0.
> We use "(int)(val+0.5)" which works fine for positive values, but for
> negative values integer truncation truncates towards zero. So -1+0.5
> is -0.5, and then truncates to 0.
> This should fix things, and prints things out more nicely anyway if
> you happen to have fractional degrees.

You're on a roll!  Just one last thing:  Dive 251 in the XML I sent you 
had 0˚C sample at 2:30mins, but the profile graph starts printing at 5˚C 
and 5:00mins.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the subsurface mailing list