From a7f162346d72ff615e0fe352f51d98db607fa796 Mon Sep 17 00:00:00 2001
From: "Paul A. Bristow" <pbristow@hetp.u-net.com>
Date: Wed, 13 Dec 2006 19:03:22 +0000
Subject: [PATCH] Corrections to kurtosis.

[SVN r3525]
---
 include/boost/math/distributions/triangular.hpp | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/include/boost/math/distributions/triangular.hpp b/include/boost/math/distributions/triangular.hpp
index c3381dd6e..1e7737545 100644
--- a/include/boost/math/distributions/triangular.hpp
+++ b/include/boost/math/distributions/triangular.hpp
@@ -423,8 +423,8 @@ namespace boost{ namespace math
   } // RealType skewness(const triangular_distribution<RealType>& dist)
 
   template <class RealType>
-  inline RealType kurtosis_excess(const triangular_distribution<RealType>& dist)
-  {
+  inline RealType kurtosis(const triangular_distribution<RealType>& dist)
+  { // These checks may be belt and braces as should have been checked on construction?
     RealType lower = dist.lower();
     RealType upper = dist.upper();
     RealType mode = dist.mode();
@@ -437,8 +437,16 @@ namespace boost{ namespace math
   } // RealType kurtosis_excess(const triangular_distribution<RealType>& dist)
 
   template <class RealType>
-  inline RealType kurtosis(const triangular_distribution<RealType>& dist)
-  {
+  inline RealType kurtosis_excess(const triangular_distribution<RealType>& dist)
+  { // These checks may be belt and braces as should have been checked on construction?
+    RealType lower = dist.lower();
+    RealType upper = dist.upper();
+    RealType mode = dist.mode();
+    RealType result;  // of checks.
+    if(false == detail::check_triangular(BOOST_CURRENT_FUNCTION,lower, mode, upper, &result))
+    {
+      return result;
+    }
     return static_cast<RealType>(-3)/5; // - 3/5 = -0.6
   }