Commit cd60b4b8 by Richard Henderson Committed by Richard Henderson

real.c (real_to_decimal): If the >1 tens reduction loop results in a negative exponent...

        * real.c (real_to_decimal): If the >1 tens reduction loop results
        in a negative exponent, fall into the <1 pten computation.

From-SVN: r58538
parent 06bd49b1
2002-10-25 Richard Henderson <rth@redhat.com>
* real.c (real_to_decimal): If the >1 tens reduction loop results
in a negative exponent, fall into the <1 pten computation.
2002-10-25 Zack Weinberg <zack@codesourcery.com> 2002-10-25 Zack Weinberg <zack@codesourcery.com>
PR middle-end/6994 PR middle-end/6994
......
...@@ -1552,6 +1552,8 @@ real_to_decimal (str, r_orig, buf_size, digits, crop_trailing_zeros) ...@@ -1552,6 +1552,8 @@ real_to_decimal (str, r_orig, buf_size, digits, crop_trailing_zeros)
/* Find power of 10. Do this by dividing out 10**2**M when /* Find power of 10. Do this by dividing out 10**2**M when
this is larger than the current remainder. Fill PTEN with this is larger than the current remainder. Fill PTEN with
the power of 10 that we compute. */ the power of 10 that we compute. */
if (r.exp > 0)
{
m = floor_log2 ((int)(r.exp * M_LOG10_2)) + 1; m = floor_log2 ((int)(r.exp * M_LOG10_2)) + 1;
do do
{ {
...@@ -1565,7 +1567,13 @@ real_to_decimal (str, r_orig, buf_size, digits, crop_trailing_zeros) ...@@ -1565,7 +1567,13 @@ real_to_decimal (str, r_orig, buf_size, digits, crop_trailing_zeros)
} }
while (--m >= 0); while (--m >= 0);
} }
else if (cmp_one < 0) else
/* We managed to divide off enough tens in the above reduction
loop that we've now got a negative exponent. Fall into the
less-than-one code to compute the proper value for PTEN. */
cmp_one = -1;
}
if (cmp_one < 0)
{ {
int m; int m;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment