Tuesday, April 06, 2010

How to calculate PI value?

To find PI (π) value, we can actually compute the arctangent of a specified number 1 multiply by 4.

Suppose you are writing VBA macro, you may use the below function to get PI value.

Function PI() As Double
    PI = 4 * Atn(1)
End Function

NOTE: I assume your Math library does not have PI.

No comments:

Post a Comment

Do provide your constructive comment. I appreciate that.