| 1 | initial version |
Sage uses the parent/element pattern for most mathematical objects, see the documentation on coercion for details. For integers the parent is IntegerRing (with ZZ as shortcut) and the element are Integer.
sage: i = 1
sage: type(i)
sage.rings.integer.Integer
sage: type(i.parent())
sage.rings.integer_ring.IntegerRing_class
sage: ZZ is IntegerRing() is i.parent()
True
Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.