Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r73594 - in sandbox/e_float: boost/e_float libs/e_float/src/e_float libs/e_float/src/e_float/efx libs/e_float/src/e_float/gmp libs/e_float/src/e_float/mpfr libs/e_float/src/functions/constants libs/e_float/src/functions/elementary libs/e_float/src/utility libs/e_float/test/real/cases libs/e_float/test/spot
From: e_float_at_[hidden]
Date: 2011-08-07 08:42:29


Author: christopher_kormanyos
Date: 2011-08-07 08:42:26 EDT (Sun, 07 Aug 2011)
New Revision: 73594
URL: http://svn.boost.org/trac/boost/changeset/73594

Log:
- Added all global cast operators with POD.
- Added all global comparison operators with POD.
Text files modified:
   sandbox/e_float/boost/e_float/e_float_base.hpp | 29 ++++
   sandbox/e_float/boost/e_float/e_float_complex.hpp | 2
   sandbox/e_float/boost/e_float/e_float_constants.hpp | 15 ++
   sandbox/e_float/boost/e_float/e_float_efx.hpp | 12 +
   sandbox/e_float/boost/e_float/e_float_global_math.hpp | 212 ++++++++++++++++++++++++++++++++++++++++
   sandbox/e_float/boost/e_float/e_float_gmp.hpp | 2
   sandbox/e_float/boost/e_float/e_float_mpfr.hpp | 2
   sandbox/e_float/libs/e_float/src/e_float/e_float_base.cpp | 2
   sandbox/e_float/libs/e_float/src/e_float/efx/e_float_efx.cpp | 141 +++++++++++++++++++++-----
   sandbox/e_float/libs/e_float/src/e_float/gmp/e_float_gmp.cpp | 2
   sandbox/e_float/libs/e_float/src/e_float/mpfr/e_float_mpfr.cpp | 6
   sandbox/e_float/libs/e_float/src/e_float/mpfr/e_float_mpfr_protos.h | 3
   sandbox/e_float/libs/e_float/src/functions/constants/constants.cpp | 105 ++++++++++---------
   sandbox/e_float/libs/e_float/src/functions/elementary/elementary_math.cpp | 10
   sandbox/e_float/libs/e_float/src/utility/util_power_j_pow_x.cpp | 2
   sandbox/e_float/libs/e_float/test/real/cases/test_case_0000z_global_ops_pod.cpp | 20 +++
   sandbox/e_float/libs/e_float/test/spot/test_spot.cpp | 10 +
   17 files changed, 471 insertions(+), 104 deletions(-)

Modified: sandbox/e_float/boost/e_float/e_float_base.hpp
==============================================================================
--- sandbox/e_float/boost/e_float/e_float_base.hpp (original)
+++ sandbox/e_float/boost/e_float/e_float_base.hpp 2011-08-07 08:42:26 EDT (Sun, 07 Aug 2011)
@@ -112,16 +112,35 @@
     INT64 order(void) const { return get_order_approximate(); }
 
     // Conversion routines
- virtual void extract_parts (double&, INT64&) const = 0;
- virtual double extract_double (void) const = 0;
- virtual INT64 extract_int64 (void) const = 0;
- virtual e_float extract_integer_part(void) const = 0;
- virtual e_float extract_decimal_part(void) const = 0;
+ virtual void extract_parts(double&, INT64&) const = 0;
+ virtual double extract_double (void) const = 0;
+ virtual long double extract_long_double (void) const = 0;
+ virtual signed long long extract_signed_long_long (void) const = 0;
+ virtual unsigned long long extract_unsigned_long_long(void) const = 0;
+ virtual e_float extract_integer_part (void) const = 0;
+ virtual e_float extract_decimal_part (void) const = 0;
 
     // Formated Output routine.
     void wr_string(std::string& str, std::ostream& os) const;
     virtual bool rd_string(const char* const) = 0;
 
+ // Cast operators
+ operator char() const { return (std::numeric_limits<char>::is_signed ? static_cast<char>(extract_signed_long_long()) : static_cast<char>(extract_unsigned_long_long())); }
+ operator wchar_t() const { return (std::numeric_limits<char>::is_signed ? static_cast<wchar_t>(extract_signed_long_long()) : static_cast<wchar_t>(extract_unsigned_long_long())); }
+ operator signed char() const { return static_cast<signed char> (extract_signed_long_long()); }
+ operator signed short() const { return static_cast<signed short> (extract_signed_long_long()); }
+ operator signed int() const { return static_cast<signed int> (extract_signed_long_long()); }
+ operator signed long() const { return static_cast<signed long> (extract_signed_long_long()); }
+ operator signed long long() const { return static_cast<signed long long> (extract_signed_long_long()); }
+ operator unsigned char() const { return static_cast<unsigned char> (extract_unsigned_long_long()); }
+ operator unsigned short() const { return static_cast<unsigned short> (extract_unsigned_long_long()); }
+ operator unsigned int() const { return static_cast<unsigned int> (extract_unsigned_long_long()); }
+ operator unsigned long() const { return static_cast<unsigned long> (extract_unsigned_long_long()); }
+ operator unsigned long long() const { return static_cast<unsigned long long>(extract_unsigned_long_long()); }
+ operator float() const { return static_cast<float>(extract_double()); }
+ operator double() const { return extract_double(); }
+ operator long double() const { return extract_long_double(); }
+
     // Specific higher functions which might be present in the MP implementation.
     virtual bool has_its_own_ldexp (void) const { return false; }
     virtual bool has_its_own_frexp (void) const { return false; }

Modified: sandbox/e_float/boost/e_float/e_float_complex.hpp
==============================================================================
--- sandbox/e_float/boost/e_float/e_float_complex.hpp (original)
+++ sandbox/e_float/boost/e_float/e_float_complex.hpp 2011-08-07 08:42:26 EDT (Sun, 07 Aug 2011)
@@ -119,7 +119,7 @@
     explicit ef_complex(const char* const s) : Re(s), Im(ef::zero()) { }
     explicit ef_complex(const std::string& str) : Re(str), Im(ef::zero()) { }
 
- ef_complex() { }
+ ef_complex() : Re(ef::zero()), Im(ef::zero()) { }
     ef_complex(const e_float& re) : Re(re), Im(ef::zero()) { }
     ef_complex(const e_float& re, const e_float& im) : Re(re), Im(im) { }
     ef_complex(const ef_complex& z) : Re(z.Re), Im(z.Im) { }

Modified: sandbox/e_float/boost/e_float/e_float_constants.hpp
==============================================================================
--- sandbox/e_float/boost/e_float/e_float_constants.hpp (original)
+++ sandbox/e_float/boost/e_float/e_float_constants.hpp 2011-08-07 08:42:26 EDT (Sun, 07 Aug 2011)
@@ -50,10 +50,17 @@
     const e_float& billion (void);
     const e_float& trillion (void);
     const e_float& googol (void);
- const e_float& int32max (void);
- const e_float& int32min (void);
- const e_float& int64max (void);
- const e_float& int64min (void);
+ const e_float& int64_min (void);
+ const e_float& int64_max (void);
+ const e_float& int32_min (void);
+ const e_float& int32_max (void);
+ const e_float& unsigned_long_long_max (void);
+ const e_float& signed_long_long_max (void);
+ const e_float& signed_long_long_min (void);
+ const e_float& double_min (void);
+ const e_float& double_max (void);
+ const e_float& long_double_min (void);
+ const e_float& long_double_max (void);
     const e_float& one_minus (void);
     const e_float& tenth (void);
     const e_float& eighth (void);

Modified: sandbox/e_float/boost/e_float/e_float_efx.hpp
==============================================================================
--- sandbox/e_float/boost/e_float/e_float_efx.hpp (original)
+++ sandbox/e_float/boost/e_float/e_float_efx.hpp 2011-08-07 08:42:26 EDT (Sun, 07 Aug 2011)
@@ -135,11 +135,13 @@
       virtual e_float& operator--(void);
 
       // Conversion routines
