Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: printf not behaving as expected

by eyepopslikeamosquito (Canon)
on May 04, 2012 at 02:30 UTC ( #968848=note: print w/ replies, xml ) Need Help??


in reply to printf not behaving as expected

Running this test program:

my $v = 123456789012345; printf "%d %ld %u %15.0f %s\n", $v, $v, $v, $v, $v;
on my 32-bit perl 5.8 produces:
-1 -1 4294967295 123456789012345 123456789012345
So it looks like %s and %15.0f are worth a shot.

Later versions of Perl on certain platforms might further support %ll and %q (C "long long" et al type, typically 64-bit integers) according to sprintf.


Comment on Re: printf not behaving as expected
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://968848]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (16)
As of 2015-07-07 14:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (89 votes), past polls