'l_mathlim' renamed to 'l_floatatt'

That macro is applied to float attributes, not to limits.
This commit is contained in:
Roberto Ierusalimschy 2019-12-05 13:31:07 -03:00
parent 490ecfcaa1
commit 2d92102dee
4 changed files with 8 additions and 8 deletions

View File

@ -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 */

View File

@ -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))
/*

View File

@ -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

2
lvm.c
View File

@ -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