I suppressed the annotations <:Integer on the T of Factorization, allowing Primes.Factorization to be used to hold factorizations of other than integer (my goal is for polynomials). I added tests in runtest.jl where T is Symbol.
Along the way, I fixed bugs in the calls to searchsortedfirst. In the call searchsortedfirst(f.pe, p, by=first) contrary to intuition, the function by is applied to p so the proper second argument should be a pair. This does not show for p integer since then first(p)==p but it shows for other types. The fix is to give a pair:
searchsortedfirst(f.pe, p=>0, by=first)
I suppressed the annotations
<:Integer
on theT
ofFactorization
, allowingPrimes.Factorization
to be used to hold factorizations of other than integer (my goal is for polynomials). I added tests inruntest.jl
whereT
isSymbol
. Along the way, I fixed bugs in the calls tosearchsortedfirst
. In the callsearchsortedfirst(f.pe, p, by=first)
contrary to intuition, the functionby
is applied top
so the proper second argument should be a pair. This does not show forp
integer since thenfirst(p)==p
but it shows for other types. The fix is to give a pair:searchsortedfirst(f.pe, p=>0, by=first)