diff --git a/mathlib.c b/mathlib.c index f01e149d..896ec1f5 100644 --- a/mathlib.c +++ b/mathlib.c @@ -3,7 +3,7 @@ ** Mathematics library to LUA */ -char *rcs_mathlib="$Id: mathlib.c,v 1.16 1996/04/25 14:10:00 roberto Exp roberto $"; +char *rcs_mathlib="$Id: mathlib.c,v 1.17 1996/04/30 21:13:55 roberto Exp roberto $"; #include #include @@ -92,9 +92,9 @@ static void math_floor (void) static void math_mod (void) { - int d1 = (int)lua_check_number(1, "mod"); - int d2 = (int)lua_check_number(2, "mod"); - lua_pushnumber (d1%d2); + float x = lua_check_number(1, "mod"); + float y = lua_check_number(2, "mod"); + lua_pushnumber(fmod(x, y)); }