If it won't be simple, it simply won't be. [Hire me, source code]
#!/bin/bash# Show binary representation of a numberif [ $# -ne 1 ]; then echo "usage: `basename $0` NUMBER" 1>&2 exit 1fiecho "obase=2; $1" | bc -l
This is a handy trick to get an idea of what small, unsigned whole-number decimals might look like as binary. Nice!Actual binary representation, however, is best left to hardware implementers. :)
This is a handy trick to get an idea of what small, unsigned whole-number decimals might look like as binary. Nice!
ReplyDeleteActual binary representation, however, is best left to hardware implementers. :)