From ef1e15e492866e666de31e6fb6c85a2de719f87b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9a=20Saviot?= Date: Wed, 14 Aug 2019 17:56:16 +0200 Subject: [PATCH] [apps/proba] Fix Chi Square law window --- apps/probability/law/chi_squared_law.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/apps/probability/law/chi_squared_law.cpp b/apps/probability/law/chi_squared_law.cpp index 35564552a..f6545fcf2 100644 --- a/apps/probability/law/chi_squared_law.cpp +++ b/apps/probability/law/chi_squared_law.cpp @@ -14,12 +14,11 @@ float ChiSquaredLaw::xMax() const { } float ChiSquaredLaw::yMax() const { - const float halfk = m_parameter1/2; float result; - if (halfk <= 1 + FLT_EPSILON) { + if (m_parameter1/2.0 <= 1 + FLT_EPSILON) { result = 0.5f; } else { - result = coefficient() * std::pow(halfk - 1, halfk - 1); + result = evaluateAtAbscissa(m_parameter1 - 1.0) * 1.2; } return result * (1.0f + k_displayTopMarginRatio); }