Emacs and Bignums

Nic Ferrier has a great post on using bignums with Emacs Lisp. Elisp, of course, does not support bignums but Ferrier has a trick: use the Elisp interface to calc, which does support bignums, to make the necessary calculations.

Ferrier was working on a project that required him to interface with MongoDB. In particular, he had to deal with a datetime field, which is a 64 bit integer. Elisp’s integers are only 29 bits so special sorcery was required. After some research on #emacs, Ferrier solved the problem by using calc-eval. Be sure to follow the link and read about the details. It’s a great solution and shows how it is possible to make bignum calculations from Elisp.

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