aboutsummaryrefslogtreecommitdiff
path: root/testes/math.lua
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2025-05-18 11:43:43 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2025-05-18 11:43:43 -0300
commitabbae57c7844b1121e7251d56f681394f20c1821 (patch)
tree823201f4d2631fcae027117681553de80b2c96f0 /testes/math.lua
parentf2c1531e6cacb10926158d8def5fa5841a0f357e (diff)
downloadlua-abbae57c7844b1121e7251d56f681394f20c1821.tar.gz
lua-abbae57c7844b1121e7251d56f681394f20c1821.tar.bz2
lua-abbae57c7844b1121e7251d56f681394f20c1821.zip
Variable attributes can prefix name list
In this format, the attribute applies to all names in the list; e.g. "global<const> print, require, math".
Diffstat (limited to '')
-rw-r--r--testes/math.lua7
1 files changed, 3 insertions, 4 deletions
diff --git a/testes/math.lua b/testes/math.lua
index 242579b1..0d228d09 100644
--- a/testes/math.lua
+++ b/testes/math.lua
@@ -8,11 +8,10 @@ local string = require "string"
8 8
9global none 9global none
10 10
11global print, assert, pcall, type, pairs, load 11global<const> print, assert, pcall, type, pairs, load
12global tonumber, tostring, select 12global<const> tonumber, tostring, select
13 13
14local minint <const> = math.mininteger 14local<const> minint, maxint = math.mininteger, math.maxinteger
15local maxint <const> = math.maxinteger
16 15
17local intbits <const> = math.floor(math.log(maxint, 2) + 0.5) + 1 16local intbits <const> = math.floor(math.log(maxint, 2) + 0.5) + 1
18assert((1 << intbits) == 0) 17assert((1 << intbits) == 0)