mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3748 Statistics calculator : Add helper functions for (in)valid numbers
This commit is contained in:
parent
5e7ebcd0f6
commit
f9a6957fae
@ -21,8 +21,8 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QByteArray>
|
|
||||||
#include <string>
|
#include <cmath>
|
||||||
|
|
||||||
//==================================================================================================
|
//==================================================================================================
|
||||||
//
|
//
|
||||||
@ -33,4 +33,19 @@ class RiaStatisticsTools
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static const QString replacePercentileByPValueText(const QString& percentile);
|
static const QString replacePercentileByPValueText(const QString& percentile);
|
||||||
|
|
||||||
|
|
||||||
|
template<class NumberType> static bool isInvalidNumber(NumberType value)
|
||||||
|
{
|
||||||
|
return !isValidNumber<NumberType>(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<class NumberType> static bool isValidNumber(NumberType value)
|
||||||
|
{
|
||||||
|
if (std::isinf(value)) return false;
|
||||||
|
if (std::isnan(value)) return false;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user