Skip to content

Commit 0cce3c3

Browse files
authored
Merge pull request #1395 from mathics/pi-doc
Go over Pi doc to make clearer numeric precision and numpy method
2 parents cd30f43 + 6c2a032 commit 0cce3c3

1 file changed

Lines changed: 9 additions & 10 deletions

File tree

mathics/builtin/numbers/constants.py

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -466,19 +466,18 @@ class Pi(_MPMathConstant, _SympyConstant):
466466
>> N[Pi]
467467
= 3.14159
468468
469-
Force using the value given from numpy to compute Pi.
470-
>> N[Pi, Method->"numpy"]
471-
= 3.14159
469+
Pi to a numeric precision of 20 digits:
470+
>> N[Pi, 20]
471+
= 3.1415926535897932385
472+
473+
Note that the above is not the same thing as the number of digits <i>after</i> the decimal point. This may differ from similar concepts from other mathematical libraries, including those which Mathics uses!
472474
473-
Force using the value given from sympy to compute Pi to 3 places,
474-
two places after the decimal point.
475+
Use numpy to compute Pi to 20 digits:
476+
>> N[Pi, 20, Method->"numpy"]
477+
= 3.1415...
475478
476-
Note that sympy is the default method.
477-
>> N[Pi, 3, Method->"sympy"]
478-
= 3.14
479+
"sympy" is the default method.
479480
480-
>> N[Pi, 50]
481-
= 3.1415926535897932384626433832795028841971693993751
482481
>> Attributes[Pi]
483482
= {Constant, Protected, ReadProtected}
484483
"""

0 commit comments

Comments
 (0)