scheinerman/Mods.jl

use of abstract element types not recommended

Closed this issue · 2 comments

See julia docu
instead of

struct Mod
    val::Integer
    mod::Integer
end

you should use

struct Mod{T<:Integer}
    val::T
    mod::T
end

or even

struct Mod{T<:Unsigned} <:Real
    ...
end

The constructors should derive the concrete types from their arguments.

OK. I think I understand the issue and will try an update.

Update posted.