Skip to content

Commit 031bf41

Browse files
committed
Swap q(pow) -> std::pow
1 parent 77c3be9 commit 031bf41

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+112
-112
lines changed

src/analysis/interpolation/CloughTocherInterpolator.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ double CloughTocherInterpolator::calcBernsteinPoly( int n, int i, int j, int k,
6464
return 0;
6565
}
6666

67-
double result = MathUtils::faculty( n ) * qPow( u, i ) * qPow( v, j ) * qPow( w, k ) / ( MathUtils::faculty( i ) * MathUtils::faculty( j ) * MathUtils::faculty( k ) );
67+
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 ) );
6868
return result;
6969
}
7070

src/analysis/interpolation/MathUtils.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ double MathUtils::calcBernsteinPoly( int n, int i, double t )
107107
return 0;
108108
}
109109

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

113113
double MathUtils::cFDerBernsteinPoly( int n, int i, double t )

src/analysis/interpolation/qgsidwinterpolator.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ int QgsIDWInterpolator::interpolatePoint( double x, double y, double &result )
5050
result = vertex_it.z;
5151
return 0;
5252
}
53-
currentWeight = 1 / ( pow( distance, mDistanceCoefficient ) );
53+
currentWeight = 1 / ( std::pow( distance, mDistanceCoefficient ) );
5454
sumCounter += ( currentWeight * vertex_it.z );
5555
sumDenominator += currentWeight;
5656
}

src/analysis/raster/qgskde.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ QgsKernelDensityEstimation::Result QgsKernelDensityEstimation::addFeature( const
181181
double pixelCentroidX = ( xPosition + xp + 0.5 ) * mPixelSize + mBounds.xMinimum();
182182
double pixelCentroidY = ( yPosition + yp + 0.5 ) * mPixelSize + mBounds.yMinimum();
183183

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

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

329329
// Derived from Wand and Jones (1995), p. 175
330-
return k * ( 15. / 16. ) * pow( 1. - pow( distance / bandwidth, 2 ), 2 );
330+
return k * ( 15. / 16. ) * std::pow( 1. - std::pow( distance / bandwidth, 2 ), 2 );
331331
}
332332
case OutputRaw:
333-
return pow( 1. - pow( distance / bandwidth, 2 ), 2 );
333+
return pow( 1. - std::pow( distance / bandwidth, 2 ), 2 );
334334
}
335335
return 0.0; //no, seriously, I told you NO WARNINGS!
336336
}
@@ -342,13 +342,13 @@ double QgsKernelDensityEstimation::triweightKernel( const double distance, const
342342
case OutputScaled:
343343
{
344344
// Normalizing constant
345-
double k = 128. / ( 35. * M_PI * pow( bandwidth, 2 ) );
345+
double k = 128. / ( 35. * M_PI * std::pow( bandwidth, 2 ) );
346346

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

365365
// Derived from Wand and Jones (1995), p. 175
366-
return k * ( 3. / 4. ) * ( 1. - pow( distance / bandwidth, 2 ) );
366+
return k * ( 3. / 4. ) * ( 1. - std::pow( distance / bandwidth, 2 ) );
367367
}
368368
case OutputRaw:
369-
return ( 1. - pow( distance / bandwidth, 2 ) );
369+
return ( 1. - std::pow( distance / bandwidth, 2 ) );
370370
}
371371

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

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

388388
// Derived from Wand and Jones (1995), p. 175 (with addition of decay parameter)
389389
return k * ( 1. - ( 1. - mDecay ) * ( distance / bandwidth ) );

src/analysis/raster/qgsrastermatrix.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ double QgsRasterMatrix::calculateTwoArgumentOp( TwoArgOperator op, double arg1,
292292
}
293293
else
294294
{
295-
return qPow( arg1, arg2 );
295+
return pow( arg1, arg2 );
296296
}
297297
case opEQ:
298298
return ( arg1 == arg2 ? 1.0 : 0.0 );

src/analysis/vector/qgszonalstatistics.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ int QgsZonalStatistics::calculateStatistics( QgsFeedback *feedback )
309309
double variance = sumSquared / featureStats.values.count();
310310
if ( mStatistics & QgsZonalStatistics::StDev )
311311
{
312-
double stdev = qPow( variance, 0.5 );
312+
double stdev = std::pow( variance, 0.5 );
313313
changeAttributeMap.insert( stdevIndex, QVariant( stdev ) );
314314
}
315315
if ( mStatistics & QgsZonalStatistics::Variance )

