|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r73596 - in sandbox/e_float: boost/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/integer
From: e_float_at_[hidden]
Date: 2011-08-07 11:15:15
Author: christopher_kormanyos
Date: 2011-08-07 11:15:12 EDT (Sun, 07 Aug 2011)
New Revision: 73596
URL: http://svn.boost.org/trac/boost/changeset/73596
Log:
- Brought the GMP back-end into conformity with global ops.
- Performed further clean-up of the interface.
Text files modified:
sandbox/e_float/boost/e_float/e_float_base.hpp | 40 ++--
sandbox/e_float/boost/e_float/e_float_efx.hpp | 2
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/efx/e_float_efx.cpp | 2
sandbox/e_float/libs/e_float/src/e_float/gmp/e_float_gmp.cpp | 299 +++++++++++++++++++++++++++++----------
sandbox/e_float/libs/e_float/src/e_float/mpfr/e_float_mpfr.cpp | 2
sandbox/e_float/libs/e_float/src/functions/integer/prime.cpp | 11 -
8 files changed, 251 insertions(+), 109 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 11:15:12 EDT (Sun, 07 Aug 2011)
@@ -63,12 +63,10 @@
virtual ~e_float_base() { }
// Specific special values.
- virtual const e_float_base& my_value_nan(void) const = 0;
- virtual const e_float_base& my_value_inf(void) const = 0;
- virtual const e_float_base& my_value_max(void) const = 0;
- virtual const e_float_base& my_value_min(void) const = 0;
-
- virtual INT32 cmp(const e_float&) const = 0;
+ virtual const e_float& my_value_nan(void) const = 0;
+ virtual const e_float& my_value_inf(void) const = 0;
+ virtual const e_float& my_value_max(void) const = 0;
+ virtual const e_float& my_value_min(void) const = 0;
virtual void precision(const INT32) = 0;
@@ -88,10 +86,14 @@
e_float& mul_signed_long_long(const signed long long);
e_float& div_signed_long_long(const signed long long);
- virtual e_float_base& calculate_inv (void) = 0;
- virtual e_float_base& calculate_sqrt(void) = 0;
+ // Elementary primitives.
+ virtual e_float& calculate_inv (void) = 0;
+ virtual e_float& calculate_sqrt(void) = 0;
+ virtual e_float& negate(void) = 0;
// Comparison functions.
+ virtual INT32 cmp(const e_float&) const = 0;
+
virtual bool isnan (void) const = 0;
virtual bool isinf (void) const = 0;
virtual bool isfinite(void) const = 0;
@@ -100,16 +102,14 @@
virtual bool isone (void) const = 0;
virtual bool isint (void) const = 0;
virtual bool isneg (void) const = 0;
- bool ispos (void) const { return !isneg(); }
-
- virtual e_float_base& negate(void) = 0;
+ bool ispos (void) const { return (!isneg()); }
// Operators pre-increment and pre-decrement.
virtual e_float_base& operator++(void) = 0;
virtual e_float_base& operator--(void) = 0;
- // Fast order-10 range and check.
- INT64 order(void) const { return get_order_approximate(); }
+ // Fast order-10 range check.
+ INT64 order(void) const { return get_order_fast(); }
// Conversion routines.
virtual void extract_parts (double&, INT64&) const = 0;
@@ -125,7 +125,7 @@
virtual bool rd_string(const char* const) = 0;
// Cast operators with all built-in types.
- 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 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()); }
@@ -255,15 +255,15 @@
static bool digits_match_lib_dll_is_ok;
virtual INT64 get_order_exact(void) const = 0;
- virtual INT64 get_order_approximate(void) const = 0;
+ virtual INT64 get_order_fast(void) const = 0;
virtual void get_output_string(std::string& str, INT64& my_exp, const std::size_t number_of_digits) const = 0;
static void wr_string_scientific(std::string& str,
- const INT64 my_exp,
- const std::size_t os_precision,
- const bool my_showpoint,
- const bool my_uppercase,
- const bool trim_trailing_zeros = false);
+ const INT64 my_exp,
+ const std::size_t os_precision,
+ const bool my_showpoint,
+ const bool my_uppercase,
+ const bool trim_trailing_zeros = false);
static void wr_string_fixed(std::string& str,
const INT64 my_exp,
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 11:15:12 EDT (Sun, 07 Aug 2011)
@@ -156,7 +156,7 @@
static UINT32 div_loop_n (UINT32* const u, UINT32 n, const INT32 p);
virtual INT64 get_order_exact(void) const;
- virtual INT64 get_order_approximate(void) const;
+ virtual INT64 get_order_fast(void) const;
virtual void get_output_string(std::string& str, INT64& my_exp, const std::size_t number_of_digits) const;
virtual bool rd_string(const char* const s);
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 11:15:12 EDT (Sun, 07 Aug 2011)
@@ -174,7 +174,7 @@
virtual bool rd_string(const char* const s);
virtual INT64 get_order_exact(void) const;
- virtual INT64 get_order_approximate(void) const;
+ virtual INT64 get_order_fast(void) const;
virtual void get_output_string(std::string& str, INT64& my_exp, const std::size_t number_of_digits) 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 11:15:12 EDT (Sun, 07 Aug 2011)
@@ -197,7 +197,7 @@
virtual bool rd_string(const char* const s);
virtual INT64 get_order_exact(void) const;
- virtual INT64 get_order_approximate(void) const;
+ virtual INT64 get_order_fast(void) const;
virtual void get_output_string(std::string& str, INT64& my_exp, const std::size_t number_of_digits) const;
};
}
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 11:15:12 EDT (Sun, 07 Aug 2011)
@@ -1634,7 +1634,7 @@
}
}
-INT64 efx::e_float::get_order_approximate(void) const
+INT64 efx::e_float::get_order_fast(void) const
{
if(iszero())
{
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 11:15:12 EDT (Sun, 07 Aug 2011)
@@ -33,6 +33,13 @@
static const double value_log2 = 0.3010299956639811952137389;
return value_log2;
}
+
+ bool has_exp_or_has_dec_predicate(const char& c)
+ {
+ return ( (c == static_cast<char>('e'))
+ || (c == static_cast<char>('E'))
+ || (c == static_cast<char>('.')));
+ }
}
void gmp::e_float::init(void)
@@ -68,10 +75,23 @@
::mpf_init(rop);
}
-/*
-gmp::e_float::e_float(const char n);
-gmp::e_float::e_float(const wchar_t n);
-*/
+gmp::e_float::e_float(const char n) : fpclass (ef_finite),
+ prec_elem(ef_digits10_tol)
+{
+ init();
+ const bool b_neg = (std::numeric_limits<char>::is_signed ? (n < static_cast<char>(0)) : false);
+ from_unsigned_long((!b_neg) ? static_cast<unsigned long>(n) : static_cast<unsigned long>(-n));
+ if(b_neg) { ::mpf_neg(rop, rop); }
+}
+
+gmp::e_float::e_float(const wchar_t n) : fpclass (ef_finite),
+ prec_elem(ef_digits10_tol)
+{
+ init();
+ const bool b_neg = (std::numeric_limits<wchar_t>::is_signed ? (n < static_cast<wchar_t>(0)) : false);
+ from_unsigned_long((!b_neg) ? static_cast<unsigned long>(n) : static_cast<unsigned long>(-n));
+ if(b_neg) { ::mpf_neg(rop, rop); }
+}
gmp::e_float::e_float(const signed char n) : fpclass (ef_finite),
prec_elem(ef_digits10_tol)
@@ -464,35 +484,30 @@
gmp::e_float& gmp::e_float::mul_unsigned_long_long(const unsigned long long n)
{
- // Multiply *this with a constant signed integer.
-
- const bool b_n_is_neg = (n < static_cast<INT32>(0));
+ // Multiply *this with a constant unsigned long long.
const bool b_u_is_inf = isinf();
const bool b_n_is_zero = (n == static_cast<INT32>(0));
if(isnan() || (b_u_is_inf && b_n_is_zero))
{
- return *this = std::numeric_limits<e_float>::quiet_NaN();
+ return (*this = std::numeric_limits<e_float>::quiet_NaN());
}
if(b_u_is_inf)
{
- const bool b_result_is_neg = (isneg() != b_n_is_neg);
-
- *this = ((!b_result_is_neg) ? std::numeric_limits<e_float>::infinity()
- : -std::numeric_limits<e_float>::infinity());
-
+ *this = ((!isneg()) ? std::numeric_limits<e_float>::infinity()
+ : -std::numeric_limits<e_float>::infinity());
return *this;
}
- const unsigned long nn = static_cast<unsigned long>(!b_n_is_neg ? n : -n);
-
- ::mpf_mul_ui(rop, rop, static_cast<unsigned long>(nn));
-
- if(b_n_is_neg)
+ if(n > static_cast<unsigned long long>((std::numeric_limits<unsigned long>::max)()))
{
- negate();
+ operator*=(e_float(n));
+ }
+ else
+ {
+ ::mpf_mul_ui(rop, rop, static_cast<unsigned long>(n));
}
// Check for overflow.
@@ -503,10 +518,8 @@
&& (ef::fabs(*this) > (std::numeric_limits<e_float>::max)())
)
{
- const bool b_result_is_neg = (isneg() != b_n_is_neg);
-
- *this = ((!b_result_is_neg) ? std::numeric_limits<e_float>::infinity()
- : -std::numeric_limits<e_float>::infinity());
+ *this = ((!isneg()) ? std::numeric_limits<e_float>::infinity()
+ : -std::numeric_limits<e_float>::infinity());
}
return *this;
@@ -514,8 +527,6 @@
gmp::e_float& gmp::e_float::div_unsigned_long_long(const unsigned long long n)
{
- const bool b_n_is_neg = (n < static_cast<INT32>(0));
-
if(isnan())
{
return *this;
@@ -523,11 +534,8 @@
if(isinf())
{
- const bool b_result_is_neg = (isneg() != b_n_is_neg);
-
- *this = ((!b_result_is_neg) ? std::numeric_limits<e_float>::infinity()
- : -std::numeric_limits<e_float>::infinity());
-
+ *this = ((!isneg()) ? std::numeric_limits<e_float>::infinity()
+ : -std::numeric_limits<e_float>::infinity());
return *this;
}
@@ -542,7 +550,6 @@
{
*this = ((!isneg()) ? std::numeric_limits<e_float>::infinity()
: -std::numeric_limits<e_float>::infinity());
-
return *this;
}
}
@@ -552,13 +559,13 @@
return *this;
}
- const unsigned long un = static_cast<unsigned long>((!b_n_is_neg) ? n : -n);
-
- ::mpf_div_ui(rop, rop, un);
-
- if(b_n_is_neg)
+ if(n > static_cast<unsigned long long>((std::numeric_limits<unsigned long>::max)()))
{
- negate();
+ operator/=(e_float(n));
+ }
+ else
+ {
+ ::mpf_div_ui(rop, rop, static_cast<unsigned long>(n));
}
// Check for underflow.
@@ -569,7 +576,7 @@
&& (ef::fabs(*this) < (std::numeric_limits<e_float>::min)())
)
{
- return *this = ef::zero();
+ return (*this = ef::zero());
}
return *this;
@@ -748,20 +755,33 @@
{
const bool b_neg = isneg();
- const e_float xx = ef::fabs(*this);
+ // Check for non-normal e_float.
+ if(!isfinite())
+ {
+ if(isnan())
+ {
+ return std::numeric_limits<double>::quiet_NaN();
+ }
+ else
+ {
+ return ((!b_neg) ? std::numeric_limits<double>::infinity()
+ : -std::numeric_limits<double>::infinity());
+ }
+ }
- static const e_float dbl_max((std::numeric_limits<double>::max)());
- static const e_float dbl_min((std::numeric_limits<double>::min)());
+ const e_float xx(ef::fabs(*this));
- if(xx > dbl_max)
+ // Check for zero e_float.
+ if(iszero() || (xx < ef::double_min()))
{
- return ((!b_neg) ? (std::numeric_limits<double>::max)()
- : -(std::numeric_limits<double>::max)());
+ return 0.0;
}
- else if(xx < dbl_min)
+
+ // Check if e_float exceeds the maximum of double.
+ if(xx > ef::double_max())
{
- return ((!b_neg) ? (std::numeric_limits<double>::min)()
- : -(std::numeric_limits<double>::min)());
+ return ((!b_neg) ? std::numeric_limits<double>::infinity()
+ : -std::numeric_limits<double>::infinity());
}
const double dx = ::mpf_get_d(xx.rop);
@@ -769,7 +789,54 @@
return ((!b_neg) ? dx : -dx);
}
-INT64 gmp::e_float::extract_signed_long_long(void) const
+long double gmp::e_float::extract_long_double(void) const
+{
+ // Returns the long double conversion of a e_float.
+
+ const bool b_neg = isneg();
+
+ // Check for non-normal e_float.
+ if(!isfinite())
+ {
+ if(isnan())
+ {
+ return std::numeric_limits<long double>::quiet_NaN();
+ }
+ else
+ {
+ return ((!b_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 static_cast<long double>(0.0);
+ }
+
+ // Check if e_float exceeds the maximum of double.
+ if(xx > ef::long_double_max())
+ {
+ return ((!b_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 gmp::e_float::extract_signed_long_long(void) const
{
const bool b_neg = isneg();
@@ -783,46 +850,92 @@
const e_float nx = ef::fabs(xr.extract_integer_part());
- static const e_float n64_max((std::numeric_limits<INT64>::max)());
-
- if(nx > n64_max)
+ if(nx > ef::signed_long_long_max())
{
- return ((!b_neg) ? (std::numeric_limits<INT64>::max)()
- : -(std::numeric_limits<INT64>::max)());
+ return ((!b_neg) ? (std::numeric_limits<signed long long>::max)()
+ : -(std::numeric_limits<signed long long>::max)());
}
if(nx < ef::one())
{
- return static_cast<INT64>(0);
+ return static_cast<signed long long>(0);
}
if(nx.isone())
{
- return ((!b_neg) ? static_cast<INT64>(1) : static_cast<INT64>(-1));
+ return ((!b_neg) ? static_cast<signed long long>(1) : static_cast<signed long long>(-1));
}
static const char c0 = static_cast<char>('\0');
- std::vector<char> str(32u, c0);
+ std::vector<char> str(64u, c0);
mp_exp_t p10;
static_cast<void>(::mpf_get_str(&str[0], &p10, 10, str.size() - 1u, nx.rop));
- std::string str_n64(static_cast<std::size_t>(p10), static_cast<char>('0'));
+ std::string str_sll(static_cast<std::size_t>(p10), static_cast<char>('0'));
- std::copy(str.begin(),
- std::find(str.begin(), str.end(), c0),
- str_n64.begin());
+ std::copy(str.begin(), std::find(str.begin(), str.end(), c0), str_sll.begin());
std::stringstream ss;
+ ss << str_sll;
+ signed long long n;
+ ss >> n;
- ss << str_n64;
+ return ((!b_neg) ? n : -n);
+}
+
+unsigned long long gmp::e_float::extract_unsigned_long_long(void) const
+{
+ if(isneg())
+ {
+ return static_cast<unsigned long long>(extract_signed_long_long());
+ }
+
+ // Make a rounded copy.
+ e_float xr = *this;
+
+ if(isint())
+ {
+ xr += ef::half();
+ }
+
+ const e_float nx = xr.extract_integer_part();
+
+ if(nx > ef::unsigned_long_long_max())
+ {
+ return (std::numeric_limits<unsigned long long>::max)();
+ }
+
+ if(nx < ef::one())
+ {
+ return static_cast<unsigned long long>(0u);
+ }
+
+ if(nx.isone())
+ {
+ return static_cast<unsigned long long>(1u);
+ }
+
+ static const char c0 = static_cast<char>('\0');
- INT64 n;
+ std::vector<char> str(64u, c0);
+
+ mp_exp_t p10;
+
+ static_cast<void>(::mpf_get_str(&str[0], &p10, 10, str.size() - 1u, nx.rop));
+
+ std::string str_sll(static_cast<std::size_t>(p10), static_cast<char>('0'));
+
+ std::copy(str.begin(), std::find(str.begin(), str.end(), c0), str_sll.begin());
+
+ std::stringstream ss;
+ ss << str_sll;
+ unsigned long long n;
ss >> n;
- return ((!b_neg) ? n : -n);
+ return n;
}
gmp::e_float gmp::e_float::extract_integer_part(void) const
@@ -854,12 +967,12 @@
// string extraction with 10 decimal digits.
// Create a format string for 10-digits and scientific notation.
- std::string str_fmt = std::string("%.10RNe");
+ std::string str_fmt = std::string("%.10Fe");
// Get the ten digits.
std::tr1::array<char, 64u> buf = {{ static_cast<char>(0) }};
- ::mpfr_sprintf(buf.data(), str_fmt.c_str(), rop);
+ static_cast<void>(gmp_sprintf(buf.data(), str_fmt.c_str(), rop));
const std::string str = std::string(buf.data());
@@ -882,7 +995,7 @@
return my_exp;
}
-INT64 gmp::e_float::get_order_approximate(void) const
+INT64 gmp::e_float::get_order_fast(void) const
{
const e_float xx = ef::fabs(*this);
@@ -955,13 +1068,50 @@
}
*/
-namespace gmp
+void gmp::e_float::get_output_string(std::string& str, INT64& my_exp, const std::size_t number_of_digits) const
{
- static bool has_exp_or_has_dec_predicate(const char& c)
+ static_cast<void>(my_exp);
+
+ // Create a format string such as "%+.99Fe" in order to extract 100 digits
+ // in scientific notation with the lowercase and noshowpos flags.
+ const std::size_t the_number_of_digits_scientific = static_cast<std::size_t>((std::max)(number_of_digits, static_cast<std::size_t>(1u)) - static_cast<std::size_t>(1u));
+
+ const std::string str_fmt = std::string("%.") + (Util::lexical_cast(the_number_of_digits_scientific) + "Fe");
+
+ // Get the string representation of the e_float in scientific notation (lowercase, noshowpos).
+ std::tr1::array<char, static_cast<std::size_t>(e_float::ef_digits10_tol + 32)> buf = {{ static_cast<char>(0) }};
+
+ static_cast<void>(gmp_sprintf(buf.data(), str_fmt.c_str(), rop));
+
+ str = std::string(buf.data());
+
+ // Obtain the raw digits from the scientific notation string.
+
+ // TBD: Well, this is a bit silly. First get the string in
+ // scientific notation, then reduce it to raw digits.
+ // Perhaps this can be improved.
+ // Get the raw digits from a string in scientific notation (lowercase, showpos).
+
+ // Erase the negative sign, if present.
+ if(str.at(0u) == static_cast<char>('-'))
{
- return ( (c == static_cast<char>('e'))
- || (c == static_cast<char>('E'))
- || (c == static_cast<char>('.')));
+ str.erase(str.begin(), str.begin() + 1u);
+ }
+
+ // Erase the exponent.
+ const std::size_t pos_letter_e = str.rfind(static_cast<char>('e'));
+
+ if(pos_letter_e != std::string::npos)
+ {
+ str.erase(str.begin() + pos_letter_e, str.end());
+ }
+
+ // Erase the decimal point.
+ const std::size_t pos_decimal_point = str.rfind(static_cast<char>('.'));
+
+ if(pos_decimal_point != std::string::npos)
+ {
+ str.erase(str.begin() + pos_decimal_point, str.begin() + (pos_decimal_point + 1u));
}
}
@@ -1004,16 +1154,13 @@
&& str.at(static_cast<std::size_t>(0u)) == static_cast<char>('0')
)
{
- str.erase(static_cast<std::size_t>(0u),
- static_cast<std::size_t>(1u));
+ str.erase(static_cast<std::size_t>(0u), static_cast<std::size_t>(1u));
}
// Scale very long pure integer input strings. Convert these into a string with
// a decimal point and an exponent.
- const std::string::const_iterator it = std::find_if(str.begin(),
- str.end(),
- gmp::has_exp_or_has_dec_predicate);
+ const std::string::const_iterator it = std::find_if(str.begin(), str.end(), ::has_exp_or_has_dec_predicate);
const bool is_pure_integer = (it == str.end());
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 11:15:12 EDT (Sun, 07 Aug 2011)
@@ -534,7 +534,7 @@
return my_exp;
}
-INT64 mpfr::e_float::get_order_approximate(void) const
+INT64 mpfr::e_float::get_order_fast(void) const
{
const e_float xx = ef::fabs(*this);
Modified: sandbox/e_float/libs/e_float/src/functions/integer/prime.cpp
==============================================================================
--- sandbox/e_float/libs/e_float/src/functions/integer/prime.cpp (original)
+++ sandbox/e_float/libs/e_float/src/functions/integer/prime.cpp 2011-08-07 11:15:12 EDT (Sun, 07 Aug 2011)
@@ -31,13 +31,8 @@
void operator()(const bool& bo_is_not_prime) const
{
- const bool bo_is_prime = !bo_is_not_prime;
-
- if(bo_is_prime)
- {
- *it = count;
- }
-
+ const bool bo_is_prime = (!bo_is_not_prime);
+ if(bo_is_prime) { *it = count; }
++count;
}
};
@@ -70,7 +65,7 @@
while((i2 = static_cast<UINT32>(i * i)) < limit)
{
- if(!sieve[i])
+ if(sieve[i] == false)
{
for(UINT32 j = i2; j < limit; j = static_cast<UINT32>(j + i))
{
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