bug in Gmpfr input from istream

This commit is contained in:
Luis Peñaranda 2012-08-08 15:16:49 +00:00
parent bd6ab03d21
commit 8e26eb9395
2 changed files with 7 additions and 1 deletions

View File

@ -1082,6 +1082,11 @@ std::istream& operator>>(std::istream& is,Gmpfr &f){
mant=10*mant+(c-'0');
c=is.get();
}
// set the correct sign of the mantissa
if(neg_mant)
mant=-mant;
is.putback(c);
gmpz_eat_white_space(is);

View File

@ -207,7 +207,8 @@ int main(){
CGAL::Gmpzf f;
mpfr_set_inf(plus_infinity.fr(),1);
mpfr_set_inf(minus_infinity.fr(),-1);
_TEST("I/O int",(CGAL::test_io<NT,int>(2145338339));)
_TEST("I/O positive int",(CGAL::test_io<NT,int>(2145338339));)
_TEST("I/O negative int",(CGAL::test_io<NT,int>(-25295236));)
_TEST("I/O double",(CGAL::test_io<NT,double>(.2147483647));)
_TEST("I/O +inf",(CGAL::test_io<NT,NT>(plus_infinity));)
_TEST("I/O -inf",(CGAL::test_io<NT,NT>(minus_infinity));)