- virtual void extract_parts (double& mantissa, INT64& exponent) const;
- virtual double extract_double (void) const;
- virtual INT64 extract_int64 (void) const;
- virtual e_float extract_integer_part(void) const;
- virtual e_float extract_decimal_part(void) const;
+ virtual void extract_parts (double& mantissa, INT64& exponent) const;
+ virtual double extract_double (void) const;
+ virtual long double extract_long_double (void) const;
+ virtual signed long long extract_signed_long_long (void) const;
+ virtual unsigned long long extract_unsigned_long_long(void) const;
+ virtual e_float extract_integer_part (void) const;
+ virtual e_float extract_decimal_part (void) const;
 
     private:
       static bool data_elem_is_nonzero_predicate(const UINT32& d) { return (d != static_cast<UINT32>(0u)); }

Modified: sandbox/e_float/boost/e_float/e_float_global_math.hpp
==============================================================================
--- sandbox/e_float/boost/e_float/e_float_global_math.hpp (original)
+++ sandbox/e_float/boost/e_float/e_float_global_math.hpp 2011-08-07 08:42:26 EDT (Sun, 07 Aug 2011)
@@ -234,4 +234,216 @@
   inline bool operator>=(const e_float& u, const e_float& v) { return (u.cmp(v) >= static_cast<INT32>(0)); }
   inline bool operator> (const e_float& u, const e_float& v) { return (u.cmp(v) > static_cast<INT32>(0)); }
 
+ // Global comparison operators of const e_float& with all built-in types.
+ inline bool operator< (const e_float& u, const char v) { return (u.cmp(e_float(v)) < static_cast<INT32>(0)); }
+ inline bool operator<=(const e_float& u, const char v) { return (u.cmp(e_float(v)) <= static_cast<INT32>(0)); }
+ inline bool operator==(const e_float& u, const char v) { return (u.cmp(e_float(v)) == static_cast<INT32>(0)); }
+ inline bool operator!=(const e_float& u, const char v) { return (u.cmp(e_float(v)) != static_cast<INT32>(0)); }
+ inline bool operator>=(const e_float& u, const char v) { return (u.cmp(e_float(v)) >= static_cast<INT32>(0)); }
+ inline bool operator> (const e_float& u, const char v) { return (u.cmp(e_float(v)) > static_cast<INT32>(0)); }
+
+ inline bool operator< (const e_float& u, const wchar_t v) { return (u.cmp(e_float(v)) < static_cast<INT32>(0)); }
+ inline bool operator<=(const e_float& u, const wchar_t v) { return (u.cmp(e_float(v)) <= static_cast<INT32>(0)); }
+ inline bool operator==(const e_float& u, const wchar_t v) { return (u.cmp(e_float(v)) == static_cast<INT32>(0)); }
+ inline bool operator!=(const e_float& u, const wchar_t v) { return (u.cmp(e_float(v)) != static_cast<INT32>(0)); }
+ inline bool operator>=(const e_float& u, const wchar_t v) { return (u.cmp(e_float(v)) >= static_cast<INT32>(0)); }
+ inline bool operator> (const e_float& u, const wchar_t v) { return (u.cmp(e_float(v)) > static_cast<INT32>(0)); }
+
+ inline bool operator< (const e_float& u, const signed char v) { return (u.cmp(e_float(v)) < static_cast<INT32>(0)); }
+ inline bool operator<=(const e_float& u, const signed char v) { return (u.cmp(e_float(v)) <= static_cast<INT32>(0)); }
+ inline bool operator==(const e_float& u, const signed char v) { return (u.cmp(e_float(v)) == static_cast<INT32>(0)); }
+ inline bool operator!=(const e_float& u, const signed char v) { return (u.cmp(e_float(v)) != static_cast<INT32>(0)); }
+ inline bool operator>=(const e_float& u, const signed char v) { return (u.cmp(e_float(v)) >= static_cast<INT32>(0)); }
+ inline bool operator> (const e_float& u, const signed char v) { return (u.cmp(e_float(v)) > static_cast<INT32>(0)); }
+
+ inline bool operator< (const e_float& u, const signed short v) { return (u.cmp(e_float(v)) < static_cast<INT32>(0)); }
+ inline bool operator<=(const e_float& u, const signed short v) { return (u.cmp(e_float(v)) <= static_cast<INT32>(0)); }
+ inline bool operator==(const e_float& u, const signed short v) { return (u.cmp(e_float(v)) == static_cast<INT32>(0)); }
+ inline bool operator!=(const e_float& u, const signed short v) { return (u.cmp(e_float(v)) != static_cast<INT32>(0)); }
+ inline bool operator>=(const e_float& u, const signed short v) { return (u.cmp(e_float(v)) >= static_cast<INT32>(0)); }
+ inline bool operator> (const e_float& u, const signed short v) { return (u.cmp(e_float(v)) > static_cast<INT32>(0)); }
+
+ inline bool operator< (const e_float& u, const signed int v) { return (u.cmp(e_float(v)) < static_cast<INT32>(0)); }
+ inline bool operator<=(const e_float& u, const signed int v) { return (u.cmp(e_float(v)) <= static_cast<INT32>(0)); }
+ inline bool operator==(const e_float& u, const signed int v) { return (u.cmp(e_float(v)) == static_cast<INT32>(0)); }
+ inline bool operator!=(const e_float& u, const signed int v) { return (u.cmp(e_float(v)) != static_cast<INT32>(0)); }
+ inline bool operator>=(const e_float& u, const signed int v) { return (u.cmp(e_float(v)) >= static_cast<INT32>(0)); }
+ inline bool operator> (const e_float& u, const signed int v) { return (u.cmp(e_float(v)) > static_cast<INT32>(0)); }
+
+ inline bool operator< (const e_float& u, const signed long v) { return (u.cmp(e_float(v)) < static_cast<INT32>(0)); }
+ inline bool operator<=(const e_float& u, const signed long v) { return (u.cmp(e_float(v)) <= static_cast<INT32>(0)); }
+ inline bool operator==(const e_float& u, const signed long v) { return (u.cmp(e_float(v)) == static_cast<INT32>(0)); }
+ inline bool operator!=(const e_float& u, const signed long v) { return (u.cmp(e_float(v)) != static_cast<INT32>(0)); }
+ inline bool operator>=(const e_float& u, const signed long v) { return (u.cmp(e_float(v)) >= static_cast<INT32>(0)); }
+ inline bool operator> (const e_float& u, const signed long v) { return (u.cmp(e_float(v)) > static_cast<INT32>(0)); }
+
+ inline bool operator< (const e_float& u, const signed long long v) { return (u.cmp(e_float(v)) < static_cast<INT32>(0)); }
+ inline bool operator<=(const e_float& u, const signed long long v) { return (u.cmp(e_float(v)) <= static_cast<INT32>(0)); }
+ inline bool operator==(const e_float& u, const signed long long v) { return (u.cmp(e_float(v)) == static_cast<INT32>(0)); }
+ inline bool operator!=(const e_float& u, const signed long long v) { return (u.cmp(e_float(v)) != static_cast<INT32>(0)); }
+ inline bool operator>=(const e_float& u, const signed long long v) { return (u.cmp(e_float(v)) >= static_cast<INT32>(0)); }
+ inline bool operator> (const e_float& u, const signed long long v) { return (u.cmp(e_float(v)) > static_cast<INT32>(0)); }
+
+ inline bool operator< (const e_float& u, const unsigned char v) { return (u.cmp(e_float(v)) < static_cast<INT32>(0)); }
+ inline bool operator<=(const e_float& u, const unsigned char v) { return (u.cmp(e_float(v)) <= static_cast<INT32>(0)); }
+ inline bool operator==(const e_float& u, const unsigned char v) { return (u.cmp(e_float(v)) == static_cast<INT32>(0)); }
+ inline bool operator!=(const e_float& u, const unsigned char v) { return (u.cmp(e_float(v)) != static_cast<INT32>(0)); }
+ inline bool operator>=(const e_float& u, const unsigned char v) { return (u.cmp(e_float(v)) >= static_cast<INT32>(0)); }
+ inline bool operator> (const e_float& u, const unsigned char v) { return (u.cmp(e_float(v)) > static_cast<INT32>(0)); }
+
+ inline bool operator< (const e_float& u, const unsigned short v) { return (u.cmp(e_float(v)) < static_cast<INT32>(0)); }
+ inline bool operator<=(const e_float& u, const unsigned short v) { return (u.cmp(e_float(v)) <= static_cast<INT32>(0)); }
+ inline bool operator==(const e_float& u, const unsigned short v) { return (u.cmp(e_float(v)) == static_cast<INT32>(0)); }
+ inline bool operator!=(const e_float& u, const unsigned short v) { return (u.cmp(e_float(v)) != static_cast<INT32>(0)); }
+ inline bool operator>=(const e_float& u, const unsigned short v) { return (u.cmp(e_float(v)) >= static_cast<INT32>(0)); }
+ inline bool operator> (const e_float& u, const unsigned short v) { return (u.cmp(e_float(v)) > static_cast<INT32>(0)); }
+
+ inline bool operator< (const e_float& u, const unsigned int v) { return (u.cmp(e_float(v)) < static_cast<INT32>(0)); }
+ inline bool operator<=(const e_float& u, const unsigned int v) { return (u.cmp(e_float(v)) <= static_cast<INT32>(0)); }
+ inline bool operator==(const e_float& u, const unsigned int v) { return (u.cmp(e_float(v)) == static_cast<INT32>(0)); }
+ inline bool operator!=(const e_float& u, const unsigned int v) { return (u.cmp(e_float(v)) != static_cast<INT32>(0)); }
+ inline bool operator>=(const e_float& u, const unsigned int v) { return (u.cmp(e_float(v)) >= static_cast<INT32>(0)); }
+ inline bool operator> (const e_float& u, const unsigned int v) { return (u.cmp(e_float(v)) > static_cast<INT32>(0)); }
+
+ inline bool operator< (const e_float& u, const unsigned long v) { return (u.cmp(e_float(v)) < static_cast<INT32>(0)); }
+ inline bool operator<=(const e_float& u, const unsigned long v) { return (u.cmp(e_float(v)) <= static_cast<INT32>(0)); }
+ inline bool operator==(const e_float& u, const unsigned long v) { return (u.cmp(e_float(v)) == static_cast<INT32>(0)); }
+ inline bool operator!=(const e_float& u, const unsigned long v) { return (u.cmp(e_float(v)) != static_cast<INT32>(0)); }
+ inline bool operator>=(const e_float& u, const unsigned long v) { return (u.cmp(e_float(v)) >= static_cast<INT32>(0)); }
+ inline bool operator> (const e_float& u, const unsigned long v) { return (u.cmp(e_float(v)) > static_cast<INT32>(0)); }
+
+ inline bool operator< (const e_float& u, const unsigned long long v) { return (u.cmp(e_float(v)) < static_cast<INT32>(0)); }
+ inline bool operator<=(const e_float& u, const unsigned long long v) { return (u.cmp(e_float(v)) <= static_cast<INT32>(0)); }
+ inline bool operator==(const e_float& u, const unsigned long long v) { return (u.cmp(e_float(v)) == static_cast<INT32>(0)); }
+ inline bool operator!=(const e_float& u, const unsigned long long v) { return (u.cmp(e_float(v)) != static_cast<INT32>(0)); }
+ inline bool operator>=(const e_float& u, const unsigned long long v) { return (u.cmp(e_float(v)) >= static_cast<INT32>(0)); }
+ inline bool operator> (const e_float& u, const unsigned long long v) { return (u.cmp(e_float(v)) > static_cast<INT32>(0)); }
+
+ inline bool operator< (const e_float& u, const float v) { return (u.cmp(e_float(v)) < static_cast<INT32>(0)); }
+ inline bool operator<=(const e_float& u, const float v) { return (u.cmp(e_float(v)) <= static_cast<INT32>(0)); }
+ inline bool operator==(const e_float& u, const float v) { return (u.cmp(e_float(v)) == static_cast<INT32>(0)); }
+ inline bool operator!=(const e_float& u, const float v) { return (u.cmp(e_float(v)) != static_cast<INT32>(0)); }
+ inline bool operator>=(const e_float& u, const float v) { return (u.cmp(e_float(v)) >= static_cast<INT32>(0)); }
+ inline bool operator> (const e_float& u, const float v) { return (u.cmp(e_float(v)) > static_cast<INT32>(0)); }
+
+ inline bool operator< (const e_float& u, const double v) { return (u.cmp(e_float(v)) < static_cast<INT32>(0)); }
+ inline bool operator<=(const e_float& u, const double v) { return (u.cmp(e_float(v)) <= static_cast<INT32>(0)); }
+ inline bool operator==(const e_float& u, const double v) { return (u.cmp(e_float(v)) == static_cast<INT32>(0)); }
+ inline bool operator!=(const e_float& u, const double v) { return (u.cmp(e_float(v)) != static_cast<INT32>(0)); }
+ inline bool operator>=(const e_float& u, const double v) { return (u.cmp(e_float(v)) >= static_cast<INT32>(0)); }
+ inline bool operator> (const e_float& u, const double v) { return (u.cmp(e_float(v)) > static_cast<INT32>(0)); }
+
+ inline bool operator< (const e_float& u, const long double v) { return (u.cmp(e_float(v)) < static_cast<INT32>(0)); }
+ inline bool operator<=(const e_float& u, const long double v) { return (u.cmp(e_float(v)) <= static_cast<INT32>(0)); }
+ inline bool operator==(const e_float& u, const long double v) { return (u.cmp(e_float(v)) == static_cast<INT32>(0)); }
+ inline bool operator!=(const e_float& u, const long double v) { return (u.cmp(e_float(v)) != static_cast<INT32>(0)); }
+ inline bool operator>=(const e_float& u, const long double v) { return (u.cmp(e_float(v)) >= static_cast<INT32>(0)); }
+ inline bool operator> (const e_float& u, const long double v) { return (u.cmp(e_float(v)) > static_cast<INT32>(0)); }
+
+ // Global comparison operators of all built-in types with const e_float&.
+ inline bool operator< (const char u, const e_float& v) { return (e_float(u).cmp(v) < static_cast<INT32>(0)); }
+ inline bool operator<=(const char u, const e_float& v) { return (e_float(u).cmp(v) <= static_cast<INT32>(0)); }
+ inline bool operator==(const char u, const e_float& v) { return (e_float(u).cmp(v) == static_cast<INT32>(0)); }
+ inline bool operator!=(const char u, const e_float& v) { return (e_float(u).cmp(v) != static_cast<INT32>(0)); }
+ inline bool operator>=(const char u, const e_float& v) { return (e_float(u).cmp(v) >= static_cast<INT32>(0)); }
+ inline bool operator> (const char u, const e_float& v) { return (e_float(u).cmp(v) > static_cast<INT32>(0)); }
+
+ inline bool operator< (const wchar_t u, const e_float& v) { return (e_float(u).cmp(v) < static_cast<INT32>(0)); }
+ inline bool operator<=(const wchar_t u, const e_float& v) { return (e_float(u).cmp(v) <= static_cast<INT32>(0)); }
+ inline bool operator==(const wchar_t u, const e_float& v) { return (e_float(u).cmp(v) == static_cast<INT32>(0)); }
+ inline bool operator!=(const wchar_t u, const e_float& v) { return (e_float(u).cmp(v) != static_cast<INT32>(0)); }
+ inline bool operator>=(const wchar_t u, const e_float& v) { return (e_float(u).cmp(v) >= static_cast<INT32>(0)); }
+ inline bool operator> (const wchar_t u, const e_float& v) { return (e_float(u).cmp(v) > static_cast<INT32>(0)); }
+
+ inline bool operator< (const signed char u, const e_float& v) { return (e_float(u).cmp(v) < static_cast<INT32>(0)); }
+ inline bool operator<=(const signed char u, const e_float& v) { return (e_float(u).cmp(v) <= static_cast<INT32>(0)); }
+ inline bool operator==(const signed char u, const e_float& v) { return (e_float(u).cmp(v) == static_cast<INT32>(0)); }
+ inline bool operator!=(const signed char u, const e_float& v) { return (e_float(u).cmp(v) != static_cast<INT32>(0)); }
+ inline bool operator>=(const signed char u, const e_float& v) { return (e_float(u).cmp(v) >= static_cast<INT32>(0)); }
+ inline bool operator> (const signed char u, const e_float& v) { return (e_float(u).cmp(v) > static_cast<INT32>(0)); }
+
+ inline bool operator< (const signed short u, const e_float& v) { return (e_float(u).cmp(v) < static_cast<INT32>(0)); }
+ inline bool operator<=(const signed short u, const e_float& v) { return (e_float(u).cmp(v) <= static_cast<INT32>(0)); }
+ inline bool operator==(const signed short u, const e_float& v) { return (e_float(u).cmp(v) == static_cast<INT32>(0)); }
+ inline bool operator!=(const signed short u, const e_float& v) { return (e_float(u).cmp(v) != static_cast<INT32>(0)); }
+ inline bool operator>=(const signed short u, const e_float& v) { return (e_float(u).cmp(v) >= static_cast<INT32>(0)); }
+ inline bool operator> (const signed short u, const e_float& v) { return (e_float(u).cmp(v) > static_cast<INT32>(0)); }
+
+ inline bool operator< (const signed int u, const e_float& v) { return (e_float(u).cmp(v) < static_cast<INT32>(0)); }
+ inline bool operator<=(const signed int u, const e_float& v) { return (e_float(u).cmp(v) <= static_cast<INT32>(0)); }
+ inline bool operator==(const signed int u, const e_float& v) { return (e_float(u).cmp(v) == static_cast<INT32>(0)); }
+ inline bool operator!=(const signed int u, const e_float& v) { return (e_float(u).cmp(v) != static_cast<INT32>(0)); }
+ inline bool operator>=(const signed int u, const e_float& v) { return (e_float(u).cmp(v) >= static_cast<INT32>(0)); }
+ inline bool operator> (const signed int u, const e_float& v) { return (e_float(u).cmp(v) > static_cast<INT32>(0)); }
+
+ inline bool operator< (const signed long u, const e_float& v) { return (e_float(u).cmp(v) < static_cast<INT32>(0)); }
+ inline bool operator<=(const signed long u, const e_float& v) { return (e_float(u).cmp(v) <= static_cast<INT32>(0)); }
+ inline bool operator==(const signed long u, const e_float& v) { return (e_float(u).cmp(v) == static_cast<INT32>(0)); }
+ inline bool operator!=(const signed long u, const e_float& v) { return (e_float(u).cmp(v) != static_cast<INT32>(0)); }
+ inline bool operator>=(const signed long u, const e_float& v) { return (e_float(u).cmp(v) >= static_cast<INT32>(0)); }
+ inline bool operator> (const signed long u, const e_float& v) { return (e_float(u).cmp(v) > static_cast<INT32>(0)); }
+
+ inline bool operator< (const signed long long u, const e_float& v) { return (e_float(u).cmp(v) < static_cast<INT32>(0)); }
+ inline bool operator<=(const signed long long u, const e_float& v) { return (e_float(u).cmp(v) <= static_cast<INT32>(0)); }
+ inline bool operator==(const signed long long u, const e_float& v) { return (e_float(u).cmp(v) == static_cast<INT32>(0)); }
+ inline bool operator!=(const signed long long u, const e_float& v) { return (e_float(u).cmp(v) != static_cast<INT32>(0)); }
+ inline bool operator>=(const signed long long u, const e_float& v) { return (e_float(u).cmp(v) >= static_cast<INT32>(0)); }
+ inline bool operator> (const signed long long u, const e_float& v) { return (e_float(u).cmp(v) > static_cast<INT32>(0)); }
+
+ inline bool operator< (const unsigned char u, const e_float& v) { return (e_float(u).cmp(v) < static_cast<INT32>(0)); }
+ inline bool operator<=(const unsigned char u, const e_float& v) { return (e_float(u).cmp(v) <= static_cast<INT32>(0)); }
+ inline bool operator==(const unsigned char u, const e_float& v) { return (e_float(u).cmp(v) == static_cast<INT32>(0)); }
+ inline bool operator!=(const unsigned char u, const e_float& v) { return (e_float(u).cmp(v) != static_cast<INT32>(0)); }
+ inline bool operator>=(const unsigned char u, const e_float& v) { return (e_float(u).cmp(v) >= static_cast<INT32>(0)); }
+ inline bool operator> (const unsigned char u, const e_float& v) { return (e_float(u).cmp(v) > static_cast<INT32>(0)); }
+
+ inline bool operator< (const unsigned short u, const e_float& v) { return (e_float(u).cmp(v) < static_cast<INT32>(0)); }
+ inline bool operator<=(const unsigned short u, const e_float& v) { return (e_float(u).cmp(v) <= static_cast<INT32>(0)); }
+ inline bool operator==(const unsigned short u, const e_float& v) { return (e_float(u).cmp(v) == static_cast<INT32>(0)); }
+ inline bool operator!=(const unsigned short u, const e_float& v) { return (e_float(u).cmp(v) != static_cast<INT32>(0)); }
+ inline bool operator>=(const unsigned short u, const e_float& v) { return (e_float(u).cmp(v) >= static_cast<INT32>(0)); }
+ inline bool operator> (const unsigned short u, const e_float& v) { return (e_float(u).cmp(v) > static_cast<INT32>(0)); }
+
+ inline bool operator< (const unsigned int u, const e_float& v) { return (e_float(u).cmp(v) < static_cast<INT32>(0)); }
+ inline bool operator<=(const unsigned int u, const e_float& v) { return (e_float(u).cmp(v) <= static_cast<INT32>(0)); }
+ inline bool operator==(const unsigned int u, const e_float& v) { return (e_float(u).cmp(v) == static_cast<INT32>(0)); }
+ inline bool operator!=(const unsigned int u, const e_float& v) { return (e_float(u).cmp(v) != static_cast<INT32>(0)); }
+ inline bool operator>=(const unsigned int u, const e_float& v) { return (e_float(u).cmp(v) >= static_cast<INT32>(0)); }
+ inline bool operator> (const unsigned int u, const e_float& v) { return (e_float(u).cmp(v) > static_cast<INT32>(0)); }
+
+ inline bool operator< (const unsigned long u, const e_float& v) { return (e_float(u).cmp(v) < static_cast<INT32>(0)); }
+ inline bool operator<=(const unsigned long u, const e_float& v) { return (e_float(u).cmp(v) <= static_cast<INT32>(0)); }
+ inline bool operator==(const unsigned long u, const e_float& v) { return (e_float(u).cmp(v) == static_cast<INT32>(0)); }
+ inline bool operator!=(const unsigned long u, const e_float& v) { return (e_float(u).cmp(v) != static_cast<INT32>(0)); }
+ inline bool operator>=(const unsigned long u, const e_float& v) { return (e_float(u).cmp(v) >= static_cast<INT32>(0)); }
+ inline bool operator> (const unsigned long u, const e_float& v) { return (e_float(u).cmp(v) > static_cast<INT32>(0)); }
+
+ inline bool operator< (const unsigned long long u, const e_float& v) { return (e_float(u).cmp(v) < static_cast<INT32>(0)); }
+ inline bool operator<=(const unsigned long long u, const e_float& v) { return (e_float(u).cmp(v) <= static_cast<INT32>(0)); }
+ inline bool operator==(const unsigned long long u, const e_float& v) { return (e_float(u).cmp(v) == static_cast<INT32>(0)); }
+ inline bool operator!=(const unsigned long long u, const e_float& v) { return (e_float(u).cmp(v) != static_cast<INT32>(0)); }
+ inline bool operator>=(const unsigned long long u, const e_float& v) { return (e_float(u).cmp(v) >= static_cast<INT32>(0)); }
+ inline bool operator> (const unsigned long long u, const e_float& v) { return (e_float(u).cmp(v) > static_cast<INT32>(0)); }
+
+ inline bool operator< (const float u, const e_float& v) { return (e_float(u).cmp(v) < static_cast<INT32>(0)); }
+ inline bool operator<=(const float u, const e_float& v) { return (e_float(u).cmp(v) <= static_cast<INT32>(0)); }
+ inline bool operator==(const float u, const e_float& v) { return (e_float(u).cmp(v) == static_cast<INT32>(0)); }
+ inline bool operator!=(const float u, const e_float& v) { return (e_float(u).cmp(v) != static_cast<INT32>(0)); }
+ inline bool operator>=(const float u, const e_float& v) { return (e_float(u).cmp(v) >= static_cast<INT32>(0)); }
+ inline bool operator> (const float u, const e_float& v) { return (e_float(u).cmp(v) > static_cast<INT32>(0)); }
+
+ inline bool operator< (const double u, const e_float& v) { return (e_float(u).cmp(v) < static_cast<INT32>(0)); }
+ inline bool operator<=(const double u, const e_float& v) { return (e_float(u).cmp(v) <= static_cast<INT32>(0)); }
+ inline bool operator==(const double u, const e_float& v) { return (e_float(u).cmp(v) == static_cast<INT32>(0)); }
+ inline bool operator!=(const double u, const e_float& v) { return (e_float(u).cmp(v) != static_cast<INT32>(0)); }
+ inline bool operator>=(const double u, const e_float& v) { return (e_float(u).cmp(v) >= static_cast<INT32>(0)); }
+ inline bool operator> (const double u, const e_float& v) { return (e_float(u).cmp(v) > static_cast<INT32>(0)); }
+
+ inline bool operator< (const long double u, const e_float& v) { return (e_float(u).cmp(v) < static_cast<INT32>(0)); }
+ inline bool operator<=(const long double u, const e_float& v) { return (e_float(u).cmp(v) <= static_cast<INT32>(0)); }
+ inline bool operator==(const long double u, const e_float& v) { return (e_float(u).cmp(v) == static_cast<INT32>(0)); }
+ inline bool operator!=(const long double u, const e_float& v) { return (e_float(u).cmp(v) != static_cast<INT32>(0)); }
+ inline bool operator>=(const long double u, const e_float& v) { return (e_float(u).cmp(v) >= static_cast<INT32>(0)); }
+ inline bool operator> (const long double u, const e_float& v) { return (e_float(u).cmp(v) > static_cast<INT32>(0)); }
+
 #endif // _E_FLOAT_GLOBAL_MATH_HPP_

Modified: sandbox/e_float/boost/e_float/e_float_gmp.hpp
==============================================================================
--- sandbox/e_float/boost/e_float/e_float_gmp.hpp (original)
+++ sandbox/e_float/boost/e_float/e_float_gmp.hpp 2011-08-07 08:42:26 EDT (Sun, 07 Aug 2011)
@@ -154,7 +154,7 @@
       // Conversion routines
       virtual void extract_parts (double& mantissa, INT64& exponent) const;
       virtual double extract_double (void) const;
- virtual INT64 extract_int64 (void) const;
+ virtual INT64 extract_signed_long_long (void) const;
       virtual e_float extract_integer_part(void) const;
       virtual e_float extract_decimal_part(void) const;
 

Modified: sandbox/e_float/boost/e_float/e_float_mpfr.hpp
==============================================================================
--- sandbox/e_float/boost/e_float/e_float_mpfr.hpp (original)
+++ sandbox/e_float/boost/e_float/e_float_mpfr.hpp 2011-08-07 08:42:26 EDT (Sun, 07 Aug 2011)
@@ -140,7 +140,7 @@
 
       virtual void extract_parts (double& mantissa, INT64& exponent) const;
       virtual double extract_double (void) const;
- virtual INT64 extract_int64 (void) const;
+ virtual INT64 extract_signed_long_long (void) const;
       virtual e_float extract_integer_part(void) const;
       virtual e_float extract_decimal_part(void) const;
 

