| Cast |
| Syntax |
Cast(E:OBJECT, T:TYPE):TYPE |
| Description |
| Example |
L := [[1,2],[3,4]];
Type(L);
LIST
-------------------------------
Cast(L, MAT);
Mat([
[1, 2],
[3, 4]
])
-------------------------------
L; -- L is unchanged; it is still a list.
[[1, 2], [3, 4]]
-------------------------------
Use ZZ/(5)[t];
A := 8;
A; -- A has type INT
8
-------------------------------
Cast(A, POLY); -- cast as a polynomial, A = -2 since the coefficient
-- ring is ZZ/5ZZ
-2
-------------------------------
|
| See Also |