'Returns the remainder from integer division.
The result is the residue of the dividend after the operation of
calculating integer division as described for divide-integer, rounded
to precision digits if necessary.  The sign of the result, if
non-zero, is the same as that of the original dividend.
This operation will fail under the same conditions as integer division
(that is, if integer division on the same two operands would fail, the
remainder cannot be calculated).
>>> ExtendedContext.remainder(Decimal(\'2.1\'), Decimal(\'3\'))
Decimal(\'2.1\')
>>> ExtendedContext.remainder(Decimal(\'10\'), Decimal(\'3\'))
Decimal(\'1\')
>>> ExtendedContext.remainder(Decimal(\'-10\'), Decimal(\'3\'))
Decimal(\'-1\')
>>> ExtendedContext.remainder(Decimal(\'10.2\'), Decimal(\'1\'))
Decimal(\'0.2\')
>>> ExtendedContext.remainder(Decimal(\'10\'), Decimal(\'0.3\'))
Decimal(\'0.1\')
>>> ExtendedContext.remainder(Decimal(\'3.6\'), Decimal(\'1.3\'))
Decimal(\'1.0\')
>>> ExtendedContext.remainder(22, 6)
Decimal(\'4\')
>>> ExtendedContext.remainder(Decimal(22), 6)
Decimal(\'4\')
>>> ExtendedContext.remainder(22, Decimal(6))
Decimal(\'4\')'

def remainder(self, a, b):

    a = _convert_other(a, raiseit=True)
    r = a.__mod__(b, context=self)
    if (r is NotImplemented):
        raise TypeError(('Unable    to    convert    %s    to    Decimal' % b))
    else:
        return r
