From c799db173dfecfcb4744c40440cfba3cf412a2f8 Mon Sep 17 00:00:00 2001 From: Daniel Russel Date: Thu, 13 Jul 2006 14:55:16 +0000 Subject: [PATCH] improved overflow handling --- .../Polynomial/internal/Kernel/Rational_between_roots.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Kinetic_data_structures/include/CGAL/Polynomial/internal/Kernel/Rational_between_roots.h b/Kinetic_data_structures/include/CGAL/Polynomial/internal/Kernel/Rational_between_roots.h index fc3085819ac..c2f948bf541 100644 --- a/Kinetic_data_structures/include/CGAL/Polynomial/internal/Kernel/Rational_between_roots.h +++ b/Kinetic_data_structures/include/CGAL/Polynomial/internal/Kernel/Rational_between_roots.h @@ -36,6 +36,12 @@ struct Rational_between_roots Rational_between_roots(const K& k): tii_(k.to_isolating_interval_object()){} + template + static bool is_minf(T r){ + if (std::numeric_limits::has_infinity) return r== -std::numeric_limits::infinity(); + else return false; + } + template result_type operator()(const RT &r0, const RT &r1) const { @@ -45,7 +51,7 @@ struct Rational_between_roots //Ival i0= to_interval(r0); //Ival i1= to_interval(r1); Ival i0= tii_(r0); - if (i0.second == -infinity()) { + if (is_minf(i0.second)) { result_type ret(-33554432); while (r1 <= second_argument_type(ret)) { ret= ret*1024;