in reply to Re: Re: (s)printf question: eliminating plus sign before zeros
in thread (s)printf question: eliminating plus sign before zeros

Did someone mention golf:)

printf $_ ? '%+4d' : ' 0', $_ for -4 .. +4; -4 -3 -2 -1 0 +1 +2 +3 +4

Actually it doesn't shorten the code any, but it maybe saves a few microseconds in parsing, both by the computer and the human being. Maybe?


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail
Hooray!

  • Comment on Re: Re: Re: (s)printf question: eliminating plus sign before zeros
  • Download Code