in reply to Different values while applying format specifiers
This is the output that I see for the above codeprintf("%d\n",100 * 3.1); print "10.1 Manipulation\n"; printf("%d\n",100 * 10.1); $c=sprintf("%d\n",100 * 10.1); printf("%.0f\n",100 * 10.1); print $c; print "5.1 Manipulation\n"; printf("%d\n",100 * 5.1); $d=sprintf("%d\n",100 * 5.1); printf("%.0f\n",100 * 5.1); print $d;
310 10.1 Manipulation 1010 1010 1010 5.1 Manipulation 509 510 509
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Different values while applying format specifiers
by kennethk (Abbot) on Aug 26, 2014 at 21:47 UTC | |
|
Re^2: Different values while applying format specifiers
by pme (Monsignor) on Aug 26, 2014 at 22:05 UTC | |
|
Re^2: Different values while applying format specifiers
by Anonymous Monk on Aug 27, 2014 at 11:38 UTC |