diff options
author | H. Peter Anvin <hpa@zytor.com> | 2007-10-30 01:13:09 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2007-10-30 01:13:09 -0700 |
commit | 4a63c20755f0a5a187d21fe1b3ebd1c01b6e7a50 (patch) | |
tree | 73c87501a55074c3627ae20ce87c10f8d7147dd3 /float.c | |
parent | 84b5d2c539fed35b0d350cbccb38938b10c42f96 (diff) | |
download | nasm-4a63c20755f0a5a187d21fe1b3ebd1c01b6e7a50.tar.gz nasm-4a63c20755f0a5a187d21fe1b3ebd1c01b6e7a50.tar.bz2 nasm-4a63c20755f0a5a187d21fe1b3ebd1c01b6e7a50.zip |
float.c: handle round-up-to-denorm correctly.
Diffstat (limited to 'float.c')
-rw-r--r-- | float.c | 11 |
1 files changed, 3 insertions, 8 deletions
@@ -724,20 +724,15 @@ static int to_float(const char *str, int s, uint8_t * result, exponent--; if (exponent >= 2 - expmax && exponent <= expmax) { type = FL_NORMAL; - } else if (exponent < 2 - expmax && - exponent >= 2 - expmax - fmt->mantissa) { - type = FL_DENORMAL; } else if (exponent > 0) { if (pass0 == 1) error(ERR_WARNING|ERR_WARN_FL_OVERFLOW, "overflow in floating-point constant"); type = FL_INFINITY; } else { - /* underflow */ - if (pass0 == 1) - error(ERR_WARNING|ERR_WARN_FL_UNDERFLOW, - "underflow in floating-point constant"); - type = FL_ZERO; + /* underflow or denormal; the denormal code handles + actual underflow. */ + type = FL_DENORMAL; } } else { /* Zero */ |