mirror of
https://github.com/tgorordo/WignerSymbols.jl.git
synced 2026-06-13 02:02:14 -07:00
use RationalRoots representation
This commit is contained in:
parent
80cc592dd3
commit
8ee830e173
6 changed files with 52 additions and 45 deletions
|
|
@ -116,13 +116,13 @@ Base.promote_rule(P::Type{<:PrimeFactorization},::Type{BigInt}) = BigInt
|
|||
|
||||
Base.convert(P::Type{<:PrimeFactorization}, n::Integer) = convert(P, primefactor(n))
|
||||
function Base.convert(::Type{BigInt}, a::PrimeFactorization)
|
||||
A = big(a.sign)
|
||||
A = one(BigInt)
|
||||
for (n, e) in enumerate(a.powers)
|
||||
if !iszero(e)
|
||||
MPZ.mul!(A, bigprime(n, e))
|
||||
end
|
||||
end
|
||||
return A
|
||||
return a.sign < 0 ? MPZ.neg!(A) : A
|
||||
end
|
||||
Base.convert(::Type{PrimeFactorization{U}}, a::PrimeFactorization{U}) where {U<:Unsigned} =
|
||||
a
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue