Peculiar number formatting?

"David McClain (as dbm at refined-audiometrics dot com)" <[email protected]> Tue, 19 May 2026 03:07:50 -0700
Newsgroups gmane.lisp.lispworks.general
Message-ID <[email protected]>
While developing some simulation code for 24-bit DSP arithmetic, I ran into what appeared at first to be incorrect number formatting.

(format t “~6,’0x”  -1)  =>  0000-1

instead of -000001, or even -00001 if you insist on the width control of 6.

Indeed, even this is peculiar to me:

(format t “~6,’0@d” 1)  =>  0000+1

I have been around for more than 55 years in programming, and I have never before seen numbers displayed like this. It is almost as though we are working in ancient COBOL banking times where the width control is completely divorced from the numeric display, and you want to be sure to fill the field excess with a printed character to prevent check cashing fraud. “*****1.20"

I did cross check with SBCL and found the same behavior. And there were no examples of negative values being printed in fixed radix format in the HyperSpec.

I wonder what the Lisp world was thinking when they decided to standardize on this kind of format output?? COBOL era?