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.


  • http://blog.bogosity.se/ Andreas Olsson

    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.

  • http://www.glennsnead.wordpress.com Glenn Snead

    And to think I was wasting valuable screen real estate with google or a calculator app all this time.
    The things you can learn from smart women!

  • http://math.hiremebecauseimsmart.com Human Mathematics

    This is awesome. New ways to display nerdiness. (peacocking?)

  • http://www.dancingbison.com Vasudev Ram

    Very cool. I will check it out after bc_l follows me back. I am a fan and long-time user of bc at the UNIX command line and in pipelines or scripts.

    - Vasudev

  • Jaydev

    Interesting.. thanks for sharing