Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r74011 - sandbox/e_float/libs/e_float/src/e_float/efx
From: e_float_at_[hidden]
Date: 2011-08-23 02:50:40


Author: christopher_kormanyos
Date: 2011-08-23 02:50:36 EDT (Tue, 23 Aug 2011)
New Revision: 74011
URL: http://svn.boost.org/trac/boost/changeset/74011

Log:
- Corrected value of "min". (But still struggling with equality of min with zero, etc.)
Text files modified:
   sandbox/e_float/libs/e_float/src/e_float/efx/e_float_efx.cpp | 44 +++++++--------------------------------
   1 files changed, 8 insertions(+), 36 deletions(-)

Modified: sandbox/e_float/libs/e_float/src/e_float/efx/e_float_efx.cpp
==============================================================================
--- sandbox/e_float/libs/e_float/src/e_float/efx/e_float_efx.cpp (original)
+++ sandbox/e_float/libs/e_float/src/e_float/efx/e_float_efx.cpp 2011-08-23 02:50:36 EDT (Tue, 23 Aug 2011)
@@ -1148,27 +1148,14 @@
 {
   if(fpclass == ef_finite)
   {
- bool is_leq_std_min = false;
-
- const bool could_be_leq_std_min = (exp <= static_cast<INT64>(std::numeric_limits<e_float>::min_exponent10));
-
- if(could_be_leq_std_min)
+ if(exp < static_cast<INT64>(std::numeric_limits<e_float>::min_exponent10))
     {
- if(exp < static_cast<INT64>(std::numeric_limits<e_float>::min_exponent10))
- {
- is_leq_std_min = true;
- }
- else
- {
- if(data[0u] == static_cast<UINT32>(1u))
- {
- const array_type::const_iterator it_non_zero = std::find_if(data.begin() + 1u, data.end(), data_elem_is_non_zero_predicate);
- if(it_non_zero == data.end()) { is_leq_std_min = true; }
- }
- }
+ return true;
+ }
+ else
+ {
+ return (data[0u] == static_cast<UINT32>(0u));
     }
-
- return ((data[0u] == static_cast<UINT32>(0u)) || is_leq_std_min);
   }
   else
   {
@@ -1843,24 +1830,9 @@
   }
 
   // ...and check for underflow.
- if(exp <= std::numeric_limits<e_float>::min_exponent10)
+ if(exp < std::numeric_limits<e_float>::min_exponent10)
   {
- if(exp == std::numeric_limits<e_float>::min_exponent10)
- {
- // Check for identity with the minimum value.
- e_float test = *this;
-
- test.exp = static_cast<INT64>(0);
-
- if(test.isone())
- {
- *this = ef::zero();
- }
- }
- else
- {
- *this = ef::zero();
- }
+ *this = ef::zero();
   }
 
   return true;


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk