axiom-developer
[Top][All Lists]

## [Axiom-developer] [MathAction]

 From: anonymous Subject: [Axiom-developer] [MathAction] Date: Fri, 28 Jan 2005 00:08:44 -0600

++added:
Axiom is very strict with types (meaning: where the operation takes place). The
division of 1+2 by 3 takes place in Fraction Integer (field of rational
numbers) and that is where the answer should be, even if it is 1. Most people
would automatically "retract" this to the integer 1. But in general, there is
no natural way to do so (why not retract 1 to a natural number, for example?).
So Axiom provides the user a way to "coerce" an answer to another type. You can
coerce 1 to any of many, many types, for example, as a polynomial, or even as a
matrix (or the unit element of any ring).

\begin{axiom}
((1+2)/3)::Polynomial Integer
((1+2)/3)::SquareMatrix(1,Integer)
((1+2)/3)::SquareMatrix(3,Integer)
((1+2)/3)::SquareMatrix(3, Polynomial Complex Integer)
\end{axiom}

--