develooper Front page | perl.perl5.porters | Postings from January 2003

Re: [perl #20339] Possible sprintf problem in perl5.8.0

Thread Previous | Thread Next
January 16, 2003 08:53
Re: [perl #20339] Possible sprintf problem in perl5.8.0
Message ID:
Jason Lee (via RT) <> wrote:
:After compiling and installing perl 5.8.0 without any problems I have
:encountered some weird behaviour with sprintf.
:This was highlighted by a failing "make test" of Text-Autoformt-1.04 module
:and later by some simple sprintf examples which can all be found as detailed
:Simple example
:# perl -e 'print sprintf "%6.2lf\n", 1;'
:# perl -e 'print sprintf "%6.2f\n", 1;'
:  1.00

One of the side-effects of improvements to the sprintf code for 5.8.0
was stricter checking of size modifiers.

The docs for my local C library sprintf suggest that the "l" modifier
is relevant only for integer conversions and the "s" and "n" formats;
long doubles should be requested using "L", "q" or "ll". Do you have
reason to believe that "l" should also be supported? If not, I'd
suggest that Text-Autoformat may be wrong here.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About