|
Administrator
|
* Q. How can I get the value of the constant pi in SPSS?
* A. You can use the method shown in this IBM Technote: http://www-01.ibm.com/support/docview.wss?uid=swg21476209. DATA LIST free / Case (F1) Note (A45). BEGIN DATA 1 "Computed using SPSS ARTAN function" 2 "Copied from http://www.piday.org/million/" END DATA. DO IF Case EQ 1. - COMPUTE Pi = 4*ARTAN(1). ELSE. - COMPUTE Pi = 3.141592653589793. END IF. FORMATS Pi (F20.15). LIST Pi Note. Pi Note 3.141592653589793 Computed using SPSS ARTAN function 3.141592653589793 Copied from http://www.piday.org/million/ Number of cases read: 2 Number of cases listed: 2 * As you can see, 4*ARTAN(1) returns the value * of Pi to 15 decimals. That should be good * enough for most applications.
--
Bruce Weaver bweaver@lakeheadu.ca http://sites.google.com/a/lakeheadu.ca/bweaver/ "When all else fails, RTFM." PLEASE NOTE THE FOLLOWING: 1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above. 2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/). |
|
or, for Bruce's benefit: begin program. import spss, math spss.Submit("compute PI = %s" % math.pi) end program. On Mon, Mar 14, 2016 at 3:00 PM, Bruce Weaver <[hidden email]> wrote: * Q. How can I get the value of the constant pi in SPSS? |
|
Administrator
|
Gee, thanks Jon! ;-)
--
Bruce Weaver bweaver@lakeheadu.ca http://sites.google.com/a/lakeheadu.ca/bweaver/ "When all else fails, RTFM." PLEASE NOTE THE FOLLOWING: 1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above. 2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/). |
| Free forum by Nabble | Edit this page |
