From a855f999896814140a35bf3d80bed82bcccb59a6 Mon Sep 17 00:00:00 2001 From: pabristow Date: Mon, 8 Oct 2018 15:05:55 +0100 Subject: [PATCH] Avoid using max_digits10 in test to allow as old versions as possible to run --- example/lambert_w_basic_example.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/example/lambert_w_basic_example.cpp b/example/lambert_w_basic_example.cpp index 6b9b1c1a5..b57ee2fc7 100644 --- a/example/lambert_w_basic_example.cpp +++ b/example/lambert_w_basic_example.cpp @@ -11,10 +11,14 @@ int main() { - double z = 2.0; - double w = boost::math::lambert_w0(z); + double z = 2.0; + double w0 = boost::math::lambert_w0(z); std::cout.setf(std::ios_base::showpoint); // Include any trailing zeros. - std::cout.precision(std::numeric_limits::max_digits10); // Show all possibly significant digits. - std::cout << " lambert_w0(" << z << ") = " << w << std::endl; + // std::cout.precision(std::numeric_limits::max_digits10); // Show all possibly significant digits. + // Avoid using max_digfigs10 so as many old compilers can run the most basic lambert_w0 test. + std::cout << " lambert_w0(" << z << ") = " << w0 << std::endl; // lambert_w0(2.00000) = 0.852606 + z = -0.2; + double wm1 = boost::math::lambert_wm1(z); + std::cout << " lambert_wm1(" << z << ") = " << wm1 << std::endl; // lambert_wm1(-0.200000) = -2.54264 return 0; } // int main()