Gmpz constructor from double now emits a warning for non-integral values.

This commit is contained in:
Sylvain Pion 2007-04-21 07:46:15 +00:00
parent a50b5877ba
commit fbff6b2945
1 changed files with 4 additions and 1 deletions

View File

@ -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); }