Example #1
0
void iPhoneDoubleCopy::eval() {
    DoubleData *src = (DoubleData *)systemEngine->dStack.pop();
    DoubleData *tgt = new DoubleData();
    tgt->clear();
    tgt->set(((DoubleData *)src)->get());
    systemEngine->dStack.push(src);
    systemEngine->dStack.push(tgt);
};
Example #2
0
void iPhoneSubtractDoubleDouble::eval() {
    DoubleData *acc = (DoubleData *)systemEngine->getData();
    DoubleData *num = (DoubleData *)systemEngine->getData();
    DoubleData *result = new DoubleData();
    result->set(num->get() - acc->get());
    systemEngine->putData(result);
    delete num;
    delete acc;
}
Example #3
0
void iPhoneDivideDoubleDouble::eval() {
    DoubleData *acc = (DoubleData *)systemEngine->getData();
    DoubleData *num = (DoubleData *)systemEngine->getData();
    if (acc->get() == 0) {
        systemEngine->setError(eDivZero);
    } else {
        DoubleData *result = new DoubleData();
        result->set(num->get() / acc->get());
        systemEngine->putData(result);
    }
    delete num;
    delete acc;
}