static void test_exponentiation() {
    ASSERT_RESULT("3^2", 9);
    ASSERT_RESULT("10^-2", 0.01);
    ASSERT_RESULT("4^2", 16);
    ASSERT_RESULT("2^8", 256);
    ASSERT_RESULT("5^(2^3)", 390625);
}
static void test_division() {
    ASSERT_RESULT("1/2", 0.5);
    ASSERT_RESULT("3.885 / 7", 0.555);
    ASSERT_RESULT("(140/2)/0.5/2", 70);
    ASSERT_RESULT("((517/4)/2/.25/.25)/22", 47);
    ASSERT_RESULT("2987898/34743", 86);
}
static void test_modulus() {
    ASSERT_RESULT("10 % 6", 4);
    ASSERT_RESULT("2+3 % 3", 2);
    ASSERT_RESULT("6*5%21", 9);
    ASSERT_RESULT("10%11", 10);
    ASSERT_RESULT("5 %5", 0);
    ASSERT_RESULT("5.7%3", 2.7);
    ASSERT_RESULT("pi%2", 1.1415926535898);
}
static void test_multiplication() {
    ASSERT_RESULT("13 * 2", 26);
    ASSERT_RESULT("3.2*2", 6.4);
    ASSERT_RESULT("20*2*1.375", 55);
    ASSERT_RESULT("0.75*((2*-4)*1.5)", -9);
    ASSERT_RESULT("27*0.5", 13.5);
    ASSERT_RESULT("2(3)", 6);
    ASSERT_RESULT("(2)(3)", 6);
}
result db_delete (key a0) {
int _result;
size_t avail = sizeof(__buf);
unsigned char *buf = __buf;
rpc_msg msg, reply;
result retval;
msg.xid = __rpc.xid++;
msg.body.mtype = CALL;
msg.body.value.cbody.rpcvers = 2;
msg.body.value.cbody.prog = __rpc.prog;
msg.body.value.cbody.vers = __rpc.vers;
msg.body.value.cbody.proc = 3;
msg.body.value.cbody.cred.flavor = AUTH_NONE;
msg.body.value.cbody.cred.body.count = 0;
msg.body.value.cbody.verf.flavor = AUTH_NONE;
msg.body.value.cbody.verf.body.count = 0;
_result = marshal_rpc_msg(&msg, &buf, &avail);
ASSERT_RESULT();
_result = marshal_key(&a0, &buf, &avail);
ASSERT_RESULT();
_result = _rpc_send(&__rpc, __buf, sizeof(__buf) - avail);
ASSERT_RESULT();
_result = _rpc_recv(&__rpc, __buf, sizeof(__buf));
ASSERT_RESULT();
buf = __buf;
avail = _result;
_result = unmarshal_rpc_msg(&reply, &buf, &avail);
ASSERT_RESULT();
if (reply.xid != msg.xid) exit(1);
_result = unmarshal_result(&retval, &buf, &avail);
ASSERT_RESULT();
return retval;
}
static void test_factorials() {
    ASSERT_RESULT("1!", 1);
    ASSERT_RESULT("2!", 2);
    ASSERT_RESULT("3!", 6);
    ASSERT_RESULT("4!", 24);
    ASSERT_RESULT("5!", 120);
    ASSERT_RESULT("3!+1", 7);
}
static void test_subtraction() {
    ASSERT_RESULT("8-4", 4);
    ASSERT_RESULT("15-10", 5);
    ASSERT_RESULT("27 - (10 - 11)", 28);
    ASSERT_RESULT("-5-11", -16);
    ASSERT_RESULT("-(2-3.6)", 1.6);
    ASSERT_RESULT("(-5-7)", -12);
}
static void test_addition() {
    ASSERT_RESULT("2+2", 4);
    ASSERT_RESULT("2  +  2", 4);
    ASSERT_RESULT("2+2.", 4);
    ASSERT_RESULT("3 + (5 + 1 + (2 + 2))", 13);
    ASSERT_RESULT("1+2+4+8+16 + 11", 42);
    ASSERT_RESULT("2.1+2.1", 4.2);
}
static void test_functions() {
    ASSERT_RESULT("abs(-32)", 32);
    ASSERT_RESULT("abs(-5-7)", 12);
    ASSERT_RESULT("abs(-1.1)", 1.1);
    ASSERT_RESULT("sqrt(100)", 10);
    ASSERT_RESULT("SqRt(100)", 10);
    ASSERT_RESULT("sqrt(sqrt(10000))", 10);
    ASSERT_RESULT("sqrt(sqrt(10000) + 800)", 30);
    ASSERT_RESULT("42 * cos(0)", 42);
    ASSERT_RESULT("(sin(0)*cos(0)*40*tan(0))-1", -1);
    ASSERT_RESULT("log(10)", 1);
    ASSERT_RESULT("lOG(10)", 1);
    ASSERT_RESULT("lb(8)", 3);
    ASSERT_RESULT("ln(e)", 1);
    ASSERT_RESULT("Ln(E)", 1);
    ASSERT_RESULT("log(10^42)", 42);
    ASSERT_RESULT("lb(2^123)", 123);
}
static void test_precedence() {
    ASSERT_RESULT("6/3*5", 10);
    ASSERT_RESULT("6+3*2", 12);
    ASSERT_RESULT("-10^2", -100);
    ASSERT_RESULT("(-10)^2", 100);
    ASSERT_RESULT("10^2+1", 101);
    ASSERT_RESULT("10^-2+1", 1.01);
    ASSERT_RESULT("-10^-2+1", 0.99);
    ASSERT_RESULT("10^-2*2", 0.02);
    ASSERT_RESULT("2+6/2*5+10/3-2/6", 20);
    ASSERT_RESULT("10^3!", 1000000);
    ASSERT_RESULT("10^-2pi", M_PI / 100);
    ASSERT_RESULT("2^2^3", 256);
}
static void test_constants() {
    ASSERT_RESULT("sin(pi)", 0);
    ASSERT_RESULT("cos(pi)", -1);
    ASSERT_RESULT("tan(pi)", 0);
    ASSERT_RESULT("Tan(PI)", 0);
    ASSERT_RESULT("cos(tau)", 1);
    ASSERT_RESULT("COS(TAU)", 1);
    ASSERT_RESULT("cos(2pi)", 1);
    ASSERT_RESULT("((2pi/tau)+(10pi))/(1+10pi)", 1);
    ASSERT_RESULT("2pi", 6.2831853071796);
    ASSERT_RESULT("pi(2)", 6.2831853071796);
    ASSERT_RESULT("pi pi", 9.8696044010894);
    ASSERT_RESULT("2pi pi", 19.739208802179);
}