[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Axiom-developer] [Axiom Language] (new)

From: billpage
Subject: [Axiom-developer] [Axiom Language] (new)
Date: Tue, 22 Feb 2005 14:45:00 -0600

Axiom Types


It is sort of interesting, isn't it, that Axiom insists on
calling `1' a fraction just because of the way it was
calculated? There is a way to say that you want the answer
as an integer. Of course this isn't always possible:

But the example it is:

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).

((1+2)/3)::Polynomial Integer
((1+2)/3)::SquareMatrix(3, Polynomial Complex Integer)

forwarded from

reply via email to

[Prev in Thread] Current Thread [Next in Thread]