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
Fix rounding ZZ -> Python float #16385
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Branch: u/jdemeyer/ticket/16385 |
Commit: |
New commits:
|
Reviewer: Christoph Lauter, Marc Mezzarobba |
comment:6
Looks good to me. But Christoph Lauter sitting next to me noticed that expressions like Another minor issue is that your
But I don't know if we really want to go into this kind of business in sage, and your patch clearly improves the previous implementation. So I'll give it positive review and let you decide if you want to support FP flags and non-default rounding modes. Christoph also suggests to simplify the code a bit by remplacing the part that rounds from 64 to 63 bits by something like
(Of course, this version also assumes that the FPU rounds to nearest.) |
comment:7
Another minor point in case you decide to further improve the implementation: why test it with |
Changed branch from u/jdemeyer/ticket/16385 to |
Consider the following conversions:
A. Sage
Integer
-> Pythonfloat
(or SageRDF
)B. Python
int
/long
-> Pythonfloat
C. Sage
Integer
-> SageRR
D. C
unsigned long
-> Cdouble
Conversion A rounds to zero, while the others round to nearest (by default). We should make A consistent with the rest:
Currently,
Integer
->float
usesmpz_get_d()
which rounds to zero. We should fix this, similar to #14416.CC: @zimmermann6
Component: basic arithmetic
Author: Jeroen Demeyer
Branch/Commit:
04138f3
Reviewer: Christoph Lauter, Marc Mezzarobba
Issue created by migration from https://trac.sagemath.org/ticket/16385
The text was updated successfully, but these errors were encountered: