diff options
author | Lua Team <team@lua.org> | 1996-11-19 12:00:00 +0000 |
---|---|---|
committer | repogen <> | 1996-11-19 12:00:00 +0000 |
commit | 47a298a24ad3a8202440051de5938618502302a0 (patch) | |
tree | 9be43568f1e90c9219d5e3860b58c8ac1db5f062 /clients/lib/mathlib.c | |
parent | 721542976ebc89f2f8d17d19be7e4426570b69be (diff) | |
download | lua-github-2.5.tar.gz |
Lua 2.52.5
Diffstat (limited to 'clients/lib/mathlib.c')
-rw-r--r-- | clients/lib/mathlib.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/clients/lib/mathlib.c b/clients/lib/mathlib.c index 07081e48..d8f8dc13 100644 --- a/clients/lib/mathlib.c +++ b/clients/lib/mathlib.c @@ -3,7 +3,7 @@ ** Mathematics library to LUA */ -char *rcs_mathlib="$Id: mathlib.c,v 1.17 1996/04/30 21:13:55 roberto Exp $"; +char *rcs_mathlib="$Id: mathlib.c,v 1.18 1996/08/01 14:55:33 roberto Exp $"; #include <stdlib.h> #include <math.h> @@ -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)); } |