@@ -533,13 +533,13 @@ class dd {
533
533
534
534
// trap for improper offset with large values
535
535
// without this trap, output of values of the for 10^j - 1 fail for j > 28
536
- // and are output with the point in the wrong place, leading to a dramatically off value
536
+ // and are output with the point in the wrong place, leading to a significant error
537
537
if (fixed && (precision > 0 )) {
538
538
// make sure that the value isn't dramatically larger
539
539
double from_string = atof (s.c_str ());
540
540
541
541
// if this ratio is large, then we've got problems
542
- if (std::fabs (from_string / this -> hi ) > 3.0 ) {
542
+ if (std::fabs (from_string / hi) > 3.0 ) {
543
543
544
544
// loop on the string, find the point, move it up one
545
545
// don't act on the first character
@@ -550,11 +550,13 @@ class dd {
550
550
break ;
551
551
}
552
552
}
553
+ // BUG: the loop above, in particular s[i-1] = '.', destroys the leading 0
554
+ // in the fixed point representation if the point is located at i = 1;
553
555
554
556
from_string = atof (s.c_str ());
555
557
// if this ratio is large, then the string has not been fixed
556
- if (std::fabs (from_string / this -> hi ) > 3.0 ) {
557
- // error("Re -rounding unsuccessful in large number fixed point trap.") ;
558
+ if (std::fabs (from_string / hi) > 3.0 ) {
559
+ std::cerr << " re -rounding unsuccessful in large number fixed point trap\n " ;
558
560
}
559
561
}
560
562
}
0 commit comments