Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Swap q(pow) -> std::pow
  • Loading branch information
nyalldawson committed Aug 24, 2017
1 parent 77c3be9 commit 031bf41
Show file tree
Hide file tree
Showing 50 changed files with 112 additions and 112 deletions.
2 changes: 1 addition & 1 deletion src/analysis/interpolation/CloughTocherInterpolator.cc
Expand Up @@ -64,7 +64,7 @@ double CloughTocherInterpolator::calcBernsteinPoly( int n, int i, int j, int k,
return 0;
}

double result = MathUtils::faculty( n ) * qPow( u, i ) * qPow( v, j ) * qPow( w, k ) / ( MathUtils::faculty( i ) * MathUtils::faculty( j ) * MathUtils::faculty( k ) );
double result = MathUtils::faculty( n ) * std::pow( u, i ) * std::pow( v, j ) * std::pow( w, k ) / ( MathUtils::faculty( i ) * MathUtils::faculty( j ) * MathUtils::faculty( k ) );
return result;
}

Expand Down
2 changes: 1 addition & 1 deletion src/analysis/interpolation/MathUtils.cc
Expand Up @@ -107,7 +107,7 @@ double MathUtils::calcBernsteinPoly( int n, int i, double t )
return 0;
}

return lower( n, i ) * qPow( t, i ) * qPow( ( 1 - t ), ( n - i ) );
return lower( n, i ) * std::pow( t, i ) * std::pow( ( 1 - t ), ( n - i ) );
}

double MathUtils::cFDerBernsteinPoly( int n, int i, double t )
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/interpolation/qgsidwinterpolator.cpp
Expand Up @@ -50,7 +50,7 @@ int QgsIDWInterpolator::interpolatePoint( double x, double y, double &result )
result = vertex_it.z;
return 0;
}
currentWeight = 1 / ( pow( distance, mDistanceCoefficient ) );
currentWeight = 1 / ( std::pow( distance, mDistanceCoefficient ) );
sumCounter += ( currentWeight * vertex_it.z );
sumDenominator += currentWeight;
}
Expand Down
22 changes: 11 additions & 11 deletions src/analysis/raster/qgskde.cpp
Expand Up @@ -181,7 +181,7 @@ QgsKernelDensityEstimation::Result QgsKernelDensityEstimation::addFeature( const
double pixelCentroidX = ( xPosition + xp + 0.5 ) * mPixelSize + mBounds.xMinimum();
double pixelCentroidY = ( yPosition + yp + 0.5 ) * mPixelSize + mBounds.yMinimum();

double distance = sqrt( pow( pixelCentroidX - ( *pointIt ).x(), 2.0 ) + pow( pixelCentroidY - ( *pointIt ).y(), 2.0 ) );
double distance = sqrt( std::pow( pixelCentroidX - ( *pointIt ).x(), 2.0 ) + std::pow( pixelCentroidY - ( *pointIt ).y(), 2.0 ) );

// is pixel outside search bandwidth of feature?
if ( distance > radius )
Expand Down Expand Up @@ -324,13 +324,13 @@ double QgsKernelDensityEstimation::quarticKernel( const double distance, const d
case OutputScaled:
{
// Normalizing constant
double k = 116. / ( 5. * M_PI * pow( bandwidth, 2 ) );
double k = 116. / ( 5. * M_PI * std::pow( bandwidth, 2 ) );

// Derived from Wand and Jones (1995), p. 175
return k * ( 15. / 16. ) * pow( 1. - pow( distance / bandwidth, 2 ), 2 );
return k * ( 15. / 16. ) * std::pow( 1. - std::pow( distance / bandwidth, 2 ), 2 );
}
case OutputRaw:
return pow( 1. - pow( distance / bandwidth, 2 ), 2 );
return pow( 1. - std::pow( distance / bandwidth, 2 ), 2 );
}
return 0.0; //no, seriously, I told you NO WARNINGS!
}
Expand All @@ -342,13 +342,13 @@ double QgsKernelDensityEstimation::triweightKernel( const double distance, const
case OutputScaled:
{
// Normalizing constant
double k = 128. / ( 35. * M_PI * pow( bandwidth, 2 ) );
double k = 128. / ( 35. * M_PI * std::pow( bandwidth, 2 ) );

// Derived from Wand and Jones (1995), p. 175
return k * ( 35. / 32. ) * pow( 1. - pow( distance / bandwidth, 2 ), 3 );
return k * ( 35. / 32. ) * std::pow( 1. - std::pow( distance / bandwidth, 2 ), 3 );
}
case OutputRaw:
return pow( 1. - pow( distance / bandwidth, 2 ), 3 );
return pow( 1. - std::pow( distance / bandwidth, 2 ), 3 );
}
return 0.0; // this is getting ridiculous... don't you ever listen to a word I say?
}
Expand All @@ -360,13 +360,13 @@ double QgsKernelDensityEstimation::epanechnikovKernel( const double distance, co
case OutputScaled:
{
// Normalizing constant
double k = 8. / ( 3. * M_PI * pow( bandwidth, 2 ) );
double k = 8. / ( 3. * M_PI * std::pow( bandwidth, 2 ) );

// Derived from Wand and Jones (1995), p. 175
return k * ( 3. / 4. ) * ( 1. - pow( distance / bandwidth, 2 ) );
return k * ( 3. / 4. ) * ( 1. - std::pow( distance / bandwidth, 2 ) );
}
case OutputRaw:
return ( 1. - pow( distance / bandwidth, 2 ) );
return ( 1. - std::pow( distance / bandwidth, 2 ) );
}

