A quick twitter bot, @bc_l
Several months ago, on a whim inspired by an off-hand comment from Chris, I created a bot to bring the wonders of the Unix bc language to twitter.
bc is a command-line calculator that’s fast and has the capacity to do some fairly complex math.
Try it out on the command line:
echo '100 / 10' | bc -l
…Or by sending a direct message to bc_l (if you follow bc_l it will follow you back within a few hours).
I released the code under GPL, and it’s available on github: http://github.com/hmason/tweetbc.
John Cook mentions the bot and makes some great observations in his post three surprises with bc.





1 comment
What version of bc are you running? When I tried to feed my bc 1.06.95 ‘pi’ or ‘i’ it simply sees them as some kind of empty variables with the value zero. Which by the way would explain why echo ‘e(pi*i)’ | bc -l gives me 1 instead of the expected -1.
Leave a Comment