Skip to content

Commit e282d46

Browse files
committed
random_bigint_from_range: shifting instead of powering
1 parent 12dfbf2 commit e282d46

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils/random.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
function random_bigint_from_range(bits::Integer)
22
bits <= 0 && error("bits <= 0")
3-
return rand((BigInt(2)^(bits - 1)):(BigInt(2)^bits))
3+
return rand((BigInt(2)<<(bits - 1)):(BigInt(2)<<bits))
44
end

0 commit comments

Comments
 (0)