Infobox math broken in current master
dirk at hohndel.org
Tue Jan 21 09:13:00 UTC 2014
On Mon, 2014-01-20 at 11:28 +0100, Robert Helling wrote:
> On 20.01.2014, at 10:29, Robert Helling <helling at lmu.de> wrote:
> > But probably more important: The freezing of the info box and the crash go away once I comment out line 178 of diveprofileitem.cpp as
> looked deeper into this. Turned out this was caused has my last dive has only a single temperature reading leading to an temperature plot of height zero which caused some geometry calculation to divide by zero. Here is a fix.
> I hope that isnan() is available everywhere (the web wasn’t really sure about it). Of course the real issue is size==0.0 but how do I reliably test a float for zeroness, i.e. that I get NaN when I divide by it?
I don't like this patch. It's much better to test min == max.
Also, please include a test dive that shows the problem prior to adding
the patch (and that works fine after applying the patch).
More information about the subsurface