-
Notifications
You must be signed in to change notification settings - Fork 93
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
Value mismatch with numpy on int(arr) // -float(arr)
#2689
Comments
int(arr) // -float(arr)
wow, so these only differ in one spot. Index Numpy has |
The fraction represented by the linspace at position 36 is >>> 36 / (-6/11)
-66.0
>>> 36 // (-6/11)
-67.0
>>> 36 // ak.array([-0.5454545454545454])
array([-66]) So it makes sense we are getting this wrong because we do Line 29 in e574712
|
This seems to be a numeric precision issue when dividing by an infinite decimal. I found this much simpler example which shows this: >>> 1 // (-1/3)
-4.0
>>> 1 / (-1/3)
-3.0 I guess we just need to figure out what the c function used for integer division and use that |
So according to this stack overflow answer, it's not really floor divide but round towards zero. I'm hoping updating the one line to be |
While working #2688, I updated the float array to include negatives which resulted in the following value mismatch with numpy. I don't see the mismatch at a glance, but I'll dig into it more after all the tests are converted
The text was updated successfully, but these errors were encountered: