Example #1
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 #2
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;
}