This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


> @@ -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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]