-
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
Closes #2472, #2800: Update IndexingMsg to use &
instead of mod
for setting bigint pdarrays
#2793
Conversation
@jaketrookman this isn't really what the issue was getting at For this instead of using You can see something similar to this done in var max_size = 1:bigint;
var has_max_bits = max_bits != -1;
if has_max_bits {
max_size <<= max_bits;
max_size -= 1;
}
...
if has_max_bits {
li &= local_max_size;
} Also just looking at this code statically, unless im misreading something what's already there seems to be incorrect. Because it's doing |
yup the existing code (which i wrote 🙃 ) is incorrect when In [3]: bi = ak.arange(2**200 - 1, 2**200+4)
In [4]: bi
Out[4]: array([1606938044258990275541962092341162602522202993782792835301375 1606938044258990275541962092341162602522202993782792835301376 1606938044258990275541962092341162602522202993782792835301377 1606938044258990275541962092341162602522202993782792835301378 1606938044258990275541962092341162602522202993782792835301379])
In [5]: bi[:] = ak.arange(2**200 - 1, 2**200+4)
In [6]: bi
Out[6]: array([1606938044258990275541962092341162602522202993782792835301375 1606938044258990275541962092341162602522202993782792835301376 1606938044258990275541962092341162602522202993782792835301377 1606938044258990275541962092341162602522202993782792835301378 1606938044258990275541962092341162602522202993782792835301379])
In [7]: bi.max_bits = 201
In [8]: bi
Out[8]: array([1606938044258990275541962092341162602522202993782792835301375 1606938044258990275541962092341162602522202993782792835301376 1606938044258990275541962092341162602522202993782792835301377 1606938044258990275541962092341162602522202993782792835301378 1606938044258990275541962092341162602522202993782792835301379])
In [9]: bi[:] = ak.arange(2**200 - 1, 2**200+4)
In [10]: bi
Out[10]: array([3 4 5 6 7]) |
%
instead of mod
for setting bigint pdarrays&
instead of mod
for setting bigint pdarrays
1c62bda
to
c834904
Compare
&
instead of mod
for setting bigint pdarrays&
instead of mod
for setting bigint pdarrays
…sking, and add testing
…ation, add remove value binops forall loop
…and adding forall loops
d40a84d
to
fa452e1
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
one nit pick on the tests but the logic looks great!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
This PR (Closes #2472 and closes #2800) updates the function calls of
mod
in IndexingMsg to use%
, as they are more efficient.The
bool
case still needs to be updated as there is not a way to directly cast abigint
to abool
.Leaving as a draft until I know if this last case can be completed without this casting feature.