mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5905 Fix wrong percentile calculation
* We sent in percent values (0-100) instead of the fractional values (0 - 1) that RigHistogramCalculator::calculatePercentile required. * It has been like this for years AFAICT.
This commit is contained in:
committed by
Magne Sjaastad
parent
c238a0ac30
commit
ab9ba69391
@@ -317,9 +317,10 @@ double RigHistogramCalculator::calculatePercentil( double pVal )
|
||||
{
|
||||
assert( m_histogram );
|
||||
assert( m_histogram->size() );
|
||||
assert( 0.0 <= pVal && pVal <= 1.0 );
|
||||
auto pValClamped = cvf::Math::clamp( pVal, 0.0, 1.0 );
|
||||
assert( 0.0 <= pValClamped && pValClamped <= 1.0 );
|
||||
|
||||
double pValObservationCount = pVal * m_observationCount;
|
||||
double pValObservationCount = pValClamped * m_observationCount;
|
||||
if ( pValObservationCount == 0.0 ) return m_min;
|
||||
|
||||
size_t accObsCount = 0;
|
||||
|
||||
Reference in New Issue
Block a user