Closed Keno closed 5 years ago
Thanks for flagging. I've been hesitant to add isprime
assertions in the constructors, but after timing this I don't see a reason:
julia> @btime isprime($(prevprime(typemax(Int128))))
68.619 Ξs (4 allocations: 2.49 KiB)
true
That would then throw an error in your first example. Would that solve your confusion?
It would solve my confusion, though of course âĪ/256âĪ
is sometimes quite useful, so perhaps we should just add a ModP
datatype to support things of that form that aren't finite fields and just make it work. Perhaps this isn't the correct package for that, but I figure PrimeField
has all the code to support ModP anyway.
of course âĪ/256âĪ is sometimes quite useful, so perhaps we should just add a ModP datatype to support things of that form that aren't finite fields and just make it work.
I agree that it might be useful, but it immediately asks for new methods and functionality (chinese remainder theorem, is_zero_divisor, ideals, etc). So yep, probably not the right package.
I'll leave the issue open until I added isprime
to the constructor.
I'm not sure if this is intended or a bug, but either way it's confusing.
The former
ð―ââ â
is aPrimeField
(even though 256 isn't prime?) while the latter is aBinaryField
. They print the same, but behave completely differently.