src/app/qgsdecorationgrid.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,7 @@ bool QgsDecorationGrid::getIntervalFromExtent( double *values, bool useXAxis )
787787
if ( !qgsDoubleNear( interval, 0.0 ) )
788788
{
789789
double interval2 = 0;
790-
int factor = pow( 10, floor( log10( interval ) ) );
790+
int factor = std::pow( 10, floor( log10( interval ) ) );
791791
if ( factor != 0 )
792792
{
793793
interval2 = std::round( interval / factor ) * factor;

src/app/qgsdecorationscalebar.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ void QgsDecorationScaleBar::render( const QgsMapSettings &mapSettings, QgsRender
163163
// snap to integer < 10 times power of 10
164164
if ( mSnapping )
165165
{
166-
double scaler = pow( 10.0, myPowerOf10 );
166+
double scaler = std::pow( 10.0, myPowerOf10 );
167167
myActualSize = std::round( myActualSize / scaler ) * scaler;
168168
myScaleBarWidth = myActualSize / myMapUnitsPerPixelDouble;
169169
}

src/core/composer/qgscomposermapgrid.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1445,7 +1445,7 @@ QString QgsComposerMapGrid::gridAnnotationString( double value, QgsComposerMapGr
14451445
{
14461446
QString hemisphere;
14471447

1448-
double coordRounded = std::round( value * pow( 10.0, mGridAnnotationPrecision ) ) / pow( 10.0, mGridAnnotationPrecision );
1448+
double coordRounded = std::round( value * std::pow( 10.0, mGridAnnotationPrecision ) ) / std::pow( 10.0, mGridAnnotationPrecision );
14491449
if ( coord == QgsComposerMapGrid::Longitude )
14501450
{
14511451
//don't use E/W suffixes if ambiguous (e.g., 180 degrees)

src/core/composer/qgscomposernodesitem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ QgsComposerNodesItem::QgsComposerNodesItem( const QString &tagName,
5050
double QgsComposerNodesItem::computeDistance( QPointF pt1,
5151
QPointF pt2 ) const
5252
{
53-
return sqrt( pow( pt1.x() - pt2.x(), 2 ) + pow( pt1.y() - pt2.y(), 2 ) );
53+
return sqrt( std::pow( pt1.x() - pt2.x(), 2 ) + std::pow( pt1.y() - pt2.y(), 2 ) );
5454
}
5555

5656
bool QgsComposerNodesItem::addNode( QPointF pt,

src/core/composer/qgscomposerscalebar.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,14 +262,14 @@ void QgsComposerScaleBar::refreshDataDefinedProperty( const QgsComposerObject::D
262262
// nextNiceNumber(4573.23, d) = 5000 (d=1) -> 4600 (d=10) -> 4580 (d=100) -> 4574 (d=1000) -> etc
263263
inline double nextNiceNumber( double a, double d = 1 )
264264
{
265-
double s = qPow( 10.0, floor( log10( a ) ) ) / d;
265+
double s = std::pow( 10.0, floor( log10( a ) ) ) / d;
266266
return ceil( a / s ) * s;
267267
}
268268

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

@@ -474,7 +474,7 @@ void QgsComposerScaleBar::applyDefaultSize( QgsUnitTypes::DistanceUnit u )
474474

475475
double segmentWidth = initialUnitsPerSegment / upperMagnitudeMultiplier;
476476
int segmentMagnitude = floor( log10( segmentWidth ) );
477-
double unitsPerSegment = upperMagnitudeMultiplier * ( qPow( 10.0, segmentMagnitude ) );
477+
double unitsPerSegment = upperMagnitudeMultiplier * ( std::pow( 10.0, segmentMagnitude ) );
478478
double multiplier = floor( ( widthInSelectedUnits / ( unitsPerSegment * 10.0 ) ) / 2.5 ) * 2.5;
479479

480480
if ( multiplier > 0 )

src/core/effects/qgsimageoperation.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ void QgsImageOperation::HueSaturationPixelOperation::operator()( QRgb &rgb, cons
290290
{
291291
// Raising the saturation. Use a saturation curve to prevent
292292
// clipping at maximum saturation with ugly results.
293-
s = qMin( static_cast< int >( 255. * ( 1 - qPow( 1 - ( s / 255. ), qPow( mSaturation, 2 ) ) ) ), 255 );
293+
s = qMin( static_cast< int >( 255. * ( 1 - std::pow( 1 - ( s / 255. ), std::pow( mSaturation, 2 ) ) ) ), 255 );
294294
}
295295

296296
if ( mColorize )

src/core/effects/qgsimageoperation.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ class CORE_EXPORT QgsImageOperation
375375
, mSpread( spread )
376376
, mProperties( properties )
377377
{
378-
mSpreadSquared = qPow( mSpread, 2.0 );
378+
mSpreadSquared = std::pow( mSpread, 2.0 );
379379
}
380380

381381
void operator()( QRgb &rgb, const int x, const int y );

src/core/expression/qgsexpressionfunction.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ static QVariant fcnExpScale( const QVariantList &values, const QgsExpressionCont
402402
}
403403

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

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

src/core/expression/qgsexpressionnodeimpl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ QVariant QgsExpressionNodeBinaryOperator::evalNode( QgsExpression *parent, const
279279
ENSURE_NO_EVAL_ERROR;
280280
double fR = QgsExpressionUtils::getDoubleValue( vR, parent );
281281
ENSURE_NO_EVAL_ERROR;
282-
return QVariant( pow( fL, fR ) );
282+
return QVariant( std::pow( fL, fR ) );
283283
}
284284

285285
case boAnd:

src/core/geometry/qgsellipse.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ QgsEllipse QgsEllipse::fromFoci( const QgsPoint &pt1, const QgsPoint &pt2, const
6464
QgsPoint center = QgsGeometryUtils::midpoint( pt1, pt2 );
6565

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

6969
return QgsEllipse( center, axis_a, axis_b, azimuth );
7070
}

src/core/geometry/qgsgeometryutils.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ void QgsGeometryUtils::circleCenterRadius( const QgsPoint &pt1, const QgsPoint &
451451
{
452452
centerX = ( pt1.x() + pt2.x() ) / 2.0;
453453
centerY = ( pt1.y() + pt2.y() ) / 2.0;
454-
radius = sqrt( pow( centerX - pt1.x(), 2.0 ) + pow( centerY - pt1.y(), 2.0 ) );
454+
radius = sqrt( std::pow( centerX - pt1.x(), 2.0 ) + std::pow( centerY - pt1.y(), 2.0 ) );
455455
return;
456456
}
457457

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

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

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

483483
bool QgsGeometryUtils::circleClockwise( double angle1, double angle2, double angle3 )

src/core/geometry/qgsgeos.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2635,7 +2635,7 @@ int QgsGeos::lineContainedInLine( const GEOSGeometry *line1, const GEOSGeometry
26352635
return -1;
26362636
}
26372637

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

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

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

26702670
GEOSGeometry *lineBuffer = GEOSBuffer_r( geosinit.ctxt, line, bufferDistance, 8 );
26712671
if ( !lineBuffer )

src/core/geometry/qgslinestring.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -679,8 +679,8 @@ void QgsLineString::extend( double startDistance, double endDistance )
679679
// start of line
680680
if ( startDistance > 0 )
681681
{
682-
double currentLen = sqrt( qPow( mX.at( 0 ) - mX.at( 1 ), 2 ) +
683-
qPow( mY.at( 0 ) - mY.at( 1 ), 2 ) );
682+
double currentLen = sqrt( std::pow( mX.at( 0 ) - mX.at( 1 ), 2 ) +
683+
std::pow( mY.at( 0 ) - mY.at( 1 ), 2 ) );
684684
double newLen = currentLen + startDistance;
685685
mX[ 0 ] = mX.at( 1 ) + ( mX.at( 0 ) - mX.at( 1 ) ) / currentLen * newLen;
686686
mY[ 0 ] = mY.at( 1 ) + ( mY.at( 0 ) - mY.at( 1 ) ) / currentLen * newLen;
@@ -689,8 +689,8 @@ void QgsLineString::extend( double startDistance, double endDistance )
689689
if ( endDistance > 0 )
690690
{
691691
int last = mX.size() - 1;
692-
double currentLen = sqrt( qPow( mX.at( last ) - mX.at( last - 1 ), 2 ) +
693-
qPow( mY.at( last ) - mY.at( last - 1 ), 2 ) );
692+
double currentLen = sqrt( std::pow( mX.at( last ) - mX.at( last - 1 ), 2 ) +
693+
std::pow( mY.at( last ) - mY.at( last - 1 ), 2 ) );
694694
double newLen = currentLen + endDistance;
695695
mX[ last ] = mX.at( last - 1 ) + ( mX.at( last ) - mX.at( last - 1 ) ) / currentLen * newLen;
696696
mY[ last ] = mY.at( last - 1 ) + ( mY.at( last ) - mY.at( last - 1 ) ) / currentLen * newLen;
@@ -916,8 +916,8 @@ QgsPoint QgsLineString::centroid() const
916916
{
917917
double currentX = mX.at( i );
918918
double currentY = mY.at( i );
919-
double segmentLength = sqrt( qPow( currentX - prevX, 2.0 ) +
920-
qPow( currentY - prevY, 2.0 ) );
919+
double segmentLength = sqrt( std::pow( currentX - prevX, 2.0 ) +
920+
std::pow( currentY - prevY, 2.0 ) );
921921
if ( qgsDoubleNear( segmentLength, 0.0 ) )
922922
continue;
923923

src/core/pal/feature.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,7 +1161,7 @@ int FeaturePart::createCurvedCandidatesAlongLine( QList< LabelPosition * > &lPos
11611161
if ( i == 0 )
11621162
path_distances[i] = 0;
11631163
else
1164-
path_distances[i] = sqrt( pow( old_x - mapShape->x[i], 2 ) + pow( old_y - mapShape->y[i], 2 ) );
1164+
path_distances[i] = sqrt( std::pow( old_x - mapShape->x[i], 2 ) + std::pow( old_y - mapShape->y[i], 2 ) );
11651165
old_x = mapShape->x[i];
11661166
old_y = mapShape->y[i];
11671167

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

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

18161816
// Need to calculate distance on the new segment
1817-
distance = sqrt( pow( old_x - end_x, 2 ) + pow( old_y - end_y, 2 ) );
1817+
distance = sqrt( std::pow( old_x - end_x, 2 ) + std::pow( old_y - end_y, 2 ) );
18181818
}
18191819
return true;
18201820
}

src/core/pal/pal.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ Problem *Pal::extract( double lambda_min, double phi_min, double lambda_max, dou
356356
feat = fFeats->takeFirst();
357357

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

361361
switch ( feat->feature->getGeosType() )
362362
{

src/core/pal/rtree.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1180,7 +1180,7 @@ namespace pal
11801180
}
11811181
else
11821182
{
1183-
return static_cast< ELEMTYPEREAL >( pow( radius, NUMDIMS ) * m_unitSphereVolume );
1183+
return static_cast< ELEMTYPEREAL >( std::pow( radius, NUMDIMS ) * m_unitSphereVolume );
11841184
}
11851185
}
11861186

src/core/qgis.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ inline bool qgsDoubleNearSig( double a, double b, int significantDigits = 10 )
236236
double br = frexp( b, &bexp );
237237

238238
return aexp == bexp &&
239-
std::round( ar * pow( 10.0, significantDigits ) ) == std::round( br * pow( 10.0, significantDigits ) );
239+
std::round( ar * std::pow( 10.0, significantDigits ) ) == std::round( br * std::pow( 10.0, significantDigits ) );
240240
}
241241

242242
/**
@@ -246,7 +246,7 @@ inline bool qgsDoubleNearSig( double a, double b, int significantDigits = 10 )
246246
*/
247247
inline double qgsRound( double number, double places )
248248
{
249-
int scaleFactor = pow( 10, places );
249+
int scaleFactor = std::pow( 10, places );
250250
return static_cast<double>( static_cast<qlonglong>( number * scaleFactor + 0.5 ) ) / scaleFactor;
251251
}
252252

src/core/qgscoordinatetransform.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ QgsRectangle QgsCoordinateTransform::transformBoundingBox( const QgsRectangle &r
352352
// even with 1000 points it takes < 1ms
353353
// TODO: how to effectively and precisely reproject bounding box?
354354
const int nPoints = 1000;
355-
double d = sqrt( ( rect.width() * rect.height() ) / pow( sqrt( static_cast< double >( nPoints ) ) - 1, 2.0 ) );
355+
double d = sqrt( ( rect.width() * rect.height() ) / std::pow( sqrt( static_cast< double >( nPoints ) ) - 1, 2.0 ) );
356356
int nXPoints = static_cast< int >( ceil( rect.width() / d ) ) + 1;
357357
int nYPoints = static_cast< int >( ceil( rect.height() / d ) ) + 1;
358358

src/core/qgsfield.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ bool QgsField::convertCompatible( QVariant &v ) const
268268

269269
if ( d->type == QVariant::Double && d->precision > 0 )
270270
{
271-
double s = qPow( 10, d->precision );
271+
double s = std::pow( 10, d->precision );
272272
double d = v.toDouble() * s;
273273
v = QVariant( ( d < 0 ? ceil( d - 0.5 ) : floor( d + 0.5 ) ) / s );
274274
return true;

src/core/qgshistogram.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ bool QgsHistogram::setValues( const QgsVectorLayer *layer, const QString &fieldO
6565
double QgsHistogram::optimalBinWidth() const
6666
{
6767
//Freedman-Diaconis rule
68-
return 2.0 * mIQR * qPow( mValues.count(), -1 / 3.0 );
68+
return 2.0 * mIQR * std::pow( mValues.count(), -1 / 3.0 );
6969
}
7070

7171
int QgsHistogram::optimalNumberBins() const

0 commit comments

Comments
 (0)