fix to match constraints
@@ -176,6 +176,9 @@ class Generator:
lo = int(low)
hi1 = int(high)
+ if not endpoint:
+ hi1 -= 1
+
if lo > hi1:
raise ValueError('low >= high')
if lo < cupy.iinfo(dtype).min:
@@ -186,8 +189,6 @@ class Generator:
'high is out of bounds for {}'.format(cupy.dtype(dtype).name))
diff = hi1 - lo
- if not endpoint:
- diff -= 1
cdef uint64_t mask = (1 << diff.bit_length()) - 1
# TODO adjust dtype
