mirror of
https://github.com/tgorordo/WignerSymbols.jl.git
synced 2026-06-13 02:02:14 -07:00
first attempt to (exclusive) v0.7 compatibility
This commit is contained in:
parent
0b8be07d6a
commit
dd208b42a6
5 changed files with 16 additions and 147 deletions
|
|
@ -12,8 +12,8 @@ struct PrimeIterator
|
|||
end
|
||||
primes() = PrimeIterator()
|
||||
|
||||
Compat.IteratorSize(::Type{PrimeIterator}) = Base.IsInfinite()
|
||||
Compat.IteratorEltype(::Type{PrimeIterator}) = Base.HasEltype()
|
||||
Base.IteratorSize(::Type{PrimeIterator}) = Base.IsInfinite()
|
||||
Base.IteratorEltype(::Type{PrimeIterator}) = Base.HasEltype()
|
||||
Base.eltype(::PrimeIterator) = Int
|
||||
|
||||
# Get the `n`th prime; store all primes up to the `n`th if not yet available
|
||||
|
|
@ -30,9 +30,7 @@ function prime(n::Int)
|
|||
@inbounds return primetable[n]
|
||||
end
|
||||
|
||||
Base.start(::PrimeIterator) = 1
|
||||
Base.next(::PrimeIterator, n) = prime(n), n+1
|
||||
Base.done(::PrimeIterator, n) = false
|
||||
Base.iterate(::PrimeIterator, n = 1) = prime(n), n+1
|
||||
|
||||
# get primes and their powers as `BigInt`, also cache all results
|
||||
function bigprime(n::Integer, e::Integer=1)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue