Thread: Pi in VBA?
View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
Prof Wonmug Prof Wonmug is offline
external usenet poster
 
Posts: 61
Default Pi in VBA?

On Mon, 27 Apr 2009 23:09:15 -0700, "JoeU2004"
wrote:

"Rick Rothstein" wrote:
You could just assign the value to a constant directly...
Const PI = 3.14159265358979

Or you can let VB calculate it for you...
PI = 4 * ATN(1)


Your constant for PI does not equal VB 4*Atn(1) or Excel PI().

However, if you enter the constant as 3.141592653589793, that does result in
the same binary value as 4*Atn(1) and PI(), even though VB will not display
the last 3.


This is why I don't want to hard code a trancendental constant.