Matthew Moss wrote:
> However, _for extra credit_ ...

What about bonus points for using only *integer* arithmetic and no transcendentals?
I wrote C code for that which is hiding somewhere :-)