From d76b1fdd02c60b34ca3ca8de7e77e5353e86cb3b Mon Sep 17 00:00:00 2001 From: Sylvain Pion Date: Fri, 14 Aug 1998 11:32:48 +0000 Subject: [PATCH] This commit was generated by cvs2svn to compensate for changes in r417, which included commits to RCS files with non-trunk default branches. --- .../include/CGAL/Interval_arithmetic.h | 24 +++++++------------ .../Interval_arithmetic/include/CGAL/_FPU.h | 9 ++++--- Packages/Interval_arithmetic/version | 2 +- 3 files changed, 16 insertions(+), 19 deletions(-) diff --git a/Packages/Interval_arithmetic/include/CGAL/Interval_arithmetic.h b/Packages/Interval_arithmetic/include/CGAL/Interval_arithmetic.h index 19f558d52cf..b12937f17ed 100644 --- a/Packages/Interval_arithmetic/include/CGAL/Interval_arithmetic.h +++ b/Packages/Interval_arithmetic/include/CGAL/Interval_arithmetic.h @@ -12,8 +12,8 @@ // release_date : // // file : include/CGAL/Interval_arithmetic.h -// revision : 1.2 -// revision_date : 16 December 1997 +// revision : 1.3 +// revision_date : 6 February 1998 // author(s) : Sylvain Pion // // coordinator : INRIA Sophia-Antipolis () @@ -24,14 +24,6 @@ // - CGAL_Interval_nt_advanced (do the FPU tricks yourself) // - CGAL_Interval_nt (derived from the other one) -/* - * TODO: - * - get/set FPU rounding modes. - * - Check_assertions, when it's needed. - * - don't force (check if it's ok) the precision: long doubles internally - * are great ! - */ - #ifndef CGAL_INTERVAL_ARITHMETIC_H #define CGAL_INTERVAL_ARITHMETIC_H @@ -49,7 +41,9 @@ public: inline CGAL_Interval_nt_advanced(double i, double s) { -// Check assertion i<=s. +#ifndef CGAL_NO_PRECONDITIONS + assert(i<=s); +#endif inf = -i; sup = s; } @@ -214,12 +208,12 @@ public: inline bool operator==(const CGAL_Interval_nt_advanced& d) const { - return (inf>=d.inf && sup>=-d.inf) || (d.inf>=inf && d.sup>=-inf); + return !(*this != d); } inline bool operator!=(const CGAL_Interval_nt_advanced& d) const { - return !(*this == d); + return (*this < d) || (d < *this); } inline bool operator<(const CGAL_Interval_nt_advanced& d) const @@ -229,7 +223,7 @@ public: inline bool operator>(const CGAL_Interval_nt_advanced& d) const { - return (-inf > d.sup); + return (d.sup < -inf); } inline bool operator<=(const CGAL_Interval_nt_advanced& d) const @@ -253,7 +247,7 @@ public: } protected: - // "inf" stores the opposite of the inferior bound. + // "inf" stores the __opposite__ of the inferior bound. // "sup" stores the upper bound of the interval. double inf, sup; }; diff --git a/Packages/Interval_arithmetic/include/CGAL/_FPU.h b/Packages/Interval_arithmetic/include/CGAL/_FPU.h index f350efa1b71..d3c71bf87eb 100644 --- a/Packages/Interval_arithmetic/include/CGAL/_FPU.h +++ b/Packages/Interval_arithmetic/include/CGAL/_FPU.h @@ -12,8 +12,8 @@ // release_date : // // file : include/CGAL/_FPU.h -// revision : 1.2 -// revision_date : 16 December 1997 +// revision : 1.3 +// revision_date : 6 February 1998 // author(s) : Sylvain Pion // // coordinator : INRIA Sophia-Antipolis () @@ -29,6 +29,9 @@ * * I try to make it work with gcc/g++/cc/CC. * And I also try to provide the equivalent assembly code for GNU C. + * + * TODO: Check the exception flags, according to Christoph's remarks/code. + * (ie should we erase all, should we save&restore, etc...) */ #if defined(__osf__) @@ -249,4 +252,4 @@ static inline void _FPU_set_rounding_to_minus_infinity (void) #endif } -#endif +#endif /* _FPU_H */ diff --git a/Packages/Interval_arithmetic/version b/Packages/Interval_arithmetic/version index 20c2796748f..e330fbab07d 100644 --- a/Packages/Interval_arithmetic/version +++ b/Packages/Interval_arithmetic/version @@ -1 +1 @@ -1.2 (16 Dec 97) +1.3 (16 Dec 97)