def METHOD_NAME(self, other):
    a = to_number(self)
    b = to_number(other)
    if abs(a) == Infinity or not b:
        return NaN
    if abs(b) == Infinity:
        return a
    pyres = a % b  # different signs in python and javascript
    # python has the same sign as b and js has the same
    # sign as a.
    if a < 0 and pyres > 0:
        pyres -= abs(b)
    elif a > 0 and pyres < 0:
        pyres += abs(b)
    return float(pyres)