mirror of
https://github.com/lua/lua
synced 2024-12-28 21:29:44 +03:00
'l_mathlim' renamed to 'l_floatatt'
That macro is applied to float attributes, not to limits.
This commit is contained in:
parent
490ecfcaa1
commit
2d92102dee
@ -249,7 +249,7 @@ static int math_type (lua_State *L) {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* number of binary digits in the mantissa of a float */
|
/* 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
|
#if FIGS > 64
|
||||||
/* there are only 64 random bits; use them all */
|
/* there are only 64 random bits; use them all */
|
||||||
|
@ -1004,7 +1004,7 @@ static int str_gsub (lua_State *L) {
|
|||||||
** to nibble boundaries by making what is left after that first digit a
|
** to nibble boundaries by making what is left after that first digit a
|
||||||
** multiple of 4.
|
** 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
|
** and '\0') + number of decimal digits to represent maxfloat (which
|
||||||
** is maximum exponent + 1). (99+3+1, adding some extra, 110)
|
** 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))
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -398,7 +398,7 @@
|
|||||||
@@ LUA_NUMBER is the floating-point type used by Lua.
|
@@ LUA_NUMBER is the floating-point type used by Lua.
|
||||||
@@ LUAI_UACNUMBER is the result of a 'default argument promotion'
|
@@ LUAI_UACNUMBER is the result of a 'default argument promotion'
|
||||||
@@ over a floating number.
|
@@ 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.
|
** by prefixing it with one of FLT/DBL/LDBL.
|
||||||
@@ LUA_NUMBER_FRMLEN is the length modifier for writing floats.
|
@@ LUA_NUMBER_FRMLEN is the length modifier for writing floats.
|
||||||
@@ LUA_NUMBER_FMT is the format for writing floats.
|
@@ LUA_NUMBER_FMT is the format for writing floats.
|
||||||
@ -437,7 +437,7 @@
|
|||||||
|
|
||||||
#define LUA_NUMBER float
|
#define LUA_NUMBER float
|
||||||
|
|
||||||
#define l_mathlim(n) (FLT_##n)
|
#define l_floatatt(n) (FLT_##n)
|
||||||
|
|
||||||
#define LUAI_UACNUMBER double
|
#define LUAI_UACNUMBER double
|
||||||
|
|
||||||
@ -453,7 +453,7 @@
|
|||||||
|
|
||||||
#define LUA_NUMBER long double
|
#define LUA_NUMBER long double
|
||||||
|
|
||||||
#define l_mathlim(n) (LDBL_##n)
|
#define l_floatatt(n) (LDBL_##n)
|
||||||
|
|
||||||
#define LUAI_UACNUMBER long double
|
#define LUAI_UACNUMBER long double
|
||||||
|
|
||||||
@ -468,7 +468,7 @@
|
|||||||
|
|
||||||
#define LUA_NUMBER double
|
#define LUA_NUMBER double
|
||||||
|
|
||||||
#define l_mathlim(n) (DBL_##n)
|
#define l_floatatt(n) (DBL_##n)
|
||||||
|
|
||||||
#define LUAI_UACNUMBER double
|
#define LUAI_UACNUMBER double
|
||||||
|
|
||||||
|
2
lvm.c
2
lvm.c
@ -55,7 +55,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* number of bits in the mantissa of a float */
|
/* 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
|
** Check whether some integers may not fit in a float, testing whether
|
||||||
|
Loading…
Reference in New Issue
Block a user