Esempio n. 1
0
extern "C" Box* intMod(BoxedInt* lhs, Box* rhs) {
    assert(lhs->cls == int_cls);
    if (rhs->cls != int_cls) {
        return NotImplemented;
    }
    BoxedInt* rhs_int = static_cast<BoxedInt*>(rhs);
    return boxInt(mod_i64_i64(lhs->n, rhs_int->n));
}
Esempio n. 2
0
extern "C" Box* intMod(BoxedInt* lhs, Box* rhs) {
    if (!isSubclass(lhs->cls, int_cls))
        raiseExcHelper(TypeError, "descriptor '__mod__' requires a 'int' object but received a '%s'", getTypeName(lhs));

    if (rhs->cls != int_cls) {
        return NotImplemented;
    }
    BoxedInt* rhs_int = static_cast<BoxedInt*>(rhs);
    return boxInt(mod_i64_i64(lhs->n, rhs_int->n));
}
Esempio n. 3
0
extern "C" Box* intModInt(BoxedInt* lhs, BoxedInt* rhs) {
    assert(isSubclass(lhs->cls, int_cls));
    assert(isSubclass(rhs->cls, int_cls));
    return boxInt(mod_i64_i64(lhs->n, rhs->n));
}
Esempio n. 4
0
extern "C" Box* intModInt(BoxedInt* lhs, BoxedInt* rhs) {
    assert(lhs->cls == int_cls);
    assert(rhs->cls == int_cls);
    return boxInt(mod_i64_i64(lhs->n, rhs->n));
}