[gdal-dev] +/-infinity as an uninitialized marker
Mateusz Loskot
mateusz at loskot.net
Tue Mar 21 08:11:44 PDT 2017
On 21 March 2017 at 15:50, Kurt Schwehr <schwehr at gmail.com> wrote:
> 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(); }
Portability wank: it's also good idea to check for
std::numeric_limits<number<T> >::has_infinity
eg. something like
std::numeric_limits<number<double>::has_infinity
? std::numeric_limits<number<double>::infinity()
: (std::numeric_limits<number<double>::max)()
Best regards,
--
Mateusz Loskot, http://mateusz.loskot.net
More information about the gdal-dev
mailing list