Modified: sandbox/e_float/libs/e_float/src/e_float/e_float_base.cpp
==============================================================================
--- sandbox/e_float/libs/e_float/src/e_float/e_float_base.cpp (original)
+++ sandbox/e_float/libs/e_float/src/e_float/e_float_base.cpp 2011-08-07 08:42:26 EDT (Sun, 07 Aug 2011)
@@ -8,6 +8,8 @@
 // "Algorithm 910: A Portable C++ Multiple-Precision System for Special-Function Calculations",
 // in ACM TOMS, {VOL 37, ISSUE 4, (February 2011)} (C) ACM, 2011. http://doi.acm.org/10.1145/1916461.1916469
 
+#include <algorithm>
+
 #include <e_float/e_float.hpp>
 #include "../utility/util_lexical_cast.h"
 

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-07 08:42:26 EDT (Sun, 07 Aug 2011)
@@ -61,7 +61,7 @@
 
 efx::e_float::e_float(const wchar_t n) : data (),
                                          exp (static_cast<INT64>(0)),
- neg (std::numeric_limits<wchar_t>::is_signed && (n < static_cast<wchar_t>(0))),
+ neg (std::numeric_limits<wchar_t>::is_signed ? (n < static_cast<wchar_t>(0)) : false),
                                          fpclass (ef_finite),
                                          prec_elem(ef_elem_number)
 {
@@ -1300,32 +1300,30 @@
 {
   // Returns the double conversion of a e_float.
 
- // Check for zero or non-normal e_float.
- if(iszero())
- {
- return 0.0;
- }
- else if(!isfinite())
+ // Check for non-normal e_float.
+ if(!isfinite())
   {
     if(isnan())
     {
       return std::numeric_limits<double>::quiet_NaN();
     }
- else if(isinf())
+ else
     {
       return ((!neg) ? std::numeric_limits<double>::infinity()
                      : -std::numeric_limits<double>::infinity());
     }
- else
- {
- return 0.0;
- }
   }
-
- // Check if e_float exceeds the
- static const e_float dbl_max((std::numeric_limits<double>::max)());
 
- if(ef::fabs(*this) > dbl_max)
+ const e_float xx(ef::fabs(*this));
+
+ // Check for zero e_float.
+ if(iszero() || (xx < ef::double_min()))
+ {
+ return 0.0;
+ }
+
+ // Check if e_float exceeds the maximum of double.
+ if(xx > ef::double_max())
   {
     return ((!neg) ? std::numeric_limits<double>::infinity()
                    : -std::numeric_limits<double>::infinity());
@@ -1343,41 +1341,130 @@
   return d;
 }
 
-INT64 efx::e_float::extract_int64(void) const
+long double efx::e_float::extract_long_double(void) const
 {
- // Computes a 64-bit integer cast of the input e_float value x.
- // If |x| exceeds MAX_INT64, then this maximum value is returned.
+ // Returns the long double conversion of a e_float.
+
+ // Check for non-normal e_float.
+ if(!isfinite())
+ {
+ if(isnan())
+ {
+ return std::numeric_limits<long double>::quiet_NaN();
+ }
+ else
+ {
+ return ((!neg) ? std::numeric_limits<long double>::infinity()
+ : -std::numeric_limits<long double>::infinity());
+ }
+ }
+
+ const e_float xx(ef::fabs(*this));
+
+ // Check for zero e_float.
+ if(iszero() || (xx < ef::long_double_min()))
+ {
+ return 0.0;
+ }
+
+ // Check if e_float exceeds the maximum of double.
+ if(xx > ef::long_double_max())
+ {
+ return ((!neg) ? std::numeric_limits<long double>::infinity()
+ : -std::numeric_limits<long double>::infinity());
+ }
+
+ std::stringstream ss;
+
+ ss << std::setprecision(static_cast<std::streamsize>(std::numeric_limits<long double>::digits10 + (2 + 1)))
+ << std::scientific
+ << *this;
+
+ long double ld;
+ ss >> ld;
+
+ return ld;
+}
+
+signed long long efx::e_float::extract_signed_long_long(void) const
+{
+ // Extracts a signed long long from *this.
+ // If |x| exceeds the maximum of signed long long,
+ // then this maximum value is returned.
 
   if(exp < static_cast<INT64>(0))
   {
- return static_cast<INT64>(0);
+ return static_cast<signed long long>(0);
   }
 
   const bool b_neg = isneg();
 
   const e_float xn = ef::fabs(extract_integer_part());
 
- INT64 val;
+ signed long long val;
 
- if(xn > ef::int64max())
+ if(xn > ef::signed_long_long_max())
   {
- val = (std::numeric_limits<INT64>::max)();
+ val = (std::numeric_limits<signed long long>::max)();
   }
   else
   {
     // Extract the data into the int64 value.
- val = static_cast<INT64>(xn.data[0]);
+ val = static_cast<signed long long>(xn.data[0]);
+
+ const INT32 imax = (std::min)(static_cast<INT32>(static_cast<INT32>(xn.exp) / ef_elem_digits10), static_cast<INT32>(ef_elem_number - static_cast<INT32>(1)));
 
- for(INT32 i = static_cast<INT32>(1); i <= static_cast<INT32>(static_cast<INT32>(xn.exp) / ef_elem_digits10); i++)
+ for(INT32 i = static_cast<INT32>(1); i <= imax; i++)
     {
- val *= static_cast<INT64>(ef_elem_mask);
- val += static_cast<INT64>(xn.data[i]);
+ val *= static_cast<signed long long>(ef_elem_mask);
+ val += static_cast<signed long long>(xn.data[i]);
     }
   }
 
   return ((!b_neg) ? val : static_cast<INT64>(-val));
 }
 
+unsigned long long efx::e_float::extract_unsigned_long_long(void) const
+{
+ // Extracts an unsigned long long from *this.
+ // If |x| exceeds the maximum of unsigned long long,
+ // then this maximum value is returned.
+
+ if(isneg())
+ {
+ return static_cast<unsigned long long>(extract_signed_long_long());
+ }
+
+ if(exp < static_cast<INT64>(0))
+ {
+ return static_cast<unsigned long long>(0u);
+ }
+
+ const e_float xn = ef::fabs(extract_integer_part());
+
+ unsigned long long val;
+
+ if(xn > ef::unsigned_long_long_max())
+ {
+ val = (std::numeric_limits<unsigned long long>::max)();
+ }
+ else
+ {
+ // Extract the data into the int64 value.
+ val = static_cast<unsigned long long>(xn.data[0]);
+
+ const INT32 imax = (std::min)(static_cast<INT32>(static_cast<INT32>(xn.exp) / ef_elem_digits10), static_cast<INT32>(ef_elem_number - static_cast<INT32>(1)));
+
+ for(INT32 i = static_cast<INT32>(1); i <= imax; i++)
+ {
+ val *= static_cast<unsigned long long>(ef_elem_mask);
+ val += static_cast<unsigned long long>(xn.data[i]);
+ }
+ }
+
+ return val;
+}
+
 efx::e_float efx::e_float::extract_integer_part(void) const
 {
   // Compute the signed integer part of x.

Modified: sandbox/e_float/libs/e_float/src/e_float/gmp/e_float_gmp.cpp
==============================================================================
--- sandbox/e_float/libs/e_float/src/e_float/gmp/e_float_gmp.cpp (original)
+++ sandbox/e_float/libs/e_float/src/e_float/gmp/e_float_gmp.cpp 2011-08-07 08:42:26 EDT (Sun, 07 Aug 2011)
@@ -769,7 +769,7 @@
   return ((!b_neg) ? dx : -dx);
 }
 
-INT64 gmp::e_float::extract_int64(void) const
+INT64 gmp::e_float::extract_signed_long_long(void) const
 {
   const bool b_neg = isneg();
 

Modified: sandbox/e_float/libs/e_float/src/e_float/mpfr/e_float_mpfr.cpp
==============================================================================
--- sandbox/e_float/libs/e_float/src/e_float/mpfr/e_float_mpfr.cpp (original)
+++ sandbox/e_float/libs/e_float/src/e_float/mpfr/e_float_mpfr.cpp 2011-08-07 08:42:26 EDT (Sun, 07 Aug 2011)
@@ -66,7 +66,7 @@
 
   if(!ef::isfinite(static_cast<double>(f)))
   {
- operator=(ef::isnan(static_cast<double>(f)) ? my_value_nan() : ((!b_neg) ? my_value_inf() : -my_value_inf()));
+ (ef::isnan(static_cast<double>(f)) ? mpfr_set_nan(rop) : ((!b_neg) ? ::mpfr_set_inf(rop, 1) : ::mpfr_set_inf(rop, -1)));
     return;
   }
 
@@ -86,7 +86,7 @@
   // the double and multiply with the base-2 exponent.
   const int p2 = fb.get_exponent() - (std::numeric_limits<float>::digits - 1);
 
- if(p2 != 0) { operator*=(ef::pow2(static_cast<INT64>(p2))); }
+ if(p2 != 0) { mpfr_mul_2si(rop, rop, static_cast<signed long>(p2), GMP_RNDN); }
 
   if(b_neg)
   {
@@ -347,7 +347,7 @@
   return ((!b_neg) ? dx : -dx);
 }
 
-INT64 mpfr::e_float::extract_int64(void) const
+INT64 mpfr::e_float::extract_signed_long_long(void) const
 {
   const bool b_neg = isneg();
 

Modified: sandbox/e_float/libs/e_float/src/e_float/mpfr/e_float_mpfr_protos.h
==============================================================================
--- sandbox/e_float/libs/e_float/src/e_float/mpfr/e_float_mpfr_protos.h (original)
+++ sandbox/e_float/libs/e_float/src/e_float/mpfr/e_float_mpfr_protos.h 2011-08-07 08:42:26 EDT (Sun, 07 Aug 2011)
@@ -25,6 +25,8 @@
     int mpfr_set_ui (mpfr_ptr, unsigned long, mp_rnd_t);
     int mpfr_set_d (mpfr_ptr, double, mp_rnd_t);
     int mpfr_set_ld (mpfr_ptr, long double, mp_rnd_t);
+ void mpfr_set_inf(mpfr_t, int);
+ void mpfr_set_nan(mpfr_t);
 
     #define mpfr_init_set(x, y, rnd) ( mpfr_init(x), static_cast<void>(mpfr_set ((x), (y), (rnd))))
     #define mpfr_init_set_ui(x, i, rnd) ( mpfr_init(x), static_cast<void>(mpfr_set_ui((x), (i), (rnd))))
@@ -41,6 +43,7 @@
     int mpfr_sub_ui(mpfr_ptr, mpfr_srcptr, unsigned long int, mp_rnd_t);
     int mpfr_mul_ui(mpfr_ptr, mpfr_srcptr, unsigned long int, mp_rnd_t);
     int mpfr_div_ui(mpfr_ptr, mpfr_srcptr, unsigned long int, mp_rnd_t);
+ int mpfr_mul_2si(mpfr_t, mpfr_t, signed long, mp_rnd_t);
 
     int mpfr_cmp3(mpfr_srcptr, mpfr_srcptr, int);
     #define mpfr_cmp(b, c) mpfr_cmp3((b), (c), 1)

Modified: sandbox/e_float/libs/e_float/src/functions/constants/constants.cpp
==============================================================================
--- sandbox/e_float/libs/e_float/src/functions/constants/constants.cpp (original)
+++ sandbox/e_float/libs/e_float/src/functions/constants/constants.cpp 2011-08-07 08:42:26 EDT (Sun, 07 Aug 2011)
@@ -12,55 +12,62 @@
 #include <e_float/e_float_elementary_trans.hpp>
 #include <e_float/e_float_constants.hpp>
 
-const e_float& ef::two (void) { static const e_float val( 2u); return val; }
-const e_float& ef::three (void) { static const e_float val( 3u); return val; }
-const e_float& ef::four (void) { static const e_float val( 4u); return val; }
-const e_float& ef::five (void) { static const e_float val( 5u); return val; }
-const e_float& ef::six (void) { static const e_float val( 6u); return val; }
-const e_float& ef::seven (void) { static const e_float val( 7u); return val; }
-const e_float& ef::eight (void) { static const e_float val( 8u); return val; }
-const e_float& ef::nine (void) { static const e_float val( 9u); return val; }
-const e_float& ef::ten (void) { static const e_float val( 10u); return val; }
-const e_float& ef::twenty (void) { static const e_float val( 20u); return val; }
-const e_float& ef::thirty (void) { static const e_float val( 30u); return val; }
-const e_float& ef::forty (void) { static const e_float val( 40u); return val; }
-const e_float& ef::fifty (void) { static const e_float val( 50u); return val; }
-const e_float& ef::hundred (void) { static const e_float val( 100u); return val; }
-const e_float& ef::two_hundred (void) { static const e_float val( 200u); return val; }
-const e_float& ef::three_hundred(void) { static const e_float val( 300u); return val; }
-const e_float& ef::four_hundred (void) { static const e_float val( 400u); return val; }
-const e_float& ef::five_hundred (void) { static const e_float val( 500u); return val; }
-const e_float& ef::thousand (void) { static const e_float val( 1000u); return val; }
-const e_float& ef::two_k (void) { static const e_float val( 2000u); return val; }
-const e_float& ef::three_k (void) { static const e_float val( 3000u); return val; }
-const e_float& ef::four_k (void) { static const e_float val( 4000u); return val; }
-const e_float& ef::five_k (void) { static const e_float val( 5000u); return val; }
-const e_float& ef::ten_k (void) { static const e_float val( 10000u); return val; }
-const e_float& ef::twenty_k (void) { static const e_float val( 20000u); return val; }
-const e_float& ef::thirty_k (void) { static const e_float val( 30000u); return val; }
-const e_float& ef::forty_k (void) { static const e_float val( 40000u); return val; }
-const e_float& ef::fifty_k (void) { static const e_float val( 50000u); return val; }
-const e_float& ef::hundred_k (void) { static const e_float val( 100000u); return val; }
-const e_float& ef::million (void) { static const e_float val( 1000000u); return val; }
-const e_float& ef::ten_M (void) { static const e_float val( 10000000u); return val; }
-const e_float& ef::hundred_M (void) { static const e_float val( 100000000u); return val; }
-const e_float& ef::billion (void) { static const e_float val(1000000000u); return val; }
-const e_float& ef::trillion (void) { static const e_float val( "1e12"); return val; }
-const e_float& ef::googol (void) { static const e_float val( "1e100"); return val; }
-const e_float& ef::int32max (void) { static const e_float val((std::numeric_limits<INT32>::max)()); return val; }
-const e_float& ef::int32min (void) { static const e_float val((std::numeric_limits<INT32>::min)()); return val; }
-const e_float& ef::int64max (void) { static const e_float val((std::numeric_limits<INT64>::max)()); return val; }
-const e_float& ef::int64min (void) { static const e_float val((std::numeric_limits<INT64>::min)()); return val; }
-const e_float& ef::one_minus (void) { static const e_float val(-1 ); return val; }
-const e_float& ef::tenth (void) { static const e_float val(ef::one() / static_cast<INT32>(10)); return val; }
-const e_float& ef::eighth (void) { static const e_float val(ef::one() / static_cast<INT32>( 8)); return val; }
-const e_float& ef::sixteenth (void) { static const e_float val(ef::one() / static_cast<INT32>(16)); return val; }
-const e_float& ef::fifth (void) { static const e_float val(ef::one() / static_cast<INT32>( 5)); return val; }
-const e_float& ef::quarter (void) { static const e_float val(ef::one() / static_cast<INT32>( 4)); return val; }
-const e_float& ef::third (void) { static const e_float val(ef::one() / static_cast<INT32>( 3)); return val; }
-const e_float& ef::two_third (void) { static const e_float val(ef::two() / static_cast<INT32>( 3)); return val; }
-const e_float& ef::four_third (void) { static const e_float val(ef::four() / static_cast<INT32>( 3)); return val; }
-const e_float& ef::three_half (void) { static const e_float val(ef::one() + ef::half()); return val; }
+const e_float& ef::two (void) { static const e_float val( 2u); return val; }
+const e_float& ef::three (void) { static const e_float val( 3u); return val; }
+const e_float& ef::four (void) { static const e_float val( 4u); return val; }
+const e_float& ef::five (void) { static const e_float val( 5u); return val; }
+const e_float& ef::six (void) { static const e_float val( 6u); return val; }
+const e_float& ef::seven (void) { static const e_float val( 7u); return val; }
+const e_float& ef::eight (void) { static const e_float val( 8u); return val; }
+const e_float& ef::nine (void) { static const e_float val( 9u); return val; }
+const e_float& ef::ten (void) { static const e_float val( 10u); return val; }
+const e_float& ef::twenty (void) { static const e_float val( 20u); return val; }
+const e_float& ef::thirty (void) { static const e_float val( 30u); return val; }
+const e_float& ef::forty (void) { static const e_float val( 40u); return val; }
+const e_float& ef::fifty (void) { static const e_float val( 50u); return val; }
+const e_float& ef::hundred (void) { static const e_float val( 100u); return val; }
+const e_float& ef::two_hundred (void) { static const e_float val( 200u); return val; }
+const e_float& ef::three_hundred (void) { static const e_float val( 300u); return val; }
+const e_float& ef::four_hundred (void) { static const e_float val( 400u); return val; }
+const e_float& ef::five_hundred (void) { static const e_float val( 500u); return val; }
+const e_float& ef::thousand (void) { static const e_float val( 1000u); return val; }
+const e_float& ef::two_k (void) { static const e_float val( 2000u); return val; }
+const e_float& ef::three_k (void) { static const e_float val( 3000u); return val; }
+const e_float& ef::four_k (void) { static const e_float val( 4000u); return val; }
+const e_float& ef::five_k (void) { static const e_float val( 5000u); return val; }
+const e_float& ef::ten_k (void) { static const e_float val( 10000u); return val; }
+const e_float& ef::twenty_k (void) { static const e_float val( 20000u); return val; }
+const e_float& ef::thirty_k (void) { static const e_float val( 30000u); return val; }
+const e_float& ef::forty_k (void) { static const e_float val( 40000u); return val; }
+const e_float& ef::fifty_k (void) { static const e_float val( 50000u); return val; }
+const e_float& ef::hundred_k (void) { static const e_float val( 100000u); return val; }
+const e_float& ef::million (void) { static const e_float val( 1000000u); return val; }
+const e_float& ef::ten_M (void) { static const e_float val( 10000000u); return val; }
+const e_float& ef::hundred_M (void) { static const e_float val( 100000000u); return val; }
+const e_float& ef::billion (void) { static const e_float val(1000000000u); return val; }
+const e_float& ef::trillion (void) { static const e_float val( "1e12"); return val; }
+const e_float& ef::googol (void) { static const e_float val( "1e100"); return val; }
+const e_float& ef::int32_min (void) { static const e_float val((std::numeric_limits<INT32>::min)()); return val; }
+const e_float& ef::int32_max (void) { static const e_float val((std::numeric_limits<INT32>::max)()); return val; }
+const e_float& ef::int64_min (void) { static const e_float val((std::numeric_limits<INT64>::min)()); return val; }
+const e_float& ef::int64_max (void) { static const e_float val((std::numeric_limits<INT64>::max)()); return val; }
+const e_float& ef::unsigned_long_long_max(void) { static const e_float val((std::numeric_limits<unsigned long long>::max)()); return val; }
+const e_float& ef::signed_long_long_min (void) { static const e_float val((std::numeric_limits<signed long long>::min)()); return val; }
+const e_float& ef::signed_long_long_max (void) { static const e_float val((std::numeric_limits<signed long long>::max)()); return val; }
+const e_float& ef::double_min (void) { static const e_float val((std::numeric_limits<double>::min)()); return val; }
+const e_float& ef::double_max (void) { static const e_float val((std::numeric_limits<double>::max)()); return val; }
+const e_float& ef::long_double_min (void) { static const e_float val((std::numeric_limits<long double>::min)()); return val; }
+const e_float& ef::long_double_max (void) { static const e_float val((std::numeric_limits<long double>::max)()); return val; }
+const e_float& ef::one_minus (void) { static const e_float val(-1 ); return val; }
+const e_float& ef::tenth (void) { static const e_float val(ef::one() / static_cast<INT32>(10)); return val; }
+const e_float& ef::eighth (void) { static const e_float val(ef::one() / static_cast<INT32>( 8)); return val; }
+const e_float& ef::sixteenth (void) { static const e_float val(ef::one() / static_cast<INT32>(16)); return val; }
+const e_float& ef::fifth (void) { static const e_float val(ef::one() / static_cast<INT32>( 5)); return val; }
+const e_float& ef::quarter (void) { static const e_float val(ef::one() / static_cast<INT32>( 4)); return val; }
+const e_float& ef::third (void) { static const e_float val(ef::one() / static_cast<INT32>( 3)); return val; }
+const e_float& ef::two_third (void) { static const e_float val(ef::two() / static_cast<INT32>( 3)); return val; }
+const e_float& ef::four_third (void) { static const e_float val(ef::four() / static_cast<INT32>( 3)); return val; }
+const e_float& ef::three_half (void) { static const e_float val(ef::one() + ef::half()); return val; }
 
 const e_float& ef::sqrt2(void)
 {

Modified: sandbox/e_float/libs/e_float/src/functions/elementary/elementary_math.cpp
==============================================================================
--- sandbox/e_float/libs/e_float/src/functions/elementary/elementary_math.cpp (original)
+++ sandbox/e_float/libs/e_float/src/functions/elementary/elementary_math.cpp 2011-08-07 08:42:26 EDT (Sun, 07 Aug 2011)
@@ -12,8 +12,8 @@
 #include <e_float/e_float_elementary.hpp>
 
 #if defined(__GNUC__)
- static inline INT32 _isnan (double x) { return static_cast<INT32>(std::isnan <double>(x)); }
- static inline INT32 _finite(double x) { return static_cast<INT32>(std::isfinite<double>(x)); }
+ static inline int _isnan (double x) { return std::isnan <double>(x); }
+ static inline int _finite(double x) { return std::isfinite<double>(x); }
 #endif
 
 e_float ef::floor(const e_float& x)
@@ -68,14 +68,14 @@
   return v1 - (n * v2);
 }
 
-bool ef::isfinite(const double x) { return static_cast<INT32>(::_finite(x)) == static_cast<INT32>(1); }
-bool ef::isnan (const double x) { return static_cast<INT32>(::_isnan (x)) == static_cast<INT32>(1); }
+bool ef::isfinite(const double x) { return (::_finite(x) != 0); }
+bool ef::isnan (const double x) { return (::_isnan (x) != 0); }
 
 double ef::to_double(const e_float& x) { return x.extract_double(); }
 double ef::to_double(const ef_complex& z) { return ef::to_double(z.real()); }
 
 INT64 ef::to_int64(const double x) { return static_cast<INT64>(x); }
-INT64 ef::to_int64(const e_float& x) { return x.extract_int64(); }
+INT64 ef::to_int64(const e_float& x) { return x.extract_signed_long_long(); }
 INT64 ef::to_int64(const ef_complex& z) { return ef::to_int64(z.real()); }
 
 bool ef::isint(const double x)

Modified: sandbox/e_float/libs/e_float/src/utility/util_power_j_pow_x.cpp
==============================================================================
--- sandbox/e_float/libs/e_float/src/utility/util_power_j_pow_x.cpp (original)
+++ sandbox/e_float/libs/e_float/src/utility/util_power_j_pow_x.cpp 2011-08-07 08:42:26 EDT (Sun, 07 Aug 2011)
@@ -74,7 +74,7 @@
           const e_float rx = real(x);
 
           // Compute pure integer power for pure integer arguments.
- if((rx < ef::int64max()) && (rx > ef::int64min()))
+ if((rx < ef::int64_max()) && (rx > ef::int64_min()))
           {
             pf_pow_x = pown(T(n), ef::to_int64(rx));
           }

Modified: sandbox/e_float/libs/e_float/test/real/cases/test_case_0000z_global_ops_pod.cpp
==============================================================================
--- sandbox/e_float/libs/e_float/test/real/cases/test_case_0000z_global_ops_pod.cpp (original)
+++ sandbox/e_float/libs/e_float/test/real/cases/test_case_0000z_global_ops_pod.cpp 2011-08-07 08:42:26 EDT (Sun, 07 Aug 2011)
@@ -176,6 +176,7 @@
         my_test_result &= (-ef::four() == static_cast<long double>(-4.0));
 
         my_test_result &= (e_float(11.1f) == e_float("11.1000003814697265625"));
+ my_test_result &= (e_float(11.1) == e_float("11.0999999999999996447286321199499070644378662109375"));
 
         my_test_result &= (+ef::pi() > static_cast<float>(+3.14f));
         my_test_result &= (-ef::pi() < static_cast<float>(-3.14f));
@@ -201,6 +202,25 @@
 
         my_test_result &= ((ef::one() * 4.0) == 4);
         my_test_result &= ((4.0 * ef::one()) == 4);
+
+ const e_float huge("1e12345678");
+ const e_float tiny("1e-12345678");
+
+ float f = huge;
+ double d = huge;
+ long double ld = huge;
+
+ my_test_result &= (f == std::numeric_limits<float>::infinity());
+ my_test_result &= (d == std::numeric_limits<double>::infinity());
+ my_test_result &= (ld == std::numeric_limits<long double>::infinity());
+
+ f = tiny;
+ d = tiny;
+ ld = tiny;
+
+ my_test_result &= (f == 0.0f);
+ my_test_result &= (d == 0.0);
+ my_test_result &= (ld == static_cast<long double>(0.0));
       }
     };
 

Modified: sandbox/e_float/libs/e_float/test/spot/test_spot.cpp
==============================================================================
--- sandbox/e_float/libs/e_float/test/spot/test_spot.cpp (original)
+++ sandbox/e_float/libs/e_float/test/spot/test_spot.cpp 2011-08-07 08:42:26 EDT (Sun, 07 Aug 2011)
@@ -18,5 +18,13 @@
 
 void test::spot::test_spot(void)
 {
- std::cout << e_float(0.0) << std::endl;
+ const std::streamsize original_prec = std::cout.precision(std::numeric_limits<e_float>::digits10);
+
+ const e_float x = ef::sqrt(ef::euler_gamma());
+ std::cout << x << std::endl;
+
+ const e_float p = ef::log(ef::pi() * 100);
+ std::cout << p << std::endl;
+
+ std::cout.precision(original_prec);
 }


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