Skip to content

Commit 168df81

Browse files
mmaterarocky
authored andcommitted
fixing accuracy
1 parent bf270e5 commit 168df81

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

mathics/builtin/constants.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,10 @@ def get_constant(self, precision, evaluation, preference=None):
118118
return MachineReal(value)
119119
elif preference == "sympy":
120120
if hasattr(self, "sympy_name"):
121-
value = sympy_constant(self.sympy_name, d)
121+
value = sympy_constant(self.sympy_name, d+2)
122122
elif preference == "mpmath":
123123
if hasattr(self, "sympy_name"):
124-
value = mp_constant(self.mpmath_name, d)
124+
value = mp_constant(self.mpmath_name, d+2)
125125
if value:
126126
return PrecisionReal(sympy.Float(str(value), d))
127127
# If the value is not available, return none
@@ -272,8 +272,8 @@ def to_numpy(self, expr=None, **kwargs):
272272
# return mpmath.degree
273273
return numpy.pi / 180
274274

275-
def apply_N(self, precision, evaluation):
276-
"N[Degree, precision_]"
275+
def apply_N(self, precision, evaluation, options={}):
276+
"N[Degree, precision_, OptionsPattern[%(name)s]]"
277277
try:
278278
d = get_precision(precision, evaluation)
279279
except PrecisionValueError:
@@ -311,8 +311,8 @@ class E(MPMathConstant, NumpyConstant, SympyConstant):
311311
numpy_name = "e"
312312
sympy_name = "E"
313313

314-
def apply_N(self, precision, evaluation):
315-
"N[E, precision_]"
314+
def apply_N(self, precision, evaluation, options={}):
315+
"N[E, precision_, OptionsPattern[%(name)s]]"
316316
return self.get_constant(precision, evaluation)
317317

318318

0 commit comments

Comments
 (0)