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; }
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; }