2008-10-06 Eric Blake <ebb9@byu.net>
* libc/stdlib/ldtoa.c (etoasc): Fix rounding to even when fraction is 0.5 or 0.75.
This commit is contained in:
@ -3153,7 +3153,7 @@ if( digit > 4 )
|
||||
emovo( y, t, ldp );
|
||||
if( ecmp(t,ezero) != 0 )
|
||||
goto roun; /* round to nearest */
|
||||
if( (*(s-1) & 1) == 0 )
|
||||
if( ndigs < 0 || (*(s-1-(*(s-1)=='.')) & 1) == 0 )
|
||||
goto doexp; /* round to even */
|
||||
}
|
||||
/* Round up and propagate carry-outs */
|
||||
|
Reference in New Issue
Block a user