Make printf respect the rounding mode for decimal output (bug 5044)

Roland McGrath roland@hack.frob.com
Fri Sep 14 17:21:00 GMT 2012


> @@ -955,34 +954,31 @@ ___printf_fp (FILE *fp,
>        }
>  
>      /* Do rounding.  */
> -    digit = hack_digit ();
> -    if (digit > L'4')
> +    wchar_t last_digit = *(wcp - 1) != decimalwc ? *(wcp - 1) : *(wcp - 2);

Usual style is "wcp[-1]".

I don't see any substantive issues with the code, but I don't really
understand it.


Thanks,
Roland



More information about the Libc-alpha mailing list