On Thu, Apr 7, 2011 at 3:43 PM, Robert Klemme <shortcutter / googlemail.com> wrote: > > My math is a bit rusty in that area, but I don't think your argument > holds: cartesian and polar are just two ways to represent a complex > number. ¨Βυτ τθισ δοεσ ξογθαξηε ξυνεςιπςοπεςτιεσ οζ τθγμασοζ > complex numbers. ¨Βναττες χθατ ςεπςεσεξτατιοξ ωουσε¬ ¨°«±ι© ισ > neither a real number (what float conceptually models) nor a rational > number (what float technically implements). ¨Βξστεαδςεαμ αξ> rational numbers are both subsets of complex. Given that there are infinitely more irrational than rational numbers, it's much more common to represent a complex number with irrational numbers than rational ones (i.e. floats instead of integers). Thus, most (for want of a better word) real mathematical operations done with complex numbers are done with irrational numbers. Cartesian and polar forms make certain mathematical operations easier, but that's more or less it (the truth is more complex, but I CBA to look into trascendental numbers, Euler's number, &c.). And yes, both rational and irrational numbers are subsets of complex, obviously (with rational numbers being a subset of irrational numbers, to simplify extremely). :) > If you see inheritance as "is a" relationship then inheritance would > be Rational < Real < Complex but not the other way round. ¨Βτθεςχισε > you cannot use a subclass instance everywhere you were using a > superclass instance. Though, does the "is a" relationship hold up? I think it's more of a "kind of" relationship, where subsequent classes are defined in ever more detail (so, you'd inherit Floats from Integers, and Complex from Float). Of course, the clean world of maths doesn't map 1:1 to computational systems, so I see the value in both approaches. But, frankly, given the differences and additional properties of complex numbers, I'd derive it from Numeric as well, simply to limit the side effects the other numeric classes introduce (Floats and their CPU-internal representation give me nightmares :P). -- Phillip Gawlowski Though the folk I have met, (Ah, how soon!) they forget When I've moved on to some other place, There may be one or two, When I've played and passed through, Who'll remember my song or my face.