perlmonksuser has asked for the wisdom of the Perl Monks concerning the following question:
$a=5.10; $c=10.10; $b=$a*100; $d=$c*100; printf("%d\n",$b); printf("%u\n",$d);
This gives me the output 509 and 1010. However when I just use print and log the values I get 510 and 1010. Why is there a difference when I use %d and %ld in case of printf/sprintf?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Different values while applying format specifiers
by kennethk (Abbot) on Aug 25, 2014 at 18:46 UTC | |
Re: Different values while applying format specifiers
by toolic (Bishop) on Aug 25, 2014 at 18:05 UTC | |
Re: Different values while applying format specifiers
by Anonymous Monk on Aug 25, 2014 at 18:47 UTC | |
Re: Different values while applying format specifiers
by perlmonksuser (Initiate) on Aug 26, 2014 at 20:25 UTC | |
by kennethk (Abbot) on Aug 26, 2014 at 21:47 UTC | |
by pme (Monsignor) on Aug 26, 2014 at 22:05 UTC | |
by Anonymous Monk on Aug 27, 2014 at 11:38 UTC |
Back to
Seekers of Perl Wisdom