MonumoLtd / SimpleGA.jl

Geometric algebra in Julia.
MIT License
23 stars 2 forks source link

Some methods are defined for `Number` as type bound rather than `Real` #32

Closed tpgillam closed 9 months ago

tpgillam commented 9 months ago

For example, in GA30 we have:

Base.:(+)(num::Number, a::Even) = Even(a.w + num, a.x, a.y, a.z)
Base.:(-)(num::Number, a::Even) = Even(-a.w + num, -a.x, -a.y, -a.z)

but here, num should really be Real - a complex number does not make sense, and a GA number would make even less sense.

(Whether or not GA multivectors should inherit from the Julia Number type is another question)