-
-
Notifications
You must be signed in to change notification settings - Fork 10.8k
uint64 and int in integer-division returns float #9833
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
Comments
The bug here is actually "When using |
This is actually intentional, although you are certainly not the first person to be displeased with it. Let's keep this discussion consolidated to #5745 |
@eric-wieser and @shoyer Thank you for your reply. The reference helped a lot in understanding the numpy strategy at this point. |
Huh, so that design decision means for the above examples: If we do int arithmetics, where an |
When using uint64 data type with any (signed) integer data types in an integer divisions
//
the result is a float, not an int. For any othernp.uint
an integer is returned. Is this the expected behavior - if yes why? Or should this be casted to an int instead?Example code:
I am using python 3.4 with numpy 1.10.4 on OS X 10.11.6 and a python 3.4.3 with numpy 1.12.0b1 on Ubuntu 14.04.5 LTS.
The text was updated successfully, but these errors were encountered: