#include "itkImageRegionConstIterator.h"
#include "itkImageRegionIterator.h"
-#include <limits>
+#include <cmath> // for isfinite
//====================================================================
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<double>::infinity() || uncert == -std::numeric_limits<double>::infinity()) uncert = 1.;
+ if (!std::isnormal(uncert)) uncert = 1.;
po.Set(uncert);
++pi;
++pii;