Jack Diederich <jack at performancedrivers.com> writes: > > However... if %b were to represent arbitrary bases, I think that's > > backwards. It should be %[<pad>][.<base>]b, which would do this: > > > > >>> '%08b %08o %08d %08x' % 12 > > '00001100 00000014 00000012 0000000C' > > > > Were I BDFAD (not to be confused with BD-FOAD) I'd add %b, %B and, binary() > to match %x, %X, and hex(). The arbitrary base case isn't even academic > or we would see homework questions about it on c.l.py. No one asks about > hex or octal because they are there. No one asks about base seven > formatting because everyone knows numerologists prefer Perl. BTW, Perl already do binary literals and %b formatting so there is some precedence for it: $ perl -e '$a = 0b1100; printf "%08b %08o %08d %08x\n", $a, $a, $a, $a' 00001100 00000014 00000012 0000000c --Gisle
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4