1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 08:13:04 +04:00

Replace pow with std::pow

The C pow casts to double while std::pow has overloads that can be
optimized by the compiler.
Also replace pow(*, 1./3) by cbrt.
This commit is contained in:
Vincent Rabaud
2026-01-04 01:50:00 +01:00
parent 10589eb2c8
commit 5622958189
47 changed files with 131 additions and 140 deletions
+3 -3
View File
@@ -554,9 +554,9 @@ TEST(Drawing, _914)
line(img, Point(-5, 20), Point(260, 20), Scalar(0), 2, 4);
line(img, Point(10, 0), Point(10, 255), Scalar(0), 2, 4);
double x0 = 0.0/pow(2.0, -2.0);
double x1 = 255.0/pow(2.0, -2.0);
double y = 30.5/pow(2.0, -2.0);
double x0 = 0.0/std::pow(2, -2);
double x1 = 255.0/std::pow(2, -2);
double y = 30.5/std::pow(2, -2);
line(img, Point(int(x0), int(y)), Point(int(x1), int(y)), Scalar(0), 2, 4, 2);