NZMATH  1.2.0 About: NZMATH is a Python based number theory oriented calculation system.   Fossies Dox: NZMATH-1.2.0.tar.gz  ("inofficial" and yet experimental doxygen-generated source code documentation)
nzmath.rational.Integer Class Reference
Inheritance diagram for nzmath.rational.Integer:
[legend]
Collaboration diagram for nzmath.rational.Integer:
[legend]

## Public Member Functions

def __init__ (self, value)

def __div__ (self, other)

def __rdiv__ (self, other)

def __floordiv__ (self, other)

def __rfloordiv__ (self, other)

def __mod__ (self, other)

def __rmod__ (self, other)

def __divmod__ (self, other)

def __rdivmod__ (self, other)

def __sub__ (self, other)

def __rsub__ (self, other)

def __mul__ (self, other)

def __rmul__ (self, other)

def __pow__ (self, index, modulo=None)

def __pos__ (self)

def __neg__ (self)

def __abs__ (self)

def __eq__ (self, other)

def __hash__ (self)

def getRing (self)

def inverse (self)

def actMultiplicative (self, other)

Public Member Functions inherited from nzmath.ring.CommutativeRingElement
def __init__ (self)

def mul_module_action (self, other)

def exact_division (self, other)

Public Member Functions inherited from nzmath.ring.RingElement
def __init__ (self, *args, **kwd)

def __ne__ (self, other)

## Static Private Attributes

def __truediv__ = __div__

def __rtruediv__ = __rdiv__

## Detailed Description

```Integer is a class of integer.  Since 'int' and 'long' do not
return rational for division, it is needed to create a new class.
```

Definition at line 639 of file rational.py.

## ◆ __init__()

 def nzmath.rational.Integer.__init__ ( self, value )

Definition at line 644 of file rational.py.

## ◆ __abs__()

 def nzmath.rational.Integer.__abs__ ( self )

Definition at line 735 of file rational.py.

 def nzmath.rational.Integer.__add__ ( self, other )

Definition at line 686 of file rational.py.

References nzmath.rational.isIntegerObject().

## ◆ __div__()

 def nzmath.rational.Integer.__div__ ( self, other )

Definition at line 647 of file rational.py.

## ◆ __divmod__()

 def nzmath.rational.Integer.__divmod__ ( self, other )

Definition at line 680 of file rational.py.

## ◆ __eq__()

 def nzmath.rational.Integer.__eq__ ( self, other )
```Equality test.
```

Reimplemented from nzmath.ring.RingElement.

Definition at line 738 of file rational.py.

## ◆ __floordiv__()

 def nzmath.rational.Integer.__floordiv__ ( self, other )

Definition at line 663 of file rational.py.

## ◆ __hash__()

 def nzmath.rational.Integer.__hash__ ( self )

Reimplemented from nzmath.ring.RingElement.

Definition at line 741 of file rational.py.

## ◆ __mod__()

 def nzmath.rational.Integer.__mod__ ( self, other )

Definition at line 672 of file rational.py.

## ◆ __mul__()

 def nzmath.rational.Integer.__mul__ ( self, other )

## ◆ __neg__()

 def nzmath.rational.Integer.__neg__ ( self )

Definition at line 732 of file rational.py.

## ◆ __pos__()

 def nzmath.rational.Integer.__pos__ ( self )

Definition at line 729 of file rational.py.

## ◆ __pow__()

 def nzmath.rational.Integer.__pow__ ( self, index, modulo = `None` )
```If index is negative, result may be a rational number.
```

Definition at line 721 of file rational.py.

## ◆ __rdiv__()

 def nzmath.rational.Integer.__rdiv__ ( self, other )

Definition at line 653 of file rational.py.

## ◆ __rdivmod__()

 def nzmath.rational.Integer.__rdivmod__ ( self, other )

Definition at line 683 of file rational.py.

## ◆ __rfloordiv__()

 def nzmath.rational.Integer.__rfloordiv__ ( self, other )

Definition at line 666 of file rational.py.

## ◆ __rmod__()

 def nzmath.rational.Integer.__rmod__ ( self, other )

Definition at line 677 of file rational.py.

## ◆ __rmul__()

 def nzmath.rational.Integer.__rmul__ ( self, other )

## ◆ __rsub__()

 def nzmath.rational.Integer.__rsub__ ( self, other )

Definition at line 700 of file rational.py.

## ◆ __sub__()

 def nzmath.rational.Integer.__sub__ ( self, other )

Definition at line 694 of file rational.py.

References nzmath.rational.isIntegerObject().

 def nzmath.rational.Integer.actAdditive ( self, other )
```Act on other additively, i.e. n is expanded to n time
additions of other.  Naively, it is:
return sum([+other for _ in xrange(self)])
but, here we use a binary addition chain.
```

Definition at line 750 of file rational.py.

Referenced by nzmath.rational.Integer.__mul__(), and nzmath.rational.Integer.__rmul__().

## ◆ actMultiplicative()

 def nzmath.rational.Integer.actMultiplicative ( self, other )
```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 xrange(self)])
but, here we use a binary addition chain.
```

Definition at line 769 of file rational.py.

## ◆ getRing()

 def nzmath.rational.Integer.getRing ( self )

## ◆ inverse()

 def nzmath.rational.Integer.inverse ( self )

Definition at line 747 of file rational.py.

## Member Data Documentation

staticprivate

Definition at line 692 of file rational.py.

## ◆ __rtruediv__

 def nzmath.rational.Integer.__rtruediv__ = __rdiv__
staticprivate

Definition at line 661 of file rational.py.

## ◆ __truediv__

 def nzmath.rational.Integer.__truediv__ = __div__
staticprivate

Definition at line 659 of file rational.py.

The documentation for this class was generated from the following file: