You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by er...@apache.org on 2022/01/27 14:13:10 UTC
[commons-math] branch master updated: Use specialized "pow" function.
This is an automated email from the ASF dual-hosted git repository.
erans pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-math.git
The following commit(s) were added to refs/heads/master by this push:
new c5ea177 Use specialized "pow" function.
c5ea177 is described below
commit c5ea177934387de3b2de813173b78b6debdf149a
Author: Gilles Sadowski <gi...@gmail.com>
AuthorDate: Thu Jan 27 15:09:34 2022 +0100
Use specialized "pow" function.
---
.../commons/math4/legacy/analysis/integration/MidPointIntegrator.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/integration/MidPointIntegrator.java b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/integration/MidPointIntegrator.java
index 00f255b..b698368 100644
--- a/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/integration/MidPointIntegrator.java
+++ b/commons-math-legacy/src/main/java/org/apache/commons/math4/legacy/analysis/integration/MidPointIntegrator.java
@@ -16,6 +16,7 @@
*/
package org.apache.commons.math4.legacy.analysis.integration;
+import org.apache.commons.numbers.core.ArithmeticUtils;
import org.apache.commons.math4.legacy.exception.NumberIsTooLargeException;
import org.apache.commons.math4.core.jdkmath.JdkMath;
@@ -113,7 +114,7 @@ public class MidPointIntegrator extends BaseAbstractUnivariateIntegrator {
double diffMaxMin) {
// number of points in the previous stage. This stage will contribute
// 2*3^{n-1} more points.
- final long np = (long) JdkMath.pow(3, n - 1);
+ final long np = ArithmeticUtils.pow(3L, n - 1);
double sum = 0;
// spacing between adjacent new points