remove mpcf_maths from mpc.c and adjust maths test

This commit is contained in:
Carlos Rueda
2023-01-05 15:51:14 -08:00
parent bd32544d42
commit afbaab89fe
3 changed files with 22 additions and 22 deletions

19
mpc.c
View File

@@ -2671,25 +2671,6 @@ mpc_val_t *mpcf_strfold(int n, mpc_val_t **xs) {
return xs[0];
}
mpc_val_t *mpcf_maths(int n, mpc_val_t **xs) {
int **vs = (int**)xs;
(void) n;
switch(((char*)xs[1])[0])
{
case '*': { *vs[0] *= *vs[2]; }; break;
case '/': { *vs[0] /= *vs[2]; }; break;
case '%': { *vs[0] %= *vs[2]; }; break;
case '+': { *vs[0] += *vs[2]; }; break;
case '-': { *vs[0] -= *vs[2]; }; break;
default: break;
}
free(xs[1]); free(xs[2]);
return xs[0];
}
/*
** Printing
*/