Pi¶
Status: Stable
documented, exercised by the test suite and/or worked examples, with no known limitations recorded.
Description¶
Pi
is pi, with numerical value ~= 3.14159.
Pi is a mathematical constant: it has attributes Constant and Protected,
NumericQ[Pi] is True, and D[Pi, x] is 0. N[Pi, prec] evaluates it to any
precision.
Examples¶
No verified examples yet for this function.
Implementation notes¶
- Attributes
Constant,Protected.Attributes[Pi] = {Constant, Protected};
Attributes: Constant, Protected.
Implementation status¶
Stable — documented, exercised by the test suite and/or worked examples, with no known limitations recorded.
References¶
- Source:
src/info.c - Specification:
docs/spec/builtins/mathematical-constants.md
Notes & additional examples¶
Worked examples¶
The symbol Pi stays exact until you ask for a numeric value, and N[Pi, prec]
delivers it to any requested precision:
Exact special values of the elementary functions are reduced symbolically in
terms of Pi:
Pi arises naturally as the closed form of inverse trigonometric values — and
Cos[Pi/5] evaluates to the golden-ratio surd, a non-obvious exact constructible
number:
As a recognised constant, Pi participates in exact closed forms that you can
then numericalise to high precision — e.g. the Basel value Pi^2/6 to 40
digits:
It is treated as constant by calculus, so its derivative is zero:
Notes¶
Pi is the mathematical constant π. It carries the Constant and Protected
attributes, NumericQ[Pi] is True, and D[Pi, x] is 0. It remains an exact
symbol through symbolic computation — driving the special-value reductions of the
trigonometric and inverse-trigonometric functions — and is evaluated to arbitrary
precision only on demand via N[Pi, prec], which uses the MPFR numeric core.