Date: Thu, 15 Feb 1996 16:55:28 EET
Reply-To: Arjen Raateland <raateland@VYH.FI>
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: Arjen Raateland <raateland@VYH.FI>
Organization: National Board of Waters and the Environment
Subject: Re: SAS and the value of PI
In article <jsw-1402961336410001@slip-55-14.ots.utexas.edu>,
jsw@mail.utexas.edu (Jon Wainwright) writes:
> Simple question: How do you represent the value PI in SAS? After looking
> in vain for half an hour through the admittedly incomplete documentation
> that I possess, I finally gave up and just typed the value in as a
> constant. Thanks in advance. Jon Wainwright, University of Texas at
> Austin
>
> --
> ******************************
> Jon Wainwright
> LBJ School of Public Affairs
> University of Texas at Austin
> e-mail: jsw@mail.utexas.edu
> ******************************
Isn't this the old trick that FORTRAN programmers use:
PI = 4 * ATAN(1)
ATAN is probably used because calculation of other inverse
trigonometric functions are based on ATAN calculations.
If you need it in a DATA step, you could do better than having it
recalculated for each and every observation in the data. Use this:
if _N_=1 then PI=4*ATAN(1) ;
Please check that I haven't made a mistake, though.
--... ...-- -.. . --- .... ..--- --.. .- --..
Arjen Raateland, SAS Support
Finnish Environment Agency
Helsinki, Finland
.-.-. -.-