- Protect operator>>(MP_Float) against end of stream.

This commit is contained in:
Sylvain Pion 2003-12-04 15:23:09 +00:00
parent f8bcefa10a
commit 5269ae13b2
2 changed files with 8 additions and 4 deletions

View File

@ -1,3 +1,6 @@
4.126 (4 Dec 2003)
- Protect operator>>(MP_Float) against end of stream.
4.125 (1 Dec 2003)
- Quotient<NT> now supports sqrt() iff NT supports it.

View File

@ -54,7 +54,7 @@ MP_Float::MP_Float(double d)
if (d == 0)
return;
CGAL_expensive_assertion(is_finite(d) && is_valid(d));
CGAL_assertion(is_finite(d) && is_valid(d));
CGAL_expensive_assertion_code(double bak = d;)
// This is subtle, because ints are not symetric against 0.
@ -402,9 +402,10 @@ print (std::ostream & os, const MP_Float &b)
std::istream &
operator>> (std::istream & is, MP_Float &b)
{
double i;
is >> i;
b = MP_Float(i);
double d;
is >> d;
if (is)
b = MP_Float(d);
return is;
}