Monday, October 21, 2013

Defining Pi

Sometimes, when working in Scheme, I'm surprised that pi is not defined. I'd define it myself, but to what precision? My current method is to exploit Euler's identity to get the basic precision supported by log. Is there a cleaner way to initialise this?

 (define pi (imag-part (log -1)))

No comments: