#1314 use of abs() is unsafe on linux. Ends up with integer abs() fossibly due to a different default <math.h> include behaviour. Changed to fabs

This commit is contained in:
Jacob Støren 2017-03-14 19:11:45 +01:00
parent 4c8e1e2bcd
commit ef32c8bdc5

View File

@ -689,7 +689,7 @@ void RigAccWellFlowCalculator::sortTracers()
double totalFlow = 0.0;
if (mainBranchAccFlow.size()) totalFlow = - abs( mainBranchAccFlow.back() ); // Based on size in reverse order (biggest to least)
if (mainBranchAccFlow.size()) totalFlow = - fabs( mainBranchAccFlow.back() ); // Based on size in reverse order (biggest to least)
sortedTracers.insert({totalFlow, tracerName});
}
@ -722,7 +722,7 @@ void RigAccWellFlowCalculator::groupSmallContributions()
for ( const auto& tracerPair : totalTracerFractions )
{
if ( abs(tracerPair.second) <= m_smallContributionsThreshold
if ( fabs(tracerPair.second) <= m_smallContributionsThreshold
&& (hasConsistentWellFlow || tracerPair.first != RIG_RESERVOIR_TRACER_NAME) ) // Do not group the Reservoir tracer if the well flow is inconsistent, because cross flow is shown as the reservoir fraction
{
tracersToGroup.push_back(tracerPair.first);