This is not necessarily the current version of this TIP.
|Title:||A Binary Specifier for [format/scan]|
|Version:||$Revision: 1.3 $|
|Author:||Alexandre Ferrieux <alexandre dot ferrieux at gmail dot com>|
|Created:||Wednesday, 03 December 2008|
This TIP proposes to add a %b specifier to the format and scan commands for working with integers in base-2 representation.
The format and scan commands already have decimal, hexadecimal, and octal support, but people wanting binary today resort to a hack, namely going hexadecimal first and then string mapping the hex digits to their four-bits binary representations. We also already have the "0b" notation as input for expr. This lack is inelegant.
This TIP proposes to reuse the existing binary representation machinery to expose a new %b specifier: