Skip to content

Commit

Permalink
Revert "fix N (#106)"
Browse files Browse the repository at this point in the history
This reverts commit 66bd00f.
  • Loading branch information
mmatera authored Jan 10, 2022
1 parent 66bd00f commit 7649edb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ Internals
Bugs
++++

* ``First``, ``Rest`` and ``Last`` now handle invalid arguments (issue #104).
* ``N`` now handles properly the conversion of large integers to PrecisionReal (issue #103).
* ``First``, ``Rest`` and ``Last`` now handle invalid arguments.

4.0.1
-----
Expand Down
8 changes: 3 additions & 5 deletions mathics/core/atoms.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,9 @@ def to_python(self, *args, **kwargs):

def round(self, d=None) -> typing.Union["MachineReal", "PrecisionReal"]:
if d is None:
try:
return MachineReal(float(self.value))
except:
d = 15
return PrecisionReal(sympy.Float(self.value, d))
return MachineReal(float(self.value))
else:
return PrecisionReal(sympy.Float(self.value, d))

def get_int_value(self) -> int:
return self.value
Expand Down

0 comments on commit 7649edb

Please sign in to comment.