Learn A New Language
February 21, 2012
I’ve programmed in C before — it’s hard to avoid if you’re a professional programmer — but I won’t claim any particular level of proficiency. Lately I’ve been experimenting with the GMP library for handling multi-precision integers. So it makes sense to rewrite some of my favorite prime-number functions in C/GMP, which you can see on the next page.
I had some trouble getting that to work, both of the C variety and of the GMP variety. Actually, it doesn’t work; there is still something wrong with the
is_prime function. Of course, that’s part of the learning process; if I come back to this in six months, I’ll likely cringe.
You can run the program at http://programmingpraxis.codepad.org/ZfVUDHVf.