diff options
author | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2022-12-28 18:38:20 -0300 |
---|---|---|
committer | Roberto Ierusalimschy <roberto@inf.puc-rio.br> | 2022-12-28 18:38:20 -0300 |
commit | b5ab31a475ccf5f96c2ffb34fccc1d6592913794 (patch) | |
tree | ef6d2b1844ca672dc81ab4411e37abbef2b7c48f /testes/math.lua | |
parent | 140cdcced5e28bde7a89e88fcae428f318565f1d (diff) | |
parent | 314745ed8438d1276c6c928d5f9d4be018dfadb6 (diff) | |
download | lua-b5ab31a475ccf5f96c2ffb34fccc1d6592913794.tar.gz lua-b5ab31a475ccf5f96c2ffb34fccc1d6592913794.tar.bz2 lua-b5ab31a475ccf5f96c2ffb34fccc1d6592913794.zip |
Merge branch 'master' into nextversion
Diffstat (limited to 'testes/math.lua')
-rw-r--r-- | testes/math.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/testes/math.lua b/testes/math.lua index 48c1efe1..0191f7dd 100644 --- a/testes/math.lua +++ b/testes/math.lua | |||
@@ -50,7 +50,7 @@ end | |||
50 | local msgf2i = "number.* has no integer representation" | 50 | local msgf2i = "number.* has no integer representation" |
51 | 51 | ||
52 | -- float equality | 52 | -- float equality |
53 | function eq (a,b,limit) | 53 | local function eq (a,b,limit) |
54 | if not limit then | 54 | if not limit then |
55 | if floatbits >= 50 then limit = 1E-11 | 55 | if floatbits >= 50 then limit = 1E-11 |
56 | else limit = 1E-5 | 56 | else limit = 1E-5 |
@@ -62,7 +62,7 @@ end | |||
62 | 62 | ||
63 | 63 | ||
64 | -- equality with types | 64 | -- equality with types |
65 | function eqT (a,b) | 65 | local function eqT (a,b) |
66 | return a == b and math.type(a) == math.type(b) | 66 | return a == b and math.type(a) == math.type(b) |
67 | end | 67 | end |
68 | 68 | ||
@@ -83,7 +83,7 @@ end | |||
83 | do | 83 | do |
84 | local x = -1 | 84 | local x = -1 |
85 | local mz = 0/x -- minus zero | 85 | local mz = 0/x -- minus zero |
86 | t = {[0] = 10, 20, 30, 40, 50} | 86 | local t = {[0] = 10, 20, 30, 40, 50} |
87 | assert(t[mz] == t[0] and t[-0] == t[0]) | 87 | assert(t[mz] == t[0] and t[-0] == t[0]) |
88 | end | 88 | end |
89 | 89 | ||