Happy Pi Day, 2016

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Happy Pi Day, 2016

Bruce Weaver
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/).
Reply | Threaded
Open this post in threaded view
|

Re: Happy Pi Day, 2016

Jon Peck
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?
* 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
[hidden email]
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.

--
View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Happy-Pi-Day-2016-tp5731740.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD



--
Jon K Peck
[hidden email]

===================== To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: Happy Pi Day, 2016

Bruce Weaver
Administrator
Gee, thanks Jon!  ;-)


Jon Peck wrote
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?
> * 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
> [hidden email]
> http://sites.google.com/a/lakeheadu.ca/bweaver/
>
> "When all else fails, RTFM."
>
> NOTE: My Hotmail account is not monitored regularly.
> To send me an e-mail, please use the address shown above.
>
> --
> View this message in context:
> http://spssx-discussion.1045642.n5.nabble.com/Happy-Pi-Day-2016-tp5731740.html
> Sent from the SPSSX Discussion mailing list archive at Nabble.com.
>
> =====================
> To manage your subscription to SPSSX-L, send a message to
> [hidden email] (not to SPSSX-L), with no body text except the
> command. To leave the list, send the command
> SIGNOFF SPSSX-L
> For a list of commands to manage subscriptions, send the command
> INFO REFCARD
>



--
Jon K Peck
[hidden email]

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
--
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/).