How geeks celebrate a birthday AKA bin2dec
Thursday, August 30th, 2012Far away from Rosetta Code, but that’s what Frank and I came up with when explaining 100000₂: Guile: guile <<< \#b100000 guile -c ‘((@@ (ice-9 format) format) #t “~d~%” #b100000)’ Racket: racket -e ‘#b100000’ Ruby: ruby -e ‘puts “100000”.to_i(2)’ Python: python -c ‘print int(“100000”, 2)’ Perl: perl -e ‘print 0b100000’ Zsh: zsh -c ‘print $((2#100000))’ […]