I have found one more problem:

I'm getting following:
bash -c 'printf "x%+fx\n" -0'
x+0.000000x

where it should be:
x-0.000000x

This is cause by:

/* round off to the precision */
#define ROUND(d, p) \
            (d < 0.) ? \
             d - pow_10(-(p)->precision) * 0.5 : \
             d + pow_10(-(p)->precision) * 0.5

where (-0 < 0.) isn't true.

And there is probably no easy solution for this:

http://en.wikipedia.org/wiki/Signed_zero

Thanks,

Petr

On 04/16/12 01:14 AM, Chet Ramey wrote:
On 4/13/12 9:57 AM, Petr Sumbera wrote:
On 04/13/12 03:18 PM, Petr Sumbera wrote:

Problem 2:
==========

bash -c 'printf "x%+010.0fx\n" 123'
x000000+123x

where it should be:
x+000000123x

Fixed in chunk #3 (but the problem is there also for other types!).

My fix breaks following case:

Thanks, the patches are very helpful.

Chet


Reply via email to