-
Notifications
You must be signed in to change notification settings - Fork 65
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
Cannot convert Rational to float #227
Comments
@Wrzlprmft thank you for the bug report. @isuruf fixed it in #265. |
Unfortunately the fix (or some other recent change) seems to destroy my work-around (see neurophysik/jitcdde#17). More specifically, Can you either make a release (that allows me to pinpoint the version requirements) or implement a |
That fix should be backwards compatible. Which version of symengine are you using? |
I am comparing a version I pulled a few minutes ago from GitHub and the latest pre-release from PyPI (0.3.1.dev1). What I need something that converts any of SymEngine’s non-complex number types (Integer, Rational, Float, …) to a Python Suppose |
@Wrzlprmft is the issue that you are trying to make your code work with multiple versions of symengine? Could one have a check based on a version of symengine and do what works for each? I understand that's not ideal, but at least it's some way forward. |
@Wrzlprmft, use |
Correct. Alternatively, I can deal with this using explicitly requiring a version, but that would require a release.
Indeed. That solves my problem. Thank you. |
@Wrzlprmft perfect, I am glad it's solved. Sorry about the inconvenience. |
raises a
TypeError
.The best workaround I found so far is
float(x.n().real_part())
.The text was updated successfully, but these errors were encountered: