Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

ZZ refers to the ring of integers, whereas Integer refers to the type of an element of the ring ZZ. When you execute, say ZZ(int(10)), int(10) is coerced to an Integer. In your example above you can verify this.

sage: print "Type of elements:", type(a), "vs", type(b), "vs", type(c)
Type of elements: <type 'sage.rings.integer.Integer'> vs <type 'sage.rings.integer.Integer'> vs <type 'sage.rings.integer.Integer'>

The elements a, b, and c are of the same type.

Yes, Integer is the type of elements in ZZ. ZZ refers to the ring of integers, whereas Integer refers to the type of an element of the ring ZZ. When you execute, say ZZ(int(10)), int(10) is coerced to an Integer. In your example above you can verify this.

sage: print "Type of elements:", type(a), "vs", type(b), "vs", type(c)
Type of elements: <type 'sage.rings.integer.Integer'> vs <type 'sage.rings.integer.Integer'> vs <type 'sage.rings.integer.Integer'>

The elements a, b, and c are of the same type.