diff options
Diffstat (limited to 'contrib/gdtoa/strtoIg.c')
-rw-r--r-- | contrib/gdtoa/strtoIg.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/contrib/gdtoa/strtoIg.c b/contrib/gdtoa/strtoIg.c index ec46a3e..90c88db 100644 --- a/contrib/gdtoa/strtoIg.c +++ b/contrib/gdtoa/strtoIg.c @@ -61,12 +61,16 @@ strtoIg(CONST char *s00, char **se, FPI *fpi, Long *exp, Bigint **B, int *rvp) if (rv & STRTOG_Inexlo) { swap = 0; b1 = increment(b1); - if (fpi->sudden_underflow - && (rv & STRTOG_Retmask) == STRTOG_Zero) { - b1->x[0] = 0; - b1->x[nw1] = 1L << nb11; - rv1 += STRTOG_Normal - STRTOG_Zero; - rv1 &= ~STRTOG_Underflow; + if ((rv & STRTOG_Retmask) == STRTOG_Zero) { + if (fpi->sudden_underflow) { + b1->x[0] = 0; + b1->x[nw1] = 1L << nb11; + rv1 += STRTOG_Normal - STRTOG_Zero; + rv1 &= ~STRTOG_Underflow; + goto swapcheck; + } + rv1 &= STRTOG_Inexlo | STRTOG_Underflow | STRTOG_Zero; + rv1 |= STRTOG_Inexhi | STRTOG_Denormal; goto swapcheck; } if (b1->wds > nw |