float.c: correct the exponent

We would accidentally produce an exponent which was exactly +1 from
the correct one.
This commit is contained in:
H. Peter Anvin 2007-10-04 22:51:08 -07:00
parent b8e604eb5d
commit cdb227fa71

View file

@ -376,7 +376,7 @@ static int to_float(char *str, int32_t sign, uint8_t *result,
/*
* Normalised.
*/
exponent += expmax;
exponent += expmax-1;
ieee_shr(mant, fmt->exponent);
ieee_round(mant, fmt->words);
/* did we scale up by one? */