You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by ah...@apache.org on 2020/01/14 13:44:13 UTC
[commons-numbers] 02/02: Add a set of numbers that are within the
quadrant [0, pi/2).
This is an automated email from the ASF dual-hosted git repository.
aherbert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-numbers.git
commit cd30b161d063b5f5007e3f5b91668af8aaca3dd0
Author: aherbert <ah...@apache.org>
AuthorDate: Tue Jan 14 13:44:07 2020 +0000
Add a set of numbers that are within the quadrant [0, pi/2).
---
.../commons/numbers/examples/jmh/complex/SinCosPerformance.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/commons-numbers-examples/examples-jmh/src/main/java/org/apache/commons/numbers/examples/jmh/complex/SinCosPerformance.java b/commons-numbers-examples/examples-jmh/src/main/java/org/apache/commons/numbers/examples/jmh/complex/SinCosPerformance.java
index 778b7cb..d9e0bfa 100644
--- a/commons-numbers-examples/examples-jmh/src/main/java/org/apache/commons/numbers/examples/jmh/complex/SinCosPerformance.java
+++ b/commons-numbers-examples/examples-jmh/src/main/java/org/apache/commons/numbers/examples/jmh/complex/SinCosPerformance.java
@@ -90,7 +90,7 @@ public class SinCosPerformance {
/**
* The type of the data.
*/
- @Param({"pi", "random", "edge"})
+ @Param({"pi", "pi/2", "random", "edge"})
private String type;
/**
@@ -127,6 +127,8 @@ public class SinCosPerformance {
DoubleSupplier generator;
if ("pi".equals(type)) {
generator = () -> rng.nextDouble() * 2 * Math.PI - Math.PI;
+ } else if ("pi/2".equals(type)) {
+ generator = () -> rng.nextDouble() * Math.PI - Math.PI / 2;
} else if ("random".equals(type)) {
generator = () -> createRandomNumber(rng);
} else if ("edge".equals(type)) {