small improvement in the support of 'float' as lua_Number

This commit is contained in:
Roberto Ierusalimschy
2013-01-29 14:00:40 -02:00
parent 0730a56d38
commit 181a837cac
4 changed files with 48 additions and 46 deletions

View File

@@ -1,5 +1,5 @@
/*
** $Id: llimits.h,v 1.100 2012/10/01 14:14:45 roberto Exp roberto $
** $Id: llimits.h,v 1.101 2012/10/02 17:32:44 roberto Exp roberto $
** Limits, basic types, and some other `installation-dependent' definitions
** See Copyright Notice in lua.h
*/
@@ -282,7 +282,7 @@ union luai_Cast { double l_d; LUA_INT32 l_p[2]; };
#include <math.h>
#define luai_hashnum(i,n) { int e; \
n = frexp(n, &e) * (lua_Number)(INT_MAX - DBL_MAX_EXP); \
n = l_tg(frexp)(n, &e) * (lua_Number)(INT_MAX - DBL_MAX_EXP); \
lua_number2int(i, n); i += e; }
#endif