You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Previously, calling e.g. rand(big(1:4)) caused a stack overflow,
because rand(mt::MersenneTwister, r::AbstractArray) was calling
itself recursively. So a a method handling not-implemented types
has been added.
* A type RandIntGenBigInt similar to RandIntGen (both subtypes of
RangeGenerator) has been introduced to handle rand on big ranges.
The generic function to construct such objects is named inrange.
Note: mpz_import could be replaced by mpz_limbs_{write,finish}
when GMP version 6 is used.
* BigInt tests from commit bf8c452 were re-added.
@evalRandIntGen(r::UnitRange{$T}) =isempty(r) ?error("range must be non-empty") :RandIntGen(first(r), convert($U, unsigned(last(r) -first(r)) +one($U))) # overflow ok
385
+
@evalinrange(r::UnitRange{$T}) =isempty(r) ?error("range must be non-empty") :RandIntGen(first(r), convert($U, unsigned(last(r) -first(r)) +one($U))) # overflow ok
386
+
end
387
+
388
+
389
+
# generator for BigInt
390
+
immutable RandIntGenBigInt <:RangeGenerator
391
+
a::BigInt# first
392
+
m::BigInt# range length - 1
393
+
limbs::Array{Culong}# buffer to be copied into generated BigInt's
0 commit comments