mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-04-24 19:00:23 +08:00
float.c: handle round-up-to-denorm correctly.
This commit is contained in:
parent
84b5d2c539
commit
4a63c20755
11
float.c
11
float.c
@ -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 */
|
||||
|
Loading…
x
Reference in New Issue
Block a user