manual:chapter6:constants:cmd_piconst

This is an old revision of the document!



Synopsis


Push the symbolic constant 'π' on the stack

Stack Diagram


Input Stack Output Stack
'π'
Level 1 Level 1

Legend

Type Analytic Function
Parallel list processing Group 1
Affected by flags None

Description


The π function pushes on the stack a symbolic representation of the constant $π$.

Application of the →NUM operator returns its closest approximation to 2000-digits accuracy, irrespective of the numeric precision defined by SETPREC. This is done to ensure maximum accuracy.

Compatibility


This command is only partially compatible with userRPL.

In particular:

  • userRPL returns the closest approximation of $π$ to 12-digits accuracy.

Usage


The following program

« 6 SETPREC
  π →NUM
  DUP
  1 *
»

will result in

2:                3.14159265359.
1:                      3.14159.
……………………………………………………………………………………

Related Commands


Overloadable operators 26 3 NEW

Operator Short Description
Evaluation operators:
EVAL1 Evaluate one level NEW
EVAL Evaluate full depth
XEQ Execute NEW
→NUM Compute numeric result
Test operators:
== Equality test
Not equal test
< Less than test
Less than or equal test
> Greater than test
Greater than or equal test
CMP Comparison test (<0 if A<B, 0 if A==B, >0 if A>B) NEW
SAME Comparison test, true if objects are the same
ISTRUE True test NEW
Logical operators:
AND Logical AND
OR Logical OR
XOR Logical XOR
NOT Logical NOT
Mathematic operators:
+ Addition
- Subtraction
* Multiplication
/ Division
^ Power
XROOT Root
INV Inverse
NEG Negate/change sign
ABS Magnitude or absolute value
  • manual/chapter6/constants/cmd_piconst.1571556630.txt.gz
  • Last modified: 2019/10/20 00:30
  • by jojo1973