diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-12-04 16:33:40 -0200 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2000-12-04 16:33:40 -0200 |
commit | 4894c2796277b47b0ffc8983e8231d2cc95ee09b (patch) | |
tree | dc702c79716a42f22301bc5b9b5798a28173f7c2 /lauxlib.c | |
parent | 10ac68c648e0e1d23fe5485bc711df8fc71b6ae3 (diff) | |
download | lua-4894c2796277b47b0ffc8983e8231d2cc95ee09b.tar.gz lua-4894c2796277b47b0ffc8983e8231d2cc95ee09b.tar.bz2 lua-4894c2796277b47b0ffc8983e8231d2cc95ee09b.zip |
lua_Number defined in lua.h (1st version)
Diffstat (limited to 'lauxlib.c')
-rw-r--r-- | lauxlib.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lauxlib.c,v 1.42 2000/10/30 12:38:50 roberto Exp roberto $ | 2 | ** $Id: lauxlib.c,v 1.43 2000/10/30 13:07:48 roberto Exp roberto $ |
3 | ** Auxiliary functions for building Lua libraries | 3 | ** Auxiliary functions for building Lua libraries |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -84,15 +84,15 @@ LUALIB_API const char *luaL_opt_lstr (lua_State *L, int narg, const char *def, s | |||
84 | } | 84 | } |
85 | 85 | ||
86 | 86 | ||
87 | LUALIB_API double luaL_check_number (lua_State *L, int narg) { | 87 | LUALIB_API lua_Number luaL_check_number (lua_State *L, int narg) { |
88 | double d = lua_tonumber(L, narg); | 88 | lua_Number d = lua_tonumber(L, narg); |
89 | if (d == 0 && !lua_isnumber(L, narg)) /* avoid extra test when d is not 0 */ | 89 | if (d == 0 && !lua_isnumber(L, narg)) /* avoid extra test when d is not 0 */ |
90 | type_error(L, narg, LUA_TNUMBER); | 90 | type_error(L, narg, LUA_TNUMBER); |
91 | return d; | 91 | return d; |
92 | } | 92 | } |
93 | 93 | ||
94 | 94 | ||
95 | LUALIB_API double luaL_opt_number (lua_State *L, int narg, double def) { | 95 | LUALIB_API lua_Number luaL_opt_number (lua_State *L, int narg, lua_Number def) { |
96 | if (lua_isnull(L, narg)) return def; | 96 | if (lua_isnull(L, narg)) return def; |
97 | else return luaL_check_number(L, narg); | 97 | else return luaL_check_number(L, narg); |
98 | } | 98 | } |