Transcendental Numbers
Mike Klein
mike at twinsun.com
Mon Feb 2 23:48:44 UTC 1998
> True, there are non-commutative maths, but the ones that I can think of
> offhand that are generalizations of the ones implemented in Squeak, such
> as quaternions and Cayley numbers, are built out of components which are
> manipulated by commutative operators. So it seems reasonable to build
> the general number system such that the standard operators (addition and
> multiplication in particular) are commutative, and then design the
> non-commutative systems with the appropriate constraints, rather than
> constraining the base number systems to favor the more complex and
> less-used non-commutative systems.
If you are attempting to do some kind of generic functions, you will
have to deal with non-commutative math anyway, I.E. for subtraction
and division. It only takes a little bit of care to preserve argument
order for the traditionally-commutative operations of addition and
multiplication as well, so it is better to preserve it when you can.
I feel it IS worth the care for numerics.
I.e. (s is a scaler, X is multiplication)
| a b |
| c d | X s
=
| as bs |
| cs ds |
and
s X | a b |
| c d |
=
| sa sb |
| sc sd |
Symbolic math can be a bit tougher:
(x + y)(x + y) = x^2 + xy + yx + y^2
hence, you may want to be able to specify that the
algebra is commutative to the reduction engine.
-- Mike Klein
More information about the Squeak-dev
mailing list
|