summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-12-05 13:31:07 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2019-12-05 13:31:07 -0300
commit2d92102dee88a81711dca8e8ea3ef0ea9d732283 (patch)
treeec1573ef5847b8d1788acfe5aa4137b0b92b70b7
parent490ecfcaa1f25fcc17f9dcb0ed7216da54a391e3 (diff)
downloadlua-2d92102dee88a81711dca8e8ea3ef0ea9d732283.tar.gz
lua-2d92102dee88a81711dca8e8ea3ef0ea9d732283.tar.bz2
lua-2d92102dee88a81711dca8e8ea3ef0ea9d732283.zip
'l_mathlim' renamed to 'l_floatatt'
That macro is applied to float attributes, not to limits.
-rw-r--r--lmathlib.c2
-rw-r--r--lstrlib.c4
-rw-r--r--luaconf.h8
-rw-r--r--lvm.c2
4 files changed, 8 insertions, 8 deletions
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) {
249*/ 249*/
250 250
251/* number of binary digits in the mantissa of a float */ 251/* number of binary digits in the mantissa of a float */
252#define FIGS l_mathlim(MANT_DIG) 252#define FIGS l_floatatt(MANT_DIG)
253 253
254#if FIGS > 64 254#if FIGS > 64
255/* there are only 64 random bits; use them all */ 255/* 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) {
1004** to nibble boundaries by making what is left after that first digit a 1004** to nibble boundaries by making what is left after that first digit a
1005** multiple of 4. 1005** multiple of 4.
1006*/ 1006*/
1007#define L_NBFD ((l_mathlim(MANT_DIG) - 1)%4 + 1) 1007#define L_NBFD ((l_floatatt(MANT_DIG) - 1)%4 + 1)
1008 1008
1009 1009
1010/* 1010/*
@@ -1072,7 +1072,7 @@ static int lua_number2strx (lua_State *L, char *buff, int sz,
1072** and '\0') + number of decimal digits to represent maxfloat (which 1072** and '\0') + number of decimal digits to represent maxfloat (which
1073** is maximum exponent + 1). (99+3+1, adding some extra, 110) 1073** is maximum exponent + 1). (99+3+1, adding some extra, 110)
1074*/ 1074*/
1075#define MAX_ITEMF (110 + l_mathlim(MAX_10_EXP)) 1075#define MAX_ITEMF (110 + l_floatatt(MAX_10_EXP))
1076 1076
1077 1077
1078/* 1078/*
diff --git a/luaconf.h b/luaconf.h
index 8f13743b..bdf927e7 100644
--- a/luaconf.h
+++ b/luaconf.h
@@ -398,7 +398,7 @@
398@@ LUA_NUMBER is the floating-point type used by Lua. 398@@ LUA_NUMBER is the floating-point type used by Lua.
399@@ LUAI_UACNUMBER is the result of a 'default argument promotion' 399@@ LUAI_UACNUMBER is the result of a 'default argument promotion'
400@@ over a floating number. 400@@ over a floating number.
401@@ l_mathlim(x) corrects limit name 'x' to the proper float type 401@@ l_floatatt(x) corrects float attribute 'x' to the proper float type
402** by prefixing it with one of FLT/DBL/LDBL. 402** by prefixing it with one of FLT/DBL/LDBL.
403@@ LUA_NUMBER_FRMLEN is the length modifier for writing floats. 403@@ LUA_NUMBER_FRMLEN is the length modifier for writing floats.
404@@ LUA_NUMBER_FMT is the format for writing floats. 404@@ LUA_NUMBER_FMT is the format for writing floats.
@@ -437,7 +437,7 @@
437 437
438#define LUA_NUMBER float 438#define LUA_NUMBER float
439 439
440#define l_mathlim(n) (FLT_##n) 440#define l_floatatt(n) (FLT_##n)
441 441
442#define LUAI_UACNUMBER double 442#define LUAI_UACNUMBER double
443 443
@@ -453,7 +453,7 @@
453 453
454#define LUA_NUMBER long double 454#define LUA_NUMBER long double
455 455
456#define l_mathlim(n) (LDBL_##n) 456#define l_floatatt(n) (LDBL_##n)
457 457
458#define LUAI_UACNUMBER long double 458#define LUAI_UACNUMBER long double
459 459
@@ -468,7 +468,7 @@
468 468
469#define LUA_NUMBER double 469#define LUA_NUMBER double
470 470
471#define l_mathlim(n) (DBL_##n) 471#define l_floatatt(n) (DBL_##n)
472 472
473#define LUAI_UACNUMBER double 473#define LUAI_UACNUMBER double
474 474
diff --git a/lvm.c b/lvm.c
index d70ac7ac..db7b0eed 100644
--- a/lvm.c
+++ b/lvm.c
@@ -55,7 +55,7 @@
55*/ 55*/
56 56
57/* number of bits in the mantissa of a float */ 57/* number of bits in the mantissa of a float */
58#define NBM (l_mathlim(MANT_DIG)) 58#define NBM (l_floatatt(MANT_DIG))
59 59
60/* 60/*
61** Check whether some integers may not fit in a float, testing whether 61** Check whether some integers may not fit in a float, testing whether