Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

print(factor(24)) is not executable #132

Open
jmichel7 opened this issue Jul 15, 2023 · 0 comments
Open

print(factor(24)) is not executable #132

jmichel7 opened this issue Jul 15, 2023 · 0 comments

Comments

@jmichel7
Copy link
Contributor

playing around with Factorizations I noticed a bug

julia> print(factor(24))
Primes.Factorization(2 => 3, 3 => 1)
julia> Primes.Factorization(2 => 3, 3 => 1)
ERROR: MethodError: no method matching Primes.Factorization(::Pair{Int64, Int64}, ::Pair{Int64, Int64})
Stacktrace:
 [1] top-level scope
   @ REPL[3]:1

you should either print factor(24) as Primes.Factorization(Dict(2 => 3, 3 => 1)) or add a method

Primes.Factorization(l::Pair{T,Int}...) where T=Primes.Factorization(Dict(l))

so that one can round-trip a Factorization

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant