From 9bc52b33697bccb43fb6580812c0aaa7adae52b5 Mon Sep 17 00:00:00 2001 From: Vivien Delmon Date: Wed, 21 Aug 2013 11:32:52 +0200 Subject: [PATCH] Revert "Remove C++11 call to isnormal" This reverts commit a845c6a04ecfeedc8eced5f4051e06ee88c59e90. --- tools/clitkImageUncertainty.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/clitkImageUncertainty.cxx b/tools/clitkImageUncertainty.cxx index 9240bd8..bf5759f 100644 --- a/tools/clitkImageUncertainty.cxx +++ b/tools/clitkImageUncertainty.cxx @@ -39,7 +39,7 @@ #include "itkImageRegionConstIterator.h" #include "itkImageRegionIterator.h" -#include +#include // for isfinite //==================================================================== 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 (uncert != uncert || uncert == std::numeric_limits::infinity() || uncert == -std::numeric_limits::infinity()) uncert = 1.; + if (!std::isnormal(uncert)) uncert = 1.; po.Set(uncert); ++pi; ++pii; -- 2.47.1