Implement round, ceil, and floor math functions.

This commit is contained in:
stag019
2014-11-08 00:17:26 -05:00
parent dca82e6d95
commit 9b4959cb75
4 changed files with 49 additions and 0 deletions

View File

@@ -155,4 +155,37 @@ SLONG
math_Div(SLONG i, SLONG j)
{
return (double2fix(fix2double(i) / fix2double(j)));
}/*
* RGBAsm - MATH.C (Fixedpoint math routines)
*
* Round
*
*/
SLONG
math_Round(SLONG i)
{
return double2fix(round(fix2double(i)));
}/*
* RGBAsm - MATH.C (Fixedpoint math routines)
*
* Ceil
*
*/
SLONG
math_Ceil(SLONG i)
{
return double2fix(ceil(fix2double(i)));
}/*
* RGBAsm - MATH.C (Fixedpoint math routines)
*
* Floor
*
*/
SLONG
math_Floor(SLONG i)
{
return double2fix(floor(fix2double(i)));
}