[cexpr] Use correct functions for double trunc/floor

Found while sorting out the changes for the new 2d vectors.
This commit is contained in:
Bill Currie 2022-01-02 01:13:17 +09:00
parent 9aa8f18d73
commit 937f36384b

View file

@ -350,7 +350,7 @@ double_rem (const exprval_t *val1, const exprval_t *val2, exprval_t *result,
{ {
double a = *(double *) val1->value; double a = *(double *) val1->value;
double b = *(double *) val2->value; double b = *(double *) val2->value;
*(double *) result->value = a - b * truncf (a / b); *(double *) result->value = a - b * trunc (a / b);
} }
static void static void
@ -364,7 +364,7 @@ double_mod (const exprval_t *val1, const exprval_t *val2, exprval_t *result,
// -5 mod -3 = -2 // -5 mod -3 = -2
double a = *(double *) val1->value; double a = *(double *) val1->value;
double b = *(double *) val2->value; double b = *(double *) val2->value;
*(double *) result->value = a - b * floorf (a / b); *(double *) result->value = a - b * floor (a / b);
} }
CASTOP (double, int) CASTOP (double, int)