Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Integer vs ZZ

What's the difference between sage class ZZ (rings/integer_ring.pyx) and Integer (rings/integer.pyx)?

Is one preferred over the other in some cases? Do they provide different functionality?

Maybe instances of Integer are elements of ZZ?!


a = ZZ(10)
b = Integer(3)
c = a + b
print a, b, c
print "Type of elements:", type(a), "vs", type(b), "vs", type(c)
print "Type of classes: ", ZZ, "vs", Integer