From fbff6b2945b5735e0bcb85c607d9f07f6e7d6167 Mon Sep 17 00:00:00 2001 From: Sylvain Pion Date: Sat, 21 Apr 2007 07:46:15 +0000 Subject: [PATCH] Gmpz constructor from double now emits a warning for non-integral values. --- Number_types/include/CGAL/GMP/Gmpz_type.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Number_types/include/CGAL/GMP/Gmpz_type.h b/Number_types/include/CGAL/GMP/Gmpz_type.h index be1c64b1756..6a09defc8c9 100644 --- a/Number_types/include/CGAL/GMP/Gmpz_type.h +++ b/Number_types/include/CGAL/GMP/Gmpz_type.h @@ -96,7 +96,10 @@ public: { mpz_init_set_ui(mpz(), l); } Gmpz(double d) - { mpz_init_set_d(mpz(), d); } + { + CGAL_warning_msg(is_integral(d), "Gmpz constructed from non-integral double value"); + mpz_init_set_d(mpz(), d); + } Gmpz(const std::string& str, int base = 10) { mpz_init_set_str(mpz(), str.c_str(), base); }