printf formatting issue

Forgive the cross-post. I posted originally in q.p.qnxrtp.os,
then realized this was probably the more appropriate place.

The perl test suite has picked up an error in the printf ‘%e’
formatting. Specifically

printf("%e\n", 0. );

produces 0.000000e+0

whereas the ANSI standard requires at least two digits in the
exponent: 0.000000e+00.

This is a nit, but it impacts the ability to predict what an
output format will produce, and hence what your output will
look like. It also causes at least two of the perl tests to
fail under QNX6, which is a shame.

Norton Allen <allen@huarp.harvard.edu> wrote in
news:3C9FEF89.669EF67E@huarp.harvard.edu:

The perl test suite has picked up an error in the printf ‘%e’
formatting. Specifically

printf("%e\n", 0. );

produces 0.000000e+0

whereas the ANSI standard requires at least two digits in the
exponent: 0.000000e+00.

This is a nit, but it impacts the ability to predict what an
output format will produce, and hence what your output will
look like. It also causes at least two of the perl tests to
fail under QNX6, which is a shame.

Confirmed, ANSI/ISO C, 7.19.6.1(8)

“The exponent always contains at least two digits,
and only as many more digits as necessary to represent the exponent.”

Thanks for pointing it out.


\

Cheers,
Adam

QNX Software Systems Ltd.
[ amallory@qnx.com ]

With a PC, I always felt limited by the software available.
On Unix, I am limited only by my knowledge.
–Peter J. Schoenster <pschon@baste.magibox.net>

Norton Allen <allen@huarp.harvard.edu> wrote:

Thanks Norton,

I’ve submitted a PR.

Best Regards,

Marcin

Forgive the cross-post. I posted originally in q.p.qnxrtp.os,
then realized this was probably the more appropriate place.

The perl test suite has picked up an error in the printf ‘%e’
formatting. Specifically

printf("%e\n", 0. );

produces 0.000000e+0

whereas the ANSI standard requires at least two digits in the
exponent: 0.000000e+00.

This is a nit, but it impacts the ability to predict what an
output format will produce, and hence what your output will
look like. It also causes at least two of the perl tests to
fail under QNX6, which is a shame.

Marcin Dzieciol wrote:

Norton Allen <> allen@huarp.harvard.edu> > wrote:

Thanks Norton,

I’ve submitted a PR.

Sounds good. -Norton

Best Regards,

Marcin

Forgive the cross-post. I posted originally in q.p.qnxrtp.os,
then realized this was probably the more appropriate place.

The perl test suite has picked up an error in the printf ‘%e’
formatting. Specifically

printf("%e\n", 0. );

produces 0.000000e+0

whereas the ANSI standard requires at least two digits in the
exponent: 0.000000e+00.

This is a nit, but it impacts the ability to predict what an
output format will produce, and hence what your output will
look like. It also causes at least two of the perl tests to
fail under QNX6, which is a shame.