Legend: Fixed legend numbers being completely wrong.

The abs() function is only integer on linux RH5.
Caused legend numbers to be truncated (0 typically)
This commit is contained in:
Ceetron
2013-09-27 14:43:11 +02:00
parent 571c4f85c0
commit 26d5a7c5b0
2 changed files with 7 additions and 6 deletions

View File

@@ -20,6 +20,7 @@
#include <algorithm>
#include <assert.h>
#include <math.h>
#include "cvfMath.h"
//--------------------------------------------------------------------------------------------------
/// A function to do basic statistical calculations
@@ -103,7 +104,7 @@ std::vector<double> RigStatisticsMath::calculateNearestRankPercentiles(const std
{
double pVal = HUGE_VAL;
size_t pValIndex = static_cast<size_t>(sortedValues.size() * fabs(pValPositions[i]) / 100);
size_t pValIndex = static_cast<size_t>(sortedValues.size() * cvf::Math::abs(pValPositions[i]) / 100);
if (pValIndex >= sortedValues.size() ) pValIndex = sortedValues.size() - 1;
@@ -142,7 +143,7 @@ std::vector<double> RigStatisticsMath::calculateInterpolatedPercentiles(const st
{
double pVal = HUGE_VAL;
double doubleIndex = (sortedValues.size() - 1) * fabs(pValPositions[i]) / 100.0;
double doubleIndex = (sortedValues.size() - 1) * cvf::Math::abs(pValPositions[i]) / 100.0;
size_t lowerValueIndex = static_cast<size_t>(floor(doubleIndex));
size_t upperValueIndex = lowerValueIndex + 1;