[gdal-dev] +/-infinity as an uninitialized marker

Kurt Schwehr schwehr at gmail.com
Tue Mar 21 07:50:34 PDT 2017


Hey Even,

Probably not a big deal, but I'm curious why you didn't use !isinf(MinX) or
isfinite(MinX) for your recent OGREnvelope patch:

int  IsInit() const { return MinX !=
std::numeric_limits<double>::infinity(); }

My only thought is that if something goes totally messy and it uses !isinf
or isfinite, the code might retry initialization later when it's not going
to get any better (if MinX ends up -inf or one of the NaNs)?  I'm pretty
sure that infinity is always well behaved (unlike the crazy world of NaNs),
so I can't see a case where your code would go wrong.

As procrastination, I posted this overly wordy question on stack overflow
as I didn't find a good match with 10 seconds of searching...

http://stackoverflow.com/questions/42930445/val-stdnumeric-limitsdoubleinfinity-or-isinfval-or-isfiniteval

-kurt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20170321/2e7c85c5/attachment.html>


More information about the gdal-dev mailing list