On Jun 24, 2005, at 11:02 PM, Bob Rogers wrote:

Since Complex could also be considered a Number, but of a very different sort, it might be worth constructing the type hierarchy to reflect this:

        Scalar
           Number
              Real
                 Integer
                 Float
              Complex

This is inaccurate. All integers are reals (in fact, all integers are rationals and all rationals are reals), but floats are not all integers. Factorial should be defined for integers but not floats.

Also, all reals are complex numbers (with a zero imaginary component). Here's my suggested hierarchy with abstract types in lowercase and instantiable types capitalized:

scalar
        number (possibly complex)
                real
                        rational
                                integer
                                        Integer
                                        BigInt
                                Ratio
                        Float
                Complex
                Quaternion
        String
        ...

Also, what about non-scalar numbers such as vectors and matrices? Will we have operators for dot-product and cross-product? Or is this another HLL issue?

Josh

Reply via email to