diff --git a/lmathlib.c b/lmathlib.c index f49eb318..7197fc59 100644 --- a/lmathlib.c +++ b/lmathlib.c @@ -249,7 +249,7 @@ static int math_type (lua_State *L) { */ /* number of binary digits in the mantissa of a float */ -#define FIGS l_mathlim(MANT_DIG) +#define FIGS l_floatatt(MANT_DIG) #if FIGS > 64 /* there are only 64 random bits; use them all */ diff --git a/lstrlib.c b/lstrlib.c index 946461a8..586e0d78 100644 --- a/lstrlib.c +++ b/lstrlib.c @@ -1004,7 +1004,7 @@ static int str_gsub (lua_State *L) { ** to nibble boundaries by making what is left after that first digit a ** multiple of 4. */ -#define L_NBFD ((l_mathlim(MANT_DIG) - 1)%4 + 1) +#define L_NBFD ((l_floatatt(MANT_DIG) - 1)%4 + 1) /* @@ -1072,7 +1072,7 @@ static int lua_number2strx (lua_State *L, char *buff, int sz, ** and '\0') + number of decimal digits to represent maxfloat (which ** is maximum exponent + 1). (99+3+1, adding some extra, 110) */ -#define MAX_ITEMF (110 + l_mathlim(MAX_10_EXP)) +#define MAX_ITEMF (110 + l_floatatt(MAX_10_EXP)) /* diff --git a/luaconf.h b/luaconf.h index 8f13743b..bdf927e7 100644 --- a/luaconf.h +++ b/luaconf.h @@ -398,7 +398,7 @@ @@ LUA_NUMBER is the floating-point type used by Lua. @@ LUAI_UACNUMBER is the result of a 'default argument promotion' @@ over a floating number. -@@ l_mathlim(x) corrects limit name 'x' to the proper float type +@@ l_floatatt(x) corrects float attribute 'x' to the proper float type ** by prefixing it with one of FLT/DBL/LDBL. @@ LUA_NUMBER_FRMLEN is the length modifier for writing floats. @@ LUA_NUMBER_FMT is the format for writing floats. @@ -437,7 +437,7 @@ #define LUA_NUMBER float -#define l_mathlim(n) (FLT_##n) +#define l_floatatt(n) (FLT_##n) #define LUAI_UACNUMBER double @@ -453,7 +453,7 @@ #define LUA_NUMBER long double -#define l_mathlim(n) (LDBL_##n) +#define l_floatatt(n) (LDBL_##n) #define LUAI_UACNUMBER long double @@ -468,7 +468,7 @@ #define LUA_NUMBER double -#define l_mathlim(n) (DBL_##n) +#define l_floatatt(n) (DBL_##n) #define LUAI_UACNUMBER double diff --git a/lvm.c b/lvm.c index d70ac7ac..db7b0eed 100644 --- a/lvm.c +++ b/lvm.c @@ -55,7 +55,7 @@ */ /* number of bits in the mantissa of a float */ -#define NBM (l_mathlim(MANT_DIG)) +#define NBM (l_floatatt(MANT_DIG)) /* ** Check whether some integers may not fit in a float, testing whether