Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restoring lru #896

Merged
merged 3 commits into from
Aug 2, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions mathics/core/convert/mpmath.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ def from_mpmath(
# HACK: use str here to prevent loss of precision
return PrecisionReal(sympy.Float(str(value), precision=precision - 1))
elif isinstance(value, mpmath.mpc):
# Comment mmatera:
# In Python, and mpmath, `0.j` and `0.` equivalent, in the sense
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

equivalent -> are equivalent

# that are considered equal numbers, and have the same associated
# hash.
# In WMA, this is not the case. To produce recover the
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the word "recover"

# Python's behavior, uncomment the following lines:
#
# if value.imag == 0.0:
# return from_mpmath(value.real, precision=precision)
val_re, val_im = value.real, value.imag
Expand Down
Loading