Integer is a class of integer. Since 'int' and 'long' do not return rational for division, it is needed to create a new class.
Ths class is a subclass of nzmath.ring.CommutativeRingElement and long.
Construct a Integer object. If argument is ommited, the value becomes 0.
Act on other additively, i.e. n is expanded to n time additions of other. Naively, it is:
return sum([+'''other''' for _ in range(self)])
but, here we use a binary addition chain.
Act on other multiplicatively, i.e. n is expanded to n time multiplications of other. Naively, it is:
return reduce(lambda x,y: x*y, [+'''other''' for _ in range(self)])
but, here we use a binary addition chain.
Return an IntegerRing object.
Divisions are redefined.
Other operations as a mathematical number are also overridden in order to return Integer instance instead of long object.
Bit operations, and other miscellaneous operators are inherited from long.