return 0.0; // la la la i'm not listening
Expand All @@ -383,7 +383,7 @@ double QgsKernelDensityEstimation::triangularKernel( const double distance, cons

if ( mDecay >= 0 )
{
double k = 3. / ( ( 1. + 2. * mDecay ) * M_PI * pow( bandwidth, 2 ) );
double k = 3. / ( ( 1. + 2. * mDecay ) * M_PI * std::pow( bandwidth, 2 ) );

// Derived from Wand and Jones (1995), p. 175 (with addition of decay parameter)
return k * ( 1. - ( 1. - mDecay ) * ( distance / bandwidth ) );
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/raster/qgsrastermatrix.cpp
Expand Up @@ -292,7 +292,7 @@ double QgsRasterMatrix::calculateTwoArgumentOp( TwoArgOperator op, double arg1,
}
else
{
return qPow( arg1, arg2 );
return pow( arg1, arg2 );
}
case opEQ:
return ( arg1 == arg2 ? 1.0 : 0.0 );
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/vector/qgszonalstatistics.cpp
Expand Up @@ -309,7 +309,7 @@ int QgsZonalStatistics::calculateStatistics( QgsFeedback *feedback )
double variance = sumSquared / featureStats.values.count();
if ( mStatistics & QgsZonalStatistics::StDev )
{
double stdev = qPow( variance, 0.5 );
double stdev = std::pow( variance, 0.5 );
changeAttributeMap.insert( stdevIndex, QVariant( stdev ) );
}
if ( mStatistics & QgsZonalStatistics::Variance )
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsdecorationgrid.cpp
Expand Up @@ -787,7 +787,7 @@ bool QgsDecorationGrid::getIntervalFromExtent( double *values, bool useXAxis )
if ( !qgsDoubleNear( interval, 0.0 ) )
{
double interval2 = 0;
int factor = pow( 10, floor( log10( interval ) ) );
int factor = std::pow( 10, floor( log10( interval ) ) );
if ( factor != 0 )
{
interval2 = std::round( interval / factor ) * factor;
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsdecorationscalebar.cpp
Expand Up @@ -163,7 +163,7 @@ void QgsDecorationScaleBar::render( const QgsMapSettings &mapSettings, QgsRender
// snap to integer < 10 times power of 10
if ( mSnapping )
{
double scaler = pow( 10.0, myPowerOf10 );
double scaler = std::pow( 10.0, myPowerOf10 );
myActualSize = std::round( myActualSize / scaler ) * scaler;
myScaleBarWidth = myActualSize / myMapUnitsPerPixelDouble;
}
Expand Down
2 changes: 1 addition & 1 deletion src/core/composer/qgscomposermapgrid.cpp
Expand Up @@ -1445,7 +1445,7 @@ QString QgsComposerMapGrid::gridAnnotationString( double value, QgsComposerMapGr
{
QString hemisphere;

double coordRounded = std::round( value * pow( 10.0, mGridAnnotationPrecision ) ) / pow( 10.0, mGridAnnotationPrecision );
double coordRounded = std::round( value * std::pow( 10.0, mGridAnnotationPrecision ) ) / std::pow( 10.0, mGridAnnotationPrecision );
if ( coord == QgsComposerMapGrid::Longitude )
{
//don't use E/W suffixes if ambiguous (e.g., 180 degrees)
Expand Down
2 changes: 1 addition & 1 deletion src/core/composer/qgscomposernodesitem.cpp
Expand Up @@ -50,7 +50,7 @@ QgsComposerNodesItem::QgsComposerNodesItem( const QString &tagName,
double QgsComposerNodesItem::computeDistance( QPointF pt1,
QPointF pt2 ) const
{
return sqrt( pow( pt1.x() - pt2.x(), 2 ) + pow( pt1.y() - pt2.y(), 2 ) );
return sqrt( std::pow( pt1.x() - pt2.x(), 2 ) + std::pow( pt1.y() - pt2.y(), 2 ) );
}

bool QgsComposerNodesItem::addNode( QPointF pt,
Expand Down
6 changes: 3 additions & 3 deletions src/core/composer/qgscomposerscalebar.cpp
Expand Up @@ -262,14 +262,14 @@ void QgsComposerScaleBar::refreshDataDefinedProperty( const QgsComposerObject::D
// nextNiceNumber(4573.23, d) = 5000 (d=1) -> 4600 (d=10) -> 4580 (d=100) -> 4574 (d=1000) -> etc
inline double nextNiceNumber( double a, double d = 1 )
{
double s = qPow( 10.0, floor( log10( a ) ) ) / d;
double s = std::pow( 10.0, floor( log10( a ) ) ) / d;
return ceil( a / s ) * s;
}

// prevNiceNumber(4573.23, d) = 4000 (d=1) -> 4500 (d=10) -> 4570 (d=100) -> 4573 (d=1000) -> etc
inline double prevNiceNumber( double a, double d = 1 )
{
double s = qPow( 10.0, floor( log10( a ) ) ) / d;
double s = std::pow( 10.0, floor( log10( a ) ) ) / d;
return floor( a / s ) * s;
}

Expand Down Expand Up @@ -474,7 +474,7 @@ void QgsComposerScaleBar::applyDefaultSize( QgsUnitTypes::DistanceUnit u )

double segmentWidth = initialUnitsPerSegment / upperMagnitudeMultiplier;
int segmentMagnitude = floor( log10( segmentWidth ) );
double unitsPerSegment = upperMagnitudeMultiplier * ( qPow( 10.0, segmentMagnitude ) );
double unitsPerSegment = upperMagnitudeMultiplier * ( std::pow( 10.0, segmentMagnitude ) );
double multiplier = floor( ( widthInSelectedUnits / ( unitsPerSegment * 10.0 ) ) / 2.5 ) * 2.5;

if ( multiplier > 0 )
Expand Down
2 changes: 1 addition & 1 deletion src/core/effects/qgsimageoperation.cpp
Expand Up @@ -290,7 +290,7 @@ void QgsImageOperation::HueSaturationPixelOperation::operator()( QRgb &rgb, cons
{
// Raising the saturation. Use a saturation curve to prevent
// clipping at maximum saturation with ugly results.
s = qMin( static_cast< int >( 255. * ( 1 - qPow( 1 - ( s / 255. ), qPow( mSaturation, 2 ) ) ) ), 255 );
s = qMin( static_cast< int >( 255. * ( 1 - std::pow( 1 - ( s / 255. ), std::pow( mSaturation, 2 ) ) ) ), 255 );
}

if ( mColorize )
Expand Down
2 changes: 1 addition & 1 deletion src/core/effects/qgsimageoperation.h
Expand Up @@ -375,7 +375,7 @@ class CORE_EXPORT QgsImageOperation
, mSpread( spread )
, mProperties( properties )
{
mSpreadSquared = qPow( mSpread, 2.0 );
mSpreadSquared = std::pow( mSpread, 2.0 );
}

void operator()( QRgb &rgb, const int x, const int y );
Expand Down
4 changes: 2 additions & 2 deletions src/core/expression/qgsexpressionfunction.cpp
Expand Up @@ -402,7 +402,7 @@ static QVariant fcnExpScale( const QVariantList &values, const QgsExpressionCont
}

// Return exponentially scaled value
return QVariant( ( ( rangeMax - rangeMin ) / pow( domainMax - domainMin, exponent ) ) * pow( val - domainMin, exponent ) + rangeMin );
return QVariant( ( ( rangeMax - rangeMin ) / std::pow( domainMax - domainMin, exponent ) ) * std::pow( val - domainMin, exponent ) + rangeMin );
}

static QVariant fcnMax( const QVariantList &values, const QgsExpressionContext *, QgsExpression *parent )
Expand Down Expand Up @@ -2883,7 +2883,7 @@ static QVariant fcnRound( const QVariantList &values, const QgsExpressionContext
if ( values.length() == 2 && values.at( 1 ).toInt() != 0 )
{
double number = QgsExpressionUtils::getDoubleValue( values.at( 0 ), parent );
double scaler = pow( 10.0, QgsExpressionUtils::getIntValue( values.at( 1 ), parent ) );
double scaler = std::pow( 10.0, QgsExpressionUtils::getIntValue( values.at( 1 ), parent ) );
return QVariant( std::round( number * scaler ) / scaler );
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/expression/qgsexpressionnodeimpl.cpp
Expand Up @@ -279,7 +279,7 @@ QVariant QgsExpressionNodeBinaryOperator::evalNode( QgsExpression *parent, const
ENSURE_NO_EVAL_ERROR;
double fR = QgsExpressionUtils::getDoubleValue( vR, parent );
ENSURE_NO_EVAL_ERROR;
return QVariant( pow( fL, fR ) );
return QVariant( std::pow( fL, fR ) );
}

case boAnd:
Expand Down
2 changes: 1 addition & 1 deletion src/core/geometry/qgsellipse.cpp
Expand Up @@ -64,7 +64,7 @@ QgsEllipse QgsEllipse::fromFoci( const QgsPoint &pt1, const QgsPoint &pt2, const
QgsPoint center = QgsGeometryUtils::midpoint( pt1, pt2 );

double axis_a = dist / 2.0;
double axis_b = sqrt( pow( axis_a, 2.0 ) - pow( dist_p1p2 / 2.0, 2.0 ) );
double axis_b = sqrt( std::pow( axis_a, 2.0 ) - std::pow( dist_p1p2 / 2.0, 2.0 ) );

return QgsEllipse( center, axis_a, axis_b, azimuth );
}
Expand Down
8 changes: 4 additions & 4 deletions src/core/geometry/qgsgeometryutils.cpp
Expand Up @@ -451,7 +451,7 @@ void QgsGeometryUtils::circleCenterRadius( const QgsPoint &pt1, const QgsPoint &
{
centerX = ( pt1.x() + pt2.x() ) / 2.0;
centerY = ( pt1.y() + pt2.y() ) / 2.0;
radius = sqrt( pow( centerX - pt1.x(), 2.0 ) + pow( centerY - pt1.y(), 2.0 ) );
radius = sqrt( std::pow( centerX - pt1.x(), 2.0 ) + std::pow( centerY - pt1.y(), 2.0 ) );
return;
}

Expand All @@ -461,8 +461,8 @@ void QgsGeometryUtils::circleCenterRadius( const QgsPoint &pt1, const QgsPoint &
dx31 = pt3.x() - pt1.x();
dy31 = pt3.y() - pt1.y();

h21 = pow( dx21, 2.0 ) + pow( dy21, 2.0 );
h31 = pow( dx31, 2.0 ) + pow( dy31, 2.0 );
h21 = std::pow( dx21, 2.0 ) + std::pow( dy21, 2.0 );
h31 = std::pow( dx31, 2.0 ) + std::pow( dy31, 2.0 );

// 2*Cross product, d<0 means clockwise and d>0 counterclockwise sweeping angle
d = 2 * ( dx21 * dy31 - dx31 * dy21 );
Expand All @@ -477,7 +477,7 @@ void QgsGeometryUtils::circleCenterRadius( const QgsPoint &pt1, const QgsPoint &
// Calculate centroid coordinates and radius
centerX = pt1.x() + ( h21 * dy31 - h31 * dy21 ) / d;
centerY = pt1.y() - ( h21 * dx31 - h31 * dx21 ) / d;
radius = sqrt( pow( centerX - pt1.x(), 2.0 ) + pow( centerY - pt1.y(), 2.0 ) );
radius = sqrt( std::pow( centerX - pt1.x(), 2.0 ) + std::pow( centerY - pt1.y(), 2.0 ) );
}

bool QgsGeometryUtils::circleClockwise( double angle1, double angle2, double angle3 )
Expand Down
4 changes: 2 additions & 2 deletions src/core/geometry/qgsgeos.cpp
Expand Up @@ -2635,7 +2635,7 @@ int QgsGeos::lineContainedInLine( const GEOSGeometry *line1, const GEOSGeometry
return -1;
}

double bufferDistance = pow( 10.0L, geomDigits( line2 ) - 11 );
double bufferDistance = std::pow( 10.0L, geomDigits( line2 ) - 11 );

GEOSGeometry *bufferGeom = GEOSBuffer_r( geosinit.ctxt, line2, bufferDistance, DEFAULT_QUADRANT_SEGMENTS );
if ( !bufferGeom )
Expand Down Expand Up @@ -2665,7 +2665,7 @@ int QgsGeos::pointContainedInLine( const GEOSGeometry *point, const GEOSGeometry
if ( !point || !line )
return -1;

double bufferDistance = pow( 10.0L, geomDigits( line ) - 11 );
double bufferDistance = std::pow( 10.0L, geomDigits( line ) - 11 );

GEOSGeometry *lineBuffer = GEOSBuffer_r( geosinit.ctxt, line, bufferDistance, 8 );
if ( !lineBuffer )
Expand Down
12 changes: 6 additions & 6 deletions src/core/geometry/qgslinestring.cpp
Expand Up @@ -679,8 +679,8 @@ void QgsLineString::extend( double startDistance, double endDistance )
// start of line
if ( startDistance > 0 )
{
double currentLen = sqrt( qPow( mX.at( 0 ) - mX.at( 1 ), 2 ) +
qPow( mY.at( 0 ) - mY.at( 1 ), 2 ) );
double currentLen = sqrt( std::pow( mX.at( 0 ) - mX.at( 1 ), 2 ) +
std::pow( mY.at( 0 ) - mY.at( 1 ), 2 ) );
double newLen = currentLen + startDistance;
mX[ 0 ] = mX.at( 1 ) + ( mX.at( 0 ) - mX.at( 1 ) ) / currentLen * newLen;
mY[ 0 ] = mY.at( 1 ) + ( mY.at( 0 ) - mY.at( 1 ) ) / currentLen * newLen;
Expand All @@ -689,8 +689,8 @@ void QgsLineString::extend( double startDistance, double endDistance )
if ( endDistance > 0 )
{
int last = mX.size() - 1;
double currentLen = sqrt( qPow( mX.at( last ) - mX.at( last - 1 ), 2 ) +
qPow( mY.at( last ) - mY.at( last - 1 ), 2 ) );
double currentLen = sqrt( std::pow( mX.at( last ) - mX.at( last - 1 ), 2 ) +
std::pow( mY.at( last ) - mY.at( last - 1 ), 2 ) );
double newLen = currentLen + endDistance;
mX[ last ] = mX.at( last - 1 ) + ( mX.at( last ) - mX.at( last - 1 ) ) / currentLen * newLen;
mY[ last ] = mY.at( last - 1 ) + ( mY.at( last ) - mY.at( last - 1 ) ) / currentLen * newLen;
Expand Down Expand Up @@ -916,8 +916,8 @@ QgsPoint QgsLineString::centroid() const
{
double currentX = mX.at( i );
double currentY = mY.at( i );
double segmentLength = sqrt( qPow( currentX - prevX, 2.0 ) +
qPow( currentY - prevY, 2.0 ) );
double segmentLength = sqrt( std::pow( currentX - prevX, 2.0 ) +
std::pow( currentY - prevY, 2.0 ) );
if ( qgsDoubleNear( segmentLength, 0.0 ) )
continue;

Expand Down
6 changes: 3 additions & 3 deletions src/core/pal/feature.cpp
Expand Up @@ -1161,7 +1161,7 @@ int FeaturePart::createCurvedCandidatesAlongLine( QList< LabelPosition * > &lPos
if ( i == 0 )
path_distances[i] = 0;
else
path_distances[i] = sqrt( pow( old_x - mapShape->x[i], 2 ) + pow( old_y - mapShape->y[i], 2 ) );
path_distances[i] = sqrt( std::pow( old_x - mapShape->x[i], 2 ) + std::pow( old_y - mapShape->y[i], 2 ) );
old_x = mapShape->x[i];
old_y = mapShape->y[i];

Expand Down Expand Up @@ -1808,13 +1808,13 @@ bool FeaturePart::nextCharPosition( double charWidth, double segment_length, Poi
dx = new_x - old_x;
dy = new_y - old_y;
}
while ( sqrt( pow( start_x - new_x, 2 ) + pow( start_y - new_y, 2 ) ) < charWidth ); // Distance from start_ to new_
while ( sqrt( std::pow( start_x - new_x, 2 ) + std::pow( start_y - new_y, 2 ) ) < charWidth ); // Distance from start_ to new_

// Calculate the position to place the end of the character on
GeomFunction::findLineCircleIntersection( start_x, start_y, charWidth, old_x, old_y, new_x, new_y, end_x, end_y );

// Need to calculate distance on the new segment
distance = sqrt( pow( old_x - end_x, 2 ) + pow( old_y - end_y, 2 ) );
distance = sqrt( std::pow( old_x - end_x, 2 ) + std::pow( old_y - end_y, 2 ) );
}
return true;
}
2 changes: 1 addition & 1 deletion src/core/pal/pal.cpp
Expand Up @@ -356,7 +356,7 @@ Problem *Pal::extract( double lambda_min, double phi_min, double lambda_max, dou
feat = fFeats->takeFirst();

prob->featStartId[i] = idlp;
prob->inactiveCost[i] = pow( 2, 10 - 10 * feat->priority );
prob->inactiveCost[i] = std::pow( 2, 10 - 10 * feat->priority );

switch ( feat->feature->getGeosType() )
{
Expand Down
2 changes: 1 addition & 1 deletion src/core/pal/rtree.hpp
Expand Up @@ -1180,7 +1180,7 @@ namespace pal
}
else
{
return static_cast< ELEMTYPEREAL >( pow( radius, NUMDIMS ) * m_unitSphereVolume );
return static_cast< ELEMTYPEREAL >( std::pow( radius, NUMDIMS ) * m_unitSphereVolume );
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/core/qgis.h
Expand Up @@ -236,7 +236,7 @@ inline bool qgsDoubleNearSig( double a, double b, int significantDigits = 10 )
double br = frexp( b, &bexp );

return aexp == bexp &&
std::round( ar * pow( 10.0, significantDigits ) ) == std::round( br * pow( 10.0, significantDigits ) );
std::round( ar * std::pow( 10.0, significantDigits ) ) == std::round( br * std::pow( 10.0, significantDigits ) );
}

/**
Expand All @@ -246,7 +246,7 @@ inline bool qgsDoubleNearSig( double a, double b, int significantDigits = 10 )
*/
inline double qgsRound( double number, double places )
{
int scaleFactor = pow( 10, places );
int scaleFactor = std::pow( 10, places );
return static_cast<double>( static_cast<qlonglong>( number * scaleFactor + 0.5 ) ) / scaleFactor;
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/qgscoordinatetransform.cpp
Expand Up @@ -352,7 +352,7 @@ QgsRectangle QgsCoordinateTransform::transformBoundingBox( const QgsRectangle &r
// even with 1000 points it takes < 1ms
// TODO: how to effectively and precisely reproject bounding box?
const int nPoints = 1000;
double d = sqrt( ( rect.width() * rect.height() ) / pow( sqrt( static_cast< double >( nPoints ) ) - 1, 2.0 ) );
double d = sqrt( ( rect.width() * rect.height() ) / std::pow( sqrt( static_cast< double >( nPoints ) ) - 1, 2.0 ) );
int nXPoints = static_cast< int >( ceil( rect.width() / d ) ) + 1;
int nYPoints = static_cast< int >( ceil( rect.height() / d ) ) + 1;

Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsfield.cpp
Expand Up @@ -268,7 +268,7 @@ bool QgsField::convertCompatible( QVariant &v ) const

if ( d->type == QVariant::Double && d->precision > 0 )
{
double s = qPow( 10, d->precision );
double s = std::pow( 10, d->precision );
double d = v.toDouble() * s;
v = QVariant( ( d < 0 ? ceil( d - 0.5 ) : floor( d + 0.5 ) ) / s );
return true;
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgshistogram.cpp
Expand Up @@ -65,7 +65,7 @@ bool QgsHistogram::setValues( const QgsVectorLayer *layer, const QString &fieldO
double QgsHistogram::optimalBinWidth() const
{
//Freedman-Diaconis rule
return 2.0 * mIQR * qPow( mValues.count(), -1 / 3.0 );
return 2.0 * mIQR * std::pow( mValues.count(), -1 / 3.0 );
}

int QgsHistogram::optimalNumberBins() const
Expand Down

0 comments on commit 031bf41

Please sign in to comment.