Units in Emacs Calc

As many of you know, I’m a big fan of Emacs Calc and use it as my calculator of choice whenever I’m on my laptop. Calc has robust conversion capabilities—to convert miles to kilometers, e.g.—but it can be a bit tricky to use.

Not to worry. Nicolas Martyanoff has a very nice post that explains how to use units with Calc. You can do things like add meters to centimeters and simplify the results, convert between units, and even define custom units.

The hardest part for me is remembering the unit abbreviations. Calc, of course, will list them for you and you eventually learn the ones you use regularly. One odd thing about Calc is that the conversion between temperature units—Fahrenheit to Celsius, say—doesn’t work the way you think it would. If you try to convert 32°F to Celsius, you get 17.7777777778°C instead of the expected 0°C. The manual explains this as Calc treating the temperatures as relative temperatures so a change of 32°F corresponds to a change of 17.7777777778°C. What’s really going on, of course, is that most conversions involve a simple multiplicative constant whereas with temperatures there’s also an additive constant. Fortunately, Calc has a separate command (u t) to do temperature conversions.

If you’re a Calc user or just want a handy way of making conversions, take a look at Martyanoff’s post. It’s short and well worth a couple of minutes of your time.

This entry was posted in General and tagged . Bookmark the permalink.