From 19113e841a5840cfccb7d090c786ea5487de4413 Mon Sep 17 00:00:00 2001 From: John Maddock Date: Thu, 5 Apr 2012 07:54:09 +0000 Subject: [PATCH] Correct logic to detect when string representation has enough bits. [SVN r77774] --- include/boost/multiprecision/detail/functions/constants.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/boost/multiprecision/detail/functions/constants.hpp b/include/boost/multiprecision/detail/functions/constants.hpp index 40a13fa6..685b04e0 100644 --- a/include/boost/multiprecision/detail/functions/constants.hpp +++ b/include/boost/multiprecision/detail/functions/constants.hpp @@ -35,7 +35,7 @@ void calc_log2(T& num, unsigned digits) // // Check if we can just construct from string: // - if(digits * 1000L / 301 < 1100) + if(digits < 3640) { num = string_val; return; @@ -92,7 +92,7 @@ void calc_e(T& result, unsigned digits) // // Check if we can just construct from string: // - if(digits * 1000L / 301 < 1100) + if(digits < 3640) { result = string_val; return; @@ -138,7 +138,7 @@ void calc_pi(T& result, unsigned digits) // // Check if we can just construct from string: // - if(digits * 1000L / 301 < 1100) + if(digits < 3640) { result = string_val; return;