6.12.3.1.6. Integer Multiplication

Note that this monoid is a group if and only if the modulus is a prime.
Start python section to interscript/felix/model/stdcat.py[6 /10 ] Next Prev Last
    52: #line 74 "felix_stdcat.ipk"
    53: class int_mul(cat_monoid):
    54:   def __init__(self, modulus=0):
    55:     cat_monoid.__init__(self,1)
    56:     self.modulus = abs(modulus)
    57: 
    58:   def compose(self, left, right):
    59:     prod = long(left) * long(right)
    60:     if self.modulus: return prod % self.modulus
    61:     else: return prod
    62: 
    63:   def is_arrow(self, object):
    64:     try:
    65:       as_long = long(object)
    66:       return 1
    67:     except: return 0
    68: 
End python section to interscript/felix/model/stdcat.py[6]