INNER CODE UNIT · C++

rem

margelo/react-native-bignumber · cpp/MGBigNumberHostObject.cpp:895

            std::shared_ptr<MGBigNumber> rem = std::make_shared<MGBigNumber>(thiz->ctx);
            BN_div(res->bign, rem->bign, thiz->bign, other->bign, thiz->ctx);
            jsi::Object obj(runtime);
            obj.setProperty(runtime, "div", jsi::Object::createFromHostObject(runtime, res));
            obj.setProperty(runtime, "mod", jsi::Object::createFromHostObject(runtime, rem));
            return obj;
        }));

        this->fields.push_back(HOST_LAMBDA("divRound", {
            std::shared_ptr<MGBigNumber> thiz = thisValue.getObject(runtime).getHostObject<MGBigNumber>(runtime);
            const jsi::Value &otherValue = arguments[0];
            if (!otherValue.isObject())
            {
                throw jsi::JSError(runtime, "divRound expects BigNumb");
            }
            jsi::Object otherObject = otherValue.asObject(runtime);
            if (!otherObject.isHostObject<MGBigNumber>(runtime))
            {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…