From a845c6a04ecfeedc8eced5f4051e06ee88c59e90 Mon Sep 17 00:00:00 2001 From: Vivien Delmon Date: Wed, 21 Aug 2013 11:18:27 +0200 Subject: [PATCH] Remove C++11 call to isnormal - std::isnormal is not available under windows VS12. Implement it using numeric_limits functions --- tools/clitkImageUncertainty.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- 2.47.1