extmath.nim

I’m still not quite certain what I want to do with the geology application, so I’ve put that on hold for now. In the meantime, I’ve started working on other things.

I while ago I discovered a programming language called Nimrod, and absolutely loved it. It’s syntax is very reminiscent of Python, but it’s also compiled and statically typed. To help teach myself this language, I started porting my JavaScript math library to Nimrod.

The result is (very creatively named) extmath.nim. The functions are almost exactly the same as in the original, with a few exceptions. First, as Nimrod is statically typed, you can’t pass any argument to a function; it has to be of the correct type. Because of this some of the functions are overloaded, with one for ints and another for floats. Second, the Complex class is missing, as Nimrod already has a better implementation. Third, some things (like reverseFactorial()) I simply can’t implement due to the lack of a float modulus operator.

Anyway, the code is all done, and is available on GitHub. The functions are all documented, but only in the code; I haven’t finished converting the rest of the documentation.

Advertisements