8000 uint64 converted to float when dividing by python integer · Issue #13057 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content
8000

uint64 converted to float when dividing by python integer #13057

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

Closed
hmaarrfk opened this issue Feb 28, 2019 · 1 comment
Closed

uint64 converted to float when dividing by python integer #13057

hmaarrfk opened this issue Feb 28, 2019 · 1 comment

Comments

@hmaarrfk
Copy link
Contributor

I totally get why it is a cause for concern when adding to an int, but I feel like floor division by a positive should be expected to return an integer "safe".

Reproducing code example:

import numpy as np
np.uint64(0) // 4 
Out[2]: -0.0

I guess since I need to divide by 4 I'll just bitshift, but this was kinda unexpected for me.

Numpy/Python version information:

In [3]: import sys, numpy; print(numpy.__version__, sys.version)                                                                                      
1.16.1 3.7.2 (default, Dec 29 2018, 06:19:36) 
[GCC 7.3.0]

installed through conda / conda-forge

xref: #5745

@seberg
Copy link
Member
seberg commented Nov 19, 2022

Closing as duplicate of gh-22624

@seberg seberg closed this as completed Nov 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
407A
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0