From: Vivien Delmon Date: Wed, 21 Aug 2013 09:18:27 +0000 (+0200) Subject: Remove C++11 call to isnormal X-Git-Tag: v1.4.0~164^2~2 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=a845c6a04ecfeedc8eced5f4051e06ee88c59e90;p=clitk.git Remove C++11 call to isnormal - std::isnormal is not available under windows VS12. Implement it using numeric_limits functions --- diff --git a/tools/clitkImageUncertainty.cxx b/tools/clitkImageUncertainty.cxx index bf5759f..9240bd8 100644 --- a/tools/clitkImageUncertainty.cxx +++ b/tools/clitkImageUncertainty.cxx @@ -39,7 +39,7 @@ #include "itkImageRegionConstIterator.h" #include "itkImageRegionIterator.h" -#include // for isfinite +#include //==================================================================== int main(int argc, char * argv[]) { @@ -79,7 +79,7 @@ int main(int argc, char * argv[]) { double squared = pii.Get(); double mean = pi.Get(); double uncert = sqrt((NumberOfEvents*squared - mean*mean) / ((NumberOfEvents-1)*(mean*mean))); - if (!std::isnormal(uncert)) uncert = 1.; + if (uncert != uncert || uncert == std::numeric_limits::infinity() || uncert == -std::numeric_limits::infinity()) uncert = 1.; po.Set(uncert); ++pi; ++pii;