From: Vivien Delmon Date: Wed, 21 Aug 2013 09:32:52 +0000 (+0200) Subject: Revert "Remove C++11 call to isnormal" X-Git-Tag: v1.4.0~164^2~1 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=commitdiff_plain;h=9bc52b33697bccb43fb6580812c0aaa7adae52b5;p=clitk.git Revert "Remove C++11 call to isnormal" This reverts commit a845c6a04ecfeedc8eced5f4051e06ee88c59e90. --- 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;