Remove force_ieee_double_precision(); as this is a global side effect; TODO: Add preconditions in the operations which require this setting

This commit is contained in:
Andreas Fabri 2008-10-17 13:14:08 +00:00
parent 096bffba4b
commit 5a52575d39
4 changed files with 6 additions and 21 deletions

View File

@ -77,6 +77,8 @@ Polynomial modular_filtered_gcd(const Polynomial& p1, const Polynomial& p2){
}
int main(){
// Enforce IEEE double precision (on i386/Windows)
CGAL::Protect_FPU_rounding<true> pfr(CGAL_FE_TONEAREST);
CGAL::set_pretty_mode(std::cout);
typedef CGAL::Gmpz NT;

View File

@ -32,20 +32,7 @@
CGAL_BEGIN_NAMESPACE
// fwd
void force_ieee_double_precision();
#ifdef CGAL_HAS_THREADS
#else
namespace CGALi{
struct Modular_arithmetic_needs_ieee_double_precision{
Modular_arithmetic_needs_ieee_double_precision(){
CGAL::force_ieee_double_precision();
}
};
} // namespace CGALi
#endif
class Residue;
@ -89,7 +76,6 @@ private:
prime_int_.reset(new int(67111067));
prime_.reset(new double(67111067.0));
prime_inv_.reset(new double(1.0/67111067.0));
CGAL::force_ieee_double_precision();
}
static inline int get_prime_int(){
@ -116,9 +102,6 @@ private:
static int get_prime_int(){ return prime_int;}
static double get_prime() { return prime;}
static double get_prime_inv(){ return prime_inv;}
// calls force_ieee_double_precision(); within constructor
static const CGALi::Modular_arithmetic_needs_ieee_double_precision
modular_arithmetic_needs_ieee_double_precision;
#endif
/* Quick integer rounding, valid if a<2^51. for double */

View File

@ -29,9 +29,7 @@ boost::thread_specific_ptr<double> Residue::prime_inv_;
int Residue::prime_int = 67111067;
double Residue::prime = 67111067.0;
double Residue::prime_inv =1/67111067.0;
const CGALi::Modular_arithmetic_needs_ieee_double_precision
Residue::modular_arithmetic_needs_ieee_double_precision
= CGALi::Modular_arithmetic_needs_ieee_double_precision();
#endif
const double Residue::CST_CUT = std::ldexp( 3., 51 );

View File

@ -13,7 +13,9 @@
#include <CGAL/number_utils.h>
int main()
{
{
// Enforce IEEE double precision (on i386/Windows)
CGAL::Protect_FPU_rounding<true> pfr(CGAL_FE_TONEAREST);
typedef CGAL::Residue NT;
typedef CGAL::Field_tag Tag;
typedef CGAL::Tag_true Is_exact;