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 2019/12/24 22:31:13 UTC

[commons-numbers] 05/09: Ensure the test for log10 hits the edge case where x>0.5 and x
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 c23541ddcf53153b4d526933ece92743937e6538
Author: Alex Herbert <ah...@apache.org>
AuthorDate: Tue Dec 24 13:35:57 2019 +0000

    Ensure the test for log10 hits the edge case where x>0.5 and x<root(2).
    
    This uses a different computation with log1p.
---
 .../src/test/java/org/apache/commons/numbers/complex/ComplexTest.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/commons-numbers-complex/src/test/java/org/apache/commons/numbers/complex/ComplexTest.java b/commons-numbers-complex/src/test/java/org/apache/commons/numbers/complex/ComplexTest.java
index 82c2cee..3d1fd66 100644
--- a/commons-numbers-complex/src/test/java/org/apache/commons/numbers/complex/ComplexTest.java
+++ b/commons-numbers-complex/src/test/java/org/apache/commons/numbers/complex/ComplexTest.java
@@ -2052,7 +2052,7 @@ public class ComplexTest {
         final double ln10 = Math.log(10);
         final UniformRandomProvider rng = RandomSource.create(RandomSource.SPLIT_MIX_64);
         for (int i = 0; i < 10; i++) {
-            final Complex z = Complex.ofCartesian(rng.nextDouble(), rng.nextDouble());
+            final Complex z = Complex.ofCartesian(rng.nextDouble() * 2, rng.nextDouble() * 2);
             final Complex lnz = z.log();
             final Complex log10z = z.log10();
             // This is prone to floating-point error so use a delta