File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ def mp_constant(fn: str, d=None) -> mpmath.ctx_mp_python.mpf:
2929 if d is None :
3030 return getattr (mpmath , fn )()
3131 else :
32- # TODO: In some function like Pi, you can
32+ # TODO: In some functions like Pi, you can
3333 # ask for a certain number of digits, but the
3434 # accuracy will be less than that. Figure out
3535 # what's up and compensate somehow.
@@ -434,7 +434,19 @@ class Pi(MPMathConstant, SympyConstant):
434434
435435 >> N[Pi]
436436 = 3.14159
437- >> N[Pi, 50]
437+
438+ Force using the value given from numpy to compute Pi.
439+ >> N[Pi, Method->"numpy"]
440+ = 3.14159
441+
442+ Force using the value given from sympy to compute Pi to 3 places,
443+ two places after the decimal point.
444+
445+ Note that sympy is the default method.
446+ >> N[Pi, 3, Method->"sympy"]
447+ = 3.14
448+
449+ >> N[Pi, 50]
438450 = 3.1415926535897932384626433832795028841971693993751
439451 >> Attributes[Pi]
440452 = {Constant, Protected, ReadProtected}
You can’t perform that action at this time.
0 commit comments