From 9989999916321c5bd4ad7b3f05106d0aa9a14aa0 Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Tue, 25 Jan 2022 22:49:03 +0000 Subject: [PATCH] normdist (init work) git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1897476 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/poi/ss/formula/functions/NormDist.java | 2 +- .../java/org/apache/poi/ss/formula/functions/TestNormDist.java | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/poi/src/main/java/org/apache/poi/ss/formula/functions/NormDist.java b/poi/src/main/java/org/apache/poi/ss/formula/functions/NormDist.java index 9d34dcee97..9a9ea03e02 100644 --- a/poi/src/main/java/org/apache/poi/ss/formula/functions/NormDist.java +++ b/poi/src/main/java/org/apache/poi/ss/formula/functions/NormDist.java @@ -36,7 +36,7 @@ public final class NormDist extends Fixed4ArgFunction implements FreeRefFunction static double probability(double x, double mean, double stdev, boolean cumulative) { NormalDistribution normalDistribution = new NormalDistribution(mean, stdev); - return cumulative ? normalDistribution.cumulativeProbability(x) : normalDistribution.probability(x); + return cumulative ? normalDistribution.cumulativeProbability(x) : normalDistribution.density(x); } @Override diff --git a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestNormDist.java b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestNormDist.java index 66894e1fc0..1202430183 100644 --- a/poi/src/test/java/org/apache/poi/ss/formula/functions/TestNormDist.java +++ b/poi/src/test/java/org/apache/poi/ss/formula/functions/TestNormDist.java @@ -46,8 +46,7 @@ final class TestNormDist { @Test void testBasic() { confirmValue("42", "40", "1.5", true, 0.9087888); - //TODO needs investigation - //confirmValue("42", "40", "1.5", false, 0.10934); + confirmValue("42", "40", "1.5", false, 0.10934); } @Test -- 2.39.5