mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 23:32:09 +00:00
[cexpr] Use correct functions for double trunc/floor
Found while sorting out the changes for the new 2d vectors.
This commit is contained in:
parent
9aa8f18d73
commit
937f36384b
1 changed files with 2 additions and 2 deletions
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue