arkouda
arkouda copied to clipboard
Implement `max/min` on `bigint` without setting highest bits
After looking into a request for testing implementation on the series_test.py
(#2651 ) it was discovered that there is an issue with the missing implementation of min/max
on bigint
. There is a current work around, if you are able to directly set the max/min
bits, but as the type is variable, you can not get the max/min
in general.
Related to Issue #2377.
I'd like to discuss this further with u. My initial thought is there's not a good way to do this without max_bits
set since there's not a good identity element.
So the normal workflow for calculating the min value is:
smallest_so_far = max(int) # the identity for the min operation
for a in arr:
if a < smallest_so_far:
smallest_so_far = a
The difficulty is there's no biggest or smallest value for the bigint type. For the example above we could set smallest_so_far = arr[0]
, but in chpl we use reduce scan ops
for this, which require an identity. There's probably a way to make this happen but it's not obvious to me the best way to do this