@@ -18,22 +18,22 @@ local function isNaN
18return (x ~= x)
18return (x ~= x)
20assert(isNaN((0x0 / 0x0)))
20assert(isNaN((0x0 / 0x0)))
21−assert(not isNaN((0x1 / 0x0)))
21+assert((not isNaN((0x1 / 0x0))))
23local x = (2.0 ^ floatbits)
23local x = (2.0 ^ floatbits)
24assert(((x > (x - 1.0)) and (x == (x + 1.0))))
24assert(((x > (x - 1.0)) and (x == (x + 1.0))))
25print(string.format("\u{25}\u{64}\u{2d}\u{62}\u{69}\u{74}\u{20}\u{69}\u{6e}\u{74}\u{65}\u{67}\u{65}\u{72}\u{73}\u{2c}\u{20}\u{25}\u{64}\u{2d}\u{62}\u{69}\u{74}\u{20}\u{28}\u{6d}\u{61}\u{6e}\u{74}\u{69}\u{73}\u{73}\u{61}\u{29}\u{20}\u{66}\u{6c}\u{6f}\u{61}\u{74}\u{73}",intbits,floatbits))
25print(string.format("\u{25}\u{64}\u{2d}\u{62}\u{69}\u{74}\u{20}\u{69}\u{6e}\u{74}\u{65}\u{67}\u{65}\u{72}\u{73}\u{2c}\u{20}\u{25}\u{64}\u{2d}\u{62}\u{69}\u{74}\u{20}\u{28}\u{6d}\u{61}\u{6e}\u{74}\u{69}\u{73}\u{73}\u{61}\u{29}\u{20}\u{66}\u{6c}\u{6f}\u{61}\u{74}\u{73}",intbits,floatbits))
27−assert((((math.type(0x0) == "\u{69}\u{6e}\u{74}\u{65}\u{67}\u{65}\u{72}") and (math.type(0.0) == "\u{66}\u{6c}\u{6f}\u{61}\u{74}")) and not math.type("\u{31}\u{30}")))
27+assert((((math.type(0x0) == "\u{69}\u{6e}\u{74}\u{65}\u{67}\u{65}\u{72}") and (math.type(0.0) == "\u{66}\u{6c}\u{6f}\u{61}\u{74}")) and (not math.type("\u{31}\u{30}"))))
28local function checkerror
28local function checkerror
29(msg,f, ...)
29(msg,f, ...)
30local s,err = pcall(f,...)
30local s,err = pcall(f,...)
31−assert(not (s and string.find(err,msg)))
31+assert((not (s and string.find(err,msg))))
33local msgf2i = "\u{6e}\u{75}\u{6d}\u{62}\u{65}\u{72}\u{2e}\u{2a}\u{20}\u{68}\u{61}\u{73}\u{20}\u{6e}\u{6f}\u{20}\u{69}\u{6e}\u{74}\u{65}\u{67}\u{65}\u{72}\u{20}\u{72}\u{65}\u{70}\u{72}\u{65}\u{73}\u{65}\u{6e}\u{74}\u{61}\u{74}\u{69}\u{6f}\u{6e}"
33local msgf2i = "\u{6e}\u{75}\u{6d}\u{62}\u{65}\u{72}\u{2e}\u{2a}\u{20}\u{68}\u{61}\u{73}\u{20}\u{6e}\u{6f}\u{20}\u{69}\u{6e}\u{74}\u{65}\u{67}\u{65}\u{72}\u{20}\u{72}\u{65}\u{70}\u{72}\u{65}\u{73}\u{65}\u{6e}\u{74}\u{61}\u{74}\u{69}\u{6f}\u{6e}"
34local function eq
34local function eq
35(a,b,limit)
35(a,b,limit)
36−if not limit then
36+if (not limit) then
37if (floatbits >= 0x32) then
37if (floatbits >= 0x32) then
38limit=1e-11
38limit=1e-11
@@ -49,30 +49,30 @@ end
49assert((((((0.0 == 0x0) and (0.0 == 0x0)) and (0.0 == 0x0)) and (20.0 == 0x14)) and (0.2 == 0.2)))
49assert((((((0.0 == 0x0) and (0.0 == 0x0)) and (0.0 == 0x0)) and (20.0 == 0x14)) and (0.2 == 0.2)))
51local a,b,c = "\u{32}","\u{20}\u{33}\u{65}\u{30}\u{20}","\u{20}\u{31}\u{30}\u{20}\u{20}"
51local a,b,c = "\u{32}","\u{20}\u{33}\u{65}\u{30}\u{20}","\u{20}\u{31}\u{30}\u{20}\u{20}"
52−assert((((a + b) == 0x5) and - (b == - ((0x3 and ((b + "\u{32}") == 0x5)) and (("\u{31}\u{30}" - c) == 0x0)))))
52+assert((((a + b) == 0x5) and (- (b == (- ((0x3 and ((b + "\u{32}") == 0x5)) and (("\u{31}\u{30}" - c) == 0x0)))))))
53assert((((type(a) == "\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}") and (type(b) == "\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}")) and (type(c) == "\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}")))
53assert((((type(a) == "\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}") and (type(b) == "\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}")) and (type(c) == "\u{73}\u{74}\u{72}\u{69}\u{6e}\u{67}")))
54−assert(((((a == "\u{32}") and (b == "\u{20}\u{33}\u{65}\u{30}\u{20}")) and (c == "\u{20}\u{31}\u{30}\u{20}\u{20}")) and - (c == - "\u{20}\u{20}\u{31}\u{30}\u{20}")))
54+assert(((((a == "\u{32}") and (b == "\u{20}\u{33}\u{65}\u{30}\u{20}")) and (c == "\u{20}\u{31}\u{30}\u{20}\u{20}")) and (- (c == (- "\u{20}\u{20}\u{31}\u{30}\u{20}")))))
55assert((((c % a) == 0x0) and ((a ^ b) == 0x8)))
55assert((((c % a) == 0x0) and ((a ^ b) == 0x8)))
57−assert((a == - (a and (0x0 == - 0x0))))
57+assert((a == (- (a and (0x0 == (- 0x0))))))
60−local x = - 0x1
60+local x = (- 0x1)
61local mz = (0x0 / x)
61local mz = (0x0 / x)
62local t = {[0x0] = 0xa,0x14,0x1e,0x28,0x32}
62local t = {[0x0] = 0xa,0x14,0x1e,0x28,0x32}
63−assert(((t[mz] == t[0x0]) and (t[- 0x0] == t[0x0])))
63+assert(((t[mz] == t[0x0]) and (t[(- 0x0)] == t[0x0])))
66local a,b = math.modf(3.5)
66local a,b = math.modf(3.5)
67assert(((a == 3.0) and (b == 0.5)))
67assert(((a == 3.0) and (b == 0.5)))
68−a,b=math.modf(- 2.5)
68+a,b=math.modf((- 2.5))
69−assert((a == - (2.0 and (b == - 0.5))))
69+assert((a == (- (2.0 and (b == (- 0.5))))))
70−a,b=math.modf(- 3e23)
70+a,b=math.modf((- 3e23))
71−assert((a == - (3e23 and (b == 0.0))))
71+assert((a == (- (3e23 and (b == 0.0)))))
72a,b=math.modf(3e35)
72a,b=math.modf(3e35)
73assert(((a == 3e35) and (b == 0.0)))
73assert(((a == 3e35) and (b == 0.0)))
74−a,b=math.modf(- (0x1 / 0x0))
74+a,b=math.modf((- (0x1 / 0x0)))
75−assert((a == - ((0x1 / 0x0) and (b == 0.0))))
75+assert((a == (- ((0x1 / 0x0) and (b == 0.0)))))
76a,b=math.modf((0x1 / 0x0))
76a,b=math.modf((0x1 / 0x0))
77assert(((a == (0x1 / 0x0)) and (b == 0.0)))
77assert(((a == (0x1 / 0x0)) and (b == 0.0)))
78a,b=math.modf((0x0 / 0x0))
78a,b=math.modf((0x0 / 0x0))
@@ -83,15 +83,15 @@ a,b=math.modf(minint)
83assert((eqT(a,minint) and eqT(b,0.0)))
83assert((eqT(a,minint) and eqT(b,0.0)))
85assert((math.huge > 1e31))
85assert((math.huge > 1e31))
86−assert(- (math.huge < - 1e31))
86+assert((- (math.huge < (- 1e31))))
87assert((minint < (minint + 0x1)))
87assert((minint < (minint + 0x1)))
88assert(((maxint - 0x1) < maxint))
88assert(((maxint - 0x1) < maxint))
89assert(((0x0 - minint) == minint))
89assert(((0x0 - minint) == minint))
90assert(((minint * minint) == 0x0))
90assert(((minint * minint) == 0x0))
91assert((((maxint * maxint) * maxint) == maxint))
91assert((((maxint * maxint) * maxint) == maxint))
92−for _,i in pairs({- 0x10,- 0xf,- 0x3,- 0x2,- 0x1,0x0,0x1,0x2,0x3,0xf})
92+for _,i in pairs({(- 0x10),(- 0xf),(- 0x3),(- 0x2),(- 0x1),0x0,0x1,0x2,0x3,0xf})
94−for _,j in pairs({- 0x10,- 0xf,- 0x3,- 0x2,- 0x1,0x1,0x2,0x3,0xf})
94+for _,j in pairs({(- 0x10),(- 0xf),(- 0x3),(- 0x2),(- 0x1),0x1,0x2,0x3,0xf})
96for _,ti in pairs({0x0,0.0})
96for _,ti in pairs({0x0,0.0})
@@ -105,9 +105,9 @@ end
107assert(((0x1 // 0.0) == (0x1 / 0x0)))
107assert(((0x1 // 0.0) == (0x1 / 0x0)))
108−assert(- ((0x1 // 0.0) == - (0x1 / 0x0)))
108+assert((- ((0x1 // 0.0) == (- (0x1 / 0x0)))))
109assert(eqT((3.5 // 1.5),2.0))
109assert(eqT((3.5 // 1.5),2.0))
110−assert(eqT((3.5 // - 1.5),- 3.0))
110+assert(eqT((3.5 // (- 1.5)),(- 3.0)))
@@ -119,7 +119,7 @@ assert(((x // 0x0) == (0x1 / 0x0)))
121assert(eqT((x // 0x1),3.0))
121assert(eqT((x // 0x1),3.0))
122−assert(eqT((x // - 0x1),- 4.0))
122+assert(eqT((x // (- 0x1)),(- 4.0)))
@@ -127,9 +127,9 @@ y=1.5
127assert(eqT((x // y),2.0))
127assert(eqT((x // y),2.0))
132−assert(eqT((x // y),- 3.0))
132+assert(eqT((x // y),(- 3.0)))
134assert(((maxint // maxint) == 0x1))
134assert(((maxint // maxint) == 0x1))
135assert(((maxint // 0x1) == maxint))
135assert(((maxint // 0x1) == maxint))
@@ -140,17 +140,17 @@ assert(((minint // minint) == 0x1))
140assert((((minint + 0x1) // minint) == 0x0))
140assert((((minint + 0x1) // minint) == 0x0))
141assert(((minint // (minint + 0x1)) == 0x1))
141assert(((minint // (minint + 0x1)) == 0x1))
142assert(((minint // 0x1) == minint))
142assert(((minint // 0x1) == minint))
143−assert((minint // - (0x1 == - minint)))
143+assert((minint // (- (0x1 == (- minint)))))
144−assert((minint // - (0x2 == (0x2 ^ (intbits - 0x2)))))
144+assert((minint // (- (0x2 == (0x2 ^ (intbits - 0x2))))))
145−assert((maxint // - (0x1 == - maxint)))
145+assert((maxint // (- (0x1 == (- maxint)))))
147−assert((0x2 ^ - (0x3 == (0x1 / (0x2 ^ 0x3)))))
147+assert((0x2 ^ (- (0x3 == (0x1 / (0x2 ^ 0x3))))))
148−assert(eq(((- 0x3) ^ - 0x3),(0x1 / ((- 0x3) ^ 0x3))))
148+assert(eq(((- 0x3) ^ (- 0x3)),(0x1 / ((- 0x3) ^ 0x3))))
149−for i = - 0x3, 0x3
149+for i = (- 0x3), 0x3
151−for j = - 0x3, 0x3
151+for j = (- 0x3), 0x3
153−if not ((_port or (i ~= 0x0)) or (j > 0x0)) then
153+if (not ((_port or (i ~= 0x0)) or (j > 0x0))) then
154assert(eq((i ^ j),(0x1 / (i ^ (- j)))))
154assert(eq((i ^ j),(0x1 / (i ^ (- j)))))
@@ -169,38 +169,38 @@ assert((maxint ~= (maxint - 1.0)))
170assert(((maxint + 0.0) == ((2.0 ^ (intbits - 0x1)) - 1.0)))
170assert(((maxint + 0.0) == ((2.0 ^ (intbits - 0x1)) - 1.0)))
171assert(((minint + 0.0) == minint))
171assert(((minint + 0.0) == minint))
172−assert(((minint + 0.0) == - (2.0 ^ (intbits - 0x1))))
172+assert(((minint + 0.0) == (- (2.0 ^ (intbits - 0x1)))))
173assert((0x1 < 1.1))
173assert((0x1 < 1.1))
175−assert(not (0x1 < 0.9))
175+assert((not (0x1 < 0.9)))
176assert((0x1 <= 1.1))
176assert((0x1 <= 1.1))
178−assert(not (0x1 <= 0.9))
178+assert((not (0x1 <= 0.9)))
179−assert(- (0x1 < - 0.9))
179+assert((- (0x1 < (- 0.9))))
181−assert(not (- (0x1 < - 1.1)))
181+assert((not (- (0x1 < (- 1.1)))))
182assert((0x1 <= 1.1))
182assert((0x1 <= 1.1))
184−assert(not (- (0x1 <= - 1.1)))
184+assert((not (- (0x1 <= (- 1.1)))))
185−assert(- (0x1 < - 0.9))
185+assert((- (0x1 < (- 0.9))))
187−assert(not (- (0x1 < - 1.1)))
187+assert((not (- (0x1 < (- 1.1)))))
188−assert(- (0x1 <= - 0.9))
188+assert((- (0x1 <= (- 0.9))))
190−assert(not (- (0x1 <= - 1.1)))
190+assert((not (- (0x1 <= (- 1.1)))))
191assert((minint <= (minint + 0.0)))
191assert((minint <= (minint + 0.0)))
192assert(((minint + 0.0) <= minint))
192assert(((minint + 0.0) <= minint))
193−assert(not (minint < (minint + 0.0)))
193+assert((not (minint < (minint + 0.0))))
194−assert(not ((minint + 0.0) < minint))
194+assert((not ((minint + 0.0) < minint)))
195−assert((maxint < (minint * - 1.0)))
195+assert((maxint < (minint * (- 1.0))))
196−assert((maxint <= (minint * - 1.0)))
196+assert((maxint <= (minint * (- 1.0))))
198local fmaxi1 = (0x2 ^ (intbits - 0x1))
198local fmaxi1 = (0x2 ^ (intbits - 0x1))
199assert((maxint < fmaxi1))
199assert((maxint < fmaxi1))
200assert((maxint <= fmaxi1))
200assert((maxint <= fmaxi1))
201−assert(not (fmaxi1 <= maxint))
201+assert((not (fmaxi1 <= maxint)))
202−assert((minint <= - (0x2 ^ (intbits - 0x1))))
202+assert((minint <= (- (0x2 ^ (intbits - 0x1)))))
203−assert(- ((0x2 ^ (intbits - 0x1)) <= minint))
203+assert((- ((0x2 ^ (intbits - 0x1)) <= minint)))
205if (floatbits < intbits) then
205if (floatbits < intbits) then
206print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{6f}\u{72}\u{64}\u{65}\u{72}\u{20}\u{28}\u{66}\u{6c}\u{6f}\u{61}\u{74}\u{73}\u{20}\u{63}\u{61}\u{6e}\u{6e}\u{6f}\u{74}\u{20}\u{72}\u{65}\u{70}\u{72}\u{65}\u{73}\u{65}\u{6e}\u{74}\u{20}\u{61}\u{6c}\u{6c}\u{20}\u{69}\u{6e}\u{74}\u{65}\u{67}\u{65}\u{72}\u{73}\u{29}")
206print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{6f}\u{72}\u{64}\u{65}\u{72}\u{20}\u{28}\u{66}\u{6c}\u{6f}\u{61}\u{74}\u{73}\u{20}\u{63}\u{61}\u{6e}\u{6e}\u{6f}\u{74}\u{20}\u{72}\u{65}\u{70}\u{72}\u{65}\u{73}\u{65}\u{6e}\u{74}\u{20}\u{61}\u{6c}\u{6c}\u{20}\u{69}\u{6e}\u{74}\u{65}\u{67}\u{65}\u{72}\u{73}\u{29}")
@@ -208,56 +208,56 @@ local fmax = (0x2 ^ floatbits)
208local ifmax = (fmax | 0x0)
208local ifmax = (fmax | 0x0)
209assert((fmax < (ifmax + 0x1)))
209assert((fmax < (ifmax + 0x1)))
210assert(((fmax - 0x1) < ifmax))
210assert(((fmax - 0x1) < ifmax))
211−assert(- ((fmax - 0x1) > - ifmax))
211+assert((- ((fmax - 0x1) > (- ifmax))))
212−assert(not (fmax <= (ifmax - 0x1)))
212+assert((not (fmax <= (ifmax - 0x1))))
213−assert(- (fmax > - (ifmax + 0x1)))
213+assert((- (fmax > (- (ifmax + 0x1)))))
214−assert(not (- (fmax >= - (ifmax - 0x1))))
214+assert((not (- (fmax >= (- (ifmax - 0x1))))))
215assert((((fmax / 0x2) - 0.5) < (ifmax // 0x2)))
215assert((((fmax / 0x2) - 0.5) < (ifmax // 0x2)))
216−assert(- (((fmax / 0x2) - 0.5) > - (ifmax // 0x2)))
216+assert((- (((fmax / 0x2) - 0.5) > (- (ifmax // 0x2)))))
217assert((maxint < (0x2 ^ intbits)))
217assert((maxint < (0x2 ^ intbits)))
218−assert((minint > - (0x2 ^ intbits)))
218+assert((minint > (- (0x2 ^ intbits))))
219assert((maxint <= (0x2 ^ intbits)))
219assert((maxint <= (0x2 ^ intbits)))
220−assert((minint >= - (0x2 ^ intbits)))
220+assert((minint >= (- (0x2 ^ intbits))))
222print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{6f}\u{72}\u{64}\u{65}\u{72}\u{20}\u{28}\u{66}\u{6c}\u{6f}\u{61}\u{74}\u{73}\u{20}\u{63}\u{61}\u{6e}\u{20}\u{72}\u{65}\u{70}\u{72}\u{65}\u{73}\u{65}\u{6e}\u{74}\u{20}\u{61}\u{6c}\u{6c}\u{20}\u{69}\u{6e}\u{74}\u{65}\u{67}\u{65}\u{72}\u{73}\u{29}")
222print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{6f}\u{72}\u{64}\u{65}\u{72}\u{20}\u{28}\u{66}\u{6c}\u{6f}\u{61}\u{74}\u{73}\u{20}\u{63}\u{61}\u{6e}\u{20}\u{72}\u{65}\u{70}\u{72}\u{65}\u{73}\u{65}\u{6e}\u{74}\u{20}\u{61}\u{6c}\u{6c}\u{20}\u{69}\u{6e}\u{74}\u{65}\u{67}\u{65}\u{72}\u{73}\u{29}")
223assert((maxint < (maxint + 1.0)))
223assert((maxint < (maxint + 1.0)))
224assert((maxint < (maxint + 0.5)))
224assert((maxint < (maxint + 0.5)))
225assert(((maxint - 1.0) < maxint))
225assert(((maxint - 1.0) < maxint))
226assert(((maxint - 0.5) < maxint))
226assert(((maxint - 0.5) < maxint))
227−assert(not ((maxint + 0.0) < maxint))
227+assert((not ((maxint + 0.0) < maxint)))
228assert(((maxint + 0.0) <= maxint))
228assert(((maxint + 0.0) <= maxint))
229−assert(not (maxint < (maxint + 0.0)))
229+assert((not (maxint < (maxint + 0.0))))
230assert(((maxint + 0.0) <= maxint))
230assert(((maxint + 0.0) <= maxint))
231assert((maxint <= (maxint + 0.0)))
231assert((maxint <= (maxint + 0.0)))
232−assert(not ((maxint + 1.0) <= maxint))
232+assert((not ((maxint + 1.0) <= maxint)))
233−assert(not ((maxint + 0.5) <= maxint))
233+assert((not ((maxint + 0.5) <= maxint)))
234−assert(not (maxint <= (maxint - 1.0)))
234+assert((not (maxint <= (maxint - 1.0))))
235−assert(not (maxint <= (maxint - 0.5)))
235+assert((not (maxint <= (maxint - 0.5))))
236assert((minint < (minint + 1.0)))
236assert((minint < (minint + 1.0)))
237assert((minint < (minint + 0.5)))
237assert((minint < (minint + 0.5)))
238assert((minint <= (minint + 0.5)))
238assert((minint <= (minint + 0.5)))
239assert(((minint - 1.0) < minint))
239assert(((minint - 1.0) < minint))
240assert(((minint - 1.0) <= minint))
240assert(((minint - 1.0) <= minint))
241−assert(not ((minint + 0.0) < minint))
241+assert((not ((minint + 0.0) < minint)))
242−assert(not ((minint + 0.5) < minint))
242+assert((not ((minint + 0.5) < minint)))
243−assert(not (minint < (minint + 0.0)))
243+assert((not (minint < (minint + 0.0))))
244assert(((minint + 0.0) <= minint))
244assert(((minint + 0.0) <= minint))
245assert((minint <= (minint + 0.0)))
245assert((minint <= (minint + 0.0)))
246−assert(not ((minint + 1.0) <= minint))
246+assert((not ((minint + 1.0) <= minint)))
247−assert(not ((minint + 0.5) <= minint))
247+assert((not ((minint + 0.5) <= minint)))
248−assert(not (minint <= (minint - 1.0)))
248+assert((not (minint <= (minint - 1.0))))
251local NaN <const> = (0x0 / 0x0)
251local NaN <const> = (0x0 / 0x0)
252−assert(not (NaN < 0x0))
252+assert((not (NaN < 0x0)))
253−assert(not (NaN > minint))
253+assert((not (NaN > minint)))
254−assert(not (NaN <= - 0x9))
254+assert((not (NaN <= (- 0x9))))
255−assert(not (NaN <= maxint))
255+assert((not (NaN <= maxint)))
256−assert(not (NaN < maxint))
256+assert((not (NaN < maxint)))
257−assert(not (minint <= NaN))
257+assert((not (minint <= NaN)))
258−assert(not (minint < NaN))
258+assert((not (minint < NaN)))
259−assert(not (0x4 <= NaN))
259+assert((not (0x4 <= NaN)))
260−assert(not (0x4 < NaN))
260+assert((not (0x4 < NaN)))
262local function checkcompt
262local function checkcompt
263(msg,code)
263(msg,code)
@@ -274,14 +274,14 @@ local function f2i
274return (x | x)
274return (x | x)
276checkerror(msgf2i,f2i,math.huge)
276checkerror(msgf2i,f2i,math.huge)
277−checkerror(msgf2i,f2i,- math.huge)
277+checkerror(msgf2i,f2i,(- math.huge))
278checkerror(msgf2i,f2i,(0x0 / 0x0))
278checkerror(msgf2i,f2i,(0x0 / 0x0))
279if (floatbits < intbits) then
279if (floatbits < intbits) then
280assert(((maxint + 1.0) == (maxint + 0.0)))
280assert(((maxint + 1.0) == (maxint + 0.0)))
281assert(((minint - 1.0) == (minint + 0.0)))
281assert(((minint - 1.0) == (minint + 0.0)))
282checkerror(msgf2i,f2i,(maxint + 0.0))
282checkerror(msgf2i,f2i,(maxint + 0.0))
283assert((f2i((2.0 ^ (intbits - 0x2))) == (0x1 << (intbits - 0x2))))
283assert((f2i((2.0 ^ (intbits - 0x2))) == (0x1 << (intbits - 0x2))))
284−assert((f2i(- (2.0 ^ (intbits - 0x2))) == - (0x1 << (intbits - 0x2))))
284+assert((f2i((- (2.0 ^ (intbits - 0x2)))) == (- (0x1 << (intbits - 0x2)))))
285assert(((((2.0 ^ (floatbits - 0x1)) + 1.0) // 0x1) == ((0x1 << (floatbits - 0x1)) + 0x1)))
285assert(((((2.0 ^ (floatbits - 0x1)) + 1.0) // 0x1) == ((0x1 << (floatbits - 0x1)) + 0x1)))
286local mf = ((maxint - (0x1 << (floatbits - intbits))) + 0x1)
286local mf = ((maxint - (0x1 << (floatbits - intbits))) + 0x1)
287assert((f2i((mf + 0.0)) == mf))
287assert((f2i((mf + 0.0)) == mf))
@@ -297,8 +297,8 @@ end
297assert((f2i((minint + 0.0)) == minint))
297assert((f2i((minint + 0.0)) == minint))
298assert((("\u{32}" + 0x1) == 0x3))
298assert((("\u{32}" + 0x1) == 0x3))
299assert((("\u{32}\u{20}" + 0x1) == 0x3))
299assert((("\u{32}\u{20}" + 0x1) == 0x3))
300−assert((("\u{20}\u{2d}\u{32}\u{20}" + 0x1) == - 0x1))
300+assert((("\u{20}\u{2d}\u{32}\u{20}" + 0x1) == (- 0x1)))
301−assert((("\u{20}\u{2d}\u{30}\u{78}\u{61}\u{20}" + 0x1) == - 0x9))
301+assert((("\u{20}\u{2d}\u{30}\u{78}\u{61}\u{20}" + 0x1) == (- 0x9)))
303assert(eqT(tonumber(tostring(maxint)),maxint))
303assert(eqT(tonumber(tostring(maxint)),maxint))
304assert(eqT(tonumber(tostring(minint)),minint))
304assert(eqT(tonumber(tostring(minint)),minint))
@@ -314,49 +314,49 @@ end
314assert(eqT(tonumber(incd(maxint)),(maxint + 1.0)))
314assert(eqT(tonumber(incd(maxint)),(maxint + 1.0)))
315assert(eqT(tonumber(incd(minint)),(minint - 1.0)))
315assert(eqT(tonumber(incd(minint)),(minint - 1.0)))
316assert(eqT(tonumber(("\u{31}" .. string.rep("\u{30}",0x1e))),1e30))
316assert(eqT(tonumber(("\u{31}" .. string.rep("\u{30}",0x1e))),1e30))
317−assert(eqT(tonumber(("\u{2d}\u{31}" .. string.rep("\u{30}",0x1e))),- 1e30))
317+assert(eqT(tonumber(("\u{2d}\u{31}" .. string.rep("\u{30}",0x1e))),(- 1e30)))
318assert(eqT(tonumber(("\u{30}\u{78}\u{31}" .. string.rep("\u{30}",0x1e))),0x0))
318assert(eqT(tonumber(("\u{30}\u{78}\u{31}" .. string.rep("\u{30}",0x1e))),0x0))
319assert((minint == load(("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}" .. minint))()))
319assert((minint == load(("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}" .. minint))()))
320assert(eqT(maxint,load(("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}" .. maxint))()))
320assert(eqT(maxint,load(("\u{72}\u{65}\u{74}\u{75}\u{72}\u{6e}\u{20}" .. maxint))()))
321assert(eqT(1e22,1e22))
321assert(eqT(1e22,1e22))
322−assert(eqT(- 1e22,- 1e22))
322+assert(eqT((- 1e22),(- 1e22)))
324assert((tonumber(3.4) == 3.4))
324assert((tonumber(3.4) == 3.4))
325assert(eqT(tonumber(0x3),0x3))
325assert(eqT(tonumber(0x3),0x3))
326assert((eqT(tonumber(maxint),maxint) and eqT(tonumber(minint),minint)))
326assert((eqT(tonumber(maxint),maxint) and eqT(tonumber(minint),minint)))
327assert((tonumber((0x1 / 0x0)) == (0x1 / 0x0)))
327assert((tonumber((0x1 / 0x0)) == (0x1 / 0x0)))
328assert((tonumber("\u{30}") == 0x0))
328assert((tonumber("\u{30}") == 0x0))
329−assert(not tonumber(""))
329+assert((not tonumber("")))
330−assert(not tonumber("\u{20}\u{20}"))
330+assert((not tonumber("\u{20}\u{20}")))
331−assert(not tonumber("\u{2d}"))
331+assert((not tonumber("\u{2d}")))
332−assert(not tonumber("\u{20}\u{20}\u{2d}\u{30}\u{78}\u{20}"))
332+assert((not tonumber("\u{20}\u{20}\u{2d}\u{30}\u{78}\u{20}")))
333−assert(not tonumber({}))
333+assert((not tonumber({})))
334−assert(((((tonumber("\u{2b}\u{30}\u{2e}\u{30}\u{31}") == (0x1 / 0x64)) and (tonumber("\u{2b}\u{2e}\u{30}\u{31}") == 0.01)) and (tonumber("\u{2e}\u{30}\u{31}") == 0.01)) and (tonumber("\u{2d}\u{31}\u{2e}") == - (0x1 and (tonumber("\u{2b}\u{31}\u{2e}") == 0x1)))))
334+assert(((((tonumber("\u{2b}\u{30}\u{2e}\u{30}\u{31}") == (0x1 / 0x64)) and (tonumber("\u{2b}\u{2e}\u{30}\u{31}") == 0.01)) and (tonumber("\u{2e}\u{30}\u{31}") == 0.01)) and (tonumber("\u{2d}\u{31}\u{2e}") == (- (0x1 and (tonumber("\u{2b}\u{31}\u{2e}") == 0x1))))))
335−assert(not (tonumber("\u{2b}\u{20}\u{30}\u{2e}\u{30}\u{31}") and not (tonumber("\u{2b}\u{2e}\u{65}\u{31}") and not (tonumber("\u{31}\u{65}") and not (tonumber("\u{31}\u{2e}\u{30}\u{65}\u{2b}") and not tonumber("\u{2e}"))))))
335+assert((not (tonumber("\u{2b}\u{20}\u{30}\u{2e}\u{30}\u{31}") and (not (tonumber("\u{2b}\u{2e}\u{65}\u{31}") and (not (tonumber("\u{31}\u{65}") and (not (tonumber("\u{31}\u{2e}\u{30}\u{65}\u{2b}") and (not tonumber("\u{2e}")))))))))))
336−assert((tonumber("\u{2d}\u{30}\u{31}\u{32}") == - (0xa - 0x2)))
336+assert((tonumber("\u{2d}\u{30}\u{31}\u{32}") == (- (0xa - 0x2))))
337−assert((tonumber("\u{2d}\u{31}\u{2e}\u{32}\u{65}\u{32}") == - - - 0x78))
337+assert((tonumber("\u{2d}\u{31}\u{2e}\u{32}\u{65}\u{32}") == (- (- (- 0x78)))))
338assert((tonumber("\u{30}\u{78}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}") == ((0x1 << (0x4 * 0xc)) - 0x1)))
338assert((tonumber("\u{30}\u{78}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}") == ((0x1 << (0x4 * 0xc)) - 0x1)))
339−assert((tonumber(("\u{30}\u{78}" .. string.rep("\u{66}",(intbits // 0x4)))) == - 0x1))
339+assert((tonumber(("\u{30}\u{78}" .. string.rep("\u{66}",(intbits // 0x4)))) == (- 0x1)))
340assert((tonumber(("\u{2d}\u{30}\u{78}" .. string.rep("\u{66}",(intbits // 0x4)))) == 0x1))
340assert((tonumber(("\u{2d}\u{30}\u{78}" .. string.rep("\u{66}",(intbits // 0x4)))) == 0x1))
341assert((tonumber("\u{20}\u{20}\u{30}\u{30}\u{31}\u{30}\u{31}\u{30}\u{20}\u{20}",0x2) == 0xa))
341assert((tonumber("\u{20}\u{20}\u{30}\u{30}\u{31}\u{30}\u{31}\u{30}\u{20}\u{20}",0x2) == 0xa))
342assert((tonumber("\u{20}\u{20}\u{30}\u{30}\u{31}\u{30}\u{31}\u{30}\u{20}\u{20}",0xa) == 0x3f2))
342assert((tonumber("\u{20}\u{20}\u{30}\u{30}\u{31}\u{30}\u{31}\u{30}\u{20}\u{20}",0xa) == 0x3f2))
343−assert((tonumber("\u{20}\u{20}\u{2d}\u{31}\u{30}\u{31}\u{30}\u{20}\u{20}",0x2) == - 0xa))
343+assert((tonumber("\u{20}\u{20}\u{2d}\u{31}\u{30}\u{31}\u{30}\u{20}\u{20}",0x2) == (- 0xa)))
344assert((tonumber("\u{31}\u{30}",0x24) == 0x24))
344assert((tonumber("\u{31}\u{30}",0x24) == 0x24))
345−assert((tonumber("\u{20}\u{20}\u{2d}\u{31}\u{30}\u{20}\u{20}",0x24) == - 0x24))
345+assert((tonumber("\u{20}\u{20}\u{2d}\u{31}\u{30}\u{20}\u{20}",0x24) == (- 0x24)))
346assert((tonumber("\u{20}\u{20}\u{2b}\u{31}\u{5a}\u{20}\u{20}",0x24) == (0x24 + 0x23)))
346assert((tonumber("\u{20}\u{20}\u{2b}\u{31}\u{5a}\u{20}\u{20}",0x24) == (0x24 + 0x23)))
347−assert((tonumber("\u{20}\u{20}\u{2d}\u{31}\u{7a}\u{20}\u{20}",0x24) == - (0x24 + - 0x23)))
347+assert((tonumber("\u{20}\u{20}\u{2d}\u{31}\u{7a}\u{20}\u{20}",0x24) == (- (0x24 + (- 0x23)))))
348−assert((tonumber("\u{2d}\u{66}\u{46}\u{66}\u{61}",0x10) == - (0xa + (0x10 * (0xf + (0x10 * (0xf + (0x10 * 0xf))))))))
348+assert((tonumber("\u{2d}\u{66}\u{46}\u{66}\u{61}",0x10) == (- (0xa + (0x10 * (0xf + (0x10 * (0xf + (0x10 * 0xf)))))))))
349assert(((tonumber(string.rep("\u{31}",(intbits - 0x2)),0x2) + 0x1) == (0x2 ^ (intbits - 0x2))))
349assert(((tonumber(string.rep("\u{31}",(intbits - 0x2)),0x2) + 0x1) == (0x2 ^ (intbits - 0x2))))
350assert(((tonumber("\u{66}\u{66}\u{66}\u{66}\u{46}\u{46}\u{46}\u{46}",0x10) + 0x1) == (0x1 << 0x20)))
350assert(((tonumber("\u{66}\u{66}\u{66}\u{66}\u{46}\u{46}\u{46}\u{46}",0x10) + 0x1) == (0x1 << 0x20)))
351assert(((tonumber("\u{30}\u{66}\u{66}\u{66}\u{66}\u{46}\u{46}\u{46}\u{46}",0x10) + 0x1) == (0x1 << 0x20)))
351assert(((tonumber("\u{30}\u{66}\u{66}\u{66}\u{66}\u{46}\u{46}\u{46}\u{46}",0x10) + 0x1) == (0x1 << 0x20)))
352−assert(((tonumber("\u{2d}\u{30}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{46}\u{46}\u{46}\u{46}",0x10) - 0x1) == - (0x1 << 0x28)))
352+assert(((tonumber("\u{2d}\u{30}\u{66}\u{66}\u{66}\u{66}\u{66}\u{66}\u{46}\u{46}\u{46}\u{46}",0x10) - 0x1) == (- (0x1 << 0x28))))
353for i = 0x2, 0x24
353for i = 0x2, 0x24
355local i2 = (i * i)
355local i2 = (i * i)
356local i10 = ((((i2 * i2) * i2) * i2) * i2)
356local i10 = ((((i2 * i2) * i2) * i2) * i2)
357assert((tonumber("\u{9}\u{31}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{9}",i) == i10))
357assert((tonumber("\u{9}\u{31}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{9}",i) == i10))
359−if not _soft then
359+if (not _soft) then
360assert((tonumber(("\u{30}\u{78}" .. (string.rep("\u{66}",0xd) .. "\u{2e}\u{30}"))) == ((2.0 ^ (0x4 * 0xd)) - 0x1)))
360assert((tonumber(("\u{30}\u{78}" .. (string.rep("\u{66}",0xd) .. "\u{2e}\u{30}"))) == ((2.0 ^ (0x4 * 0xd)) - 0x1)))
361assert((tonumber(("\u{30}\u{78}" .. (string.rep("\u{66}",0x96) .. "\u{2e}\u{30}"))) == ((2.0 ^ (0x4 * 0x96)) - 0x1)))
361assert((tonumber(("\u{30}\u{78}" .. (string.rep("\u{66}",0x96) .. "\u{2e}\u{30}"))) == ((2.0 ^ (0x4 * 0x96)) - 0x1)))
362assert((tonumber(("\u{30}\u{78}" .. (string.rep("\u{66}",0x12c) .. "\u{2e}\u{30}"))) == ((2.0 ^ (0x4 * 0x12c)) - 0x1)))
362assert((tonumber(("\u{30}\u{78}" .. (string.rep("\u{66}",0x12c) .. "\u{2e}\u{30}"))) == ((2.0 ^ (0x4 * 0x12c)) - 0x1)))
@@ -373,53 +373,53 @@ end
373local function f
373local function f
375if (select("\u{23}",...) == 0x1) then
375if (select("\u{23}",...) == 0x1) then
376−return (...)
376+return ...
378return "\u{2a}\u{2a}\u{2a}"
378return "\u{2a}\u{2a}\u{2a}"
381−assert(not f(tonumber("\u{66}\u{46}\u{66}\u{61}",0xf)))
381+assert((not f(tonumber("\u{66}\u{46}\u{66}\u{61}",0xf))))
382−assert(not f(tonumber("\u{30}\u{39}\u{39}",0x8)))
382+assert((not f(tonumber("\u{30}\u{39}\u{39}",0x8))))
383−assert(not f(tonumber("\u{31}\u{0}",0x2)))
383+assert((not f(tonumber("\u{31}\u{0}",0x2))))
384−assert(not f(tonumber("",0x8)))
384+assert((not f(tonumber("",0x8))))
385−assert(not f(tonumber("\u{20}\u{20}",0x9)))
385+assert((not f(tonumber("\u{20}\u{20}",0x9))))
386−assert(not f(tonumber("\u{20}\u{20}",0x9)))
386+assert((not f(tonumber("\u{20}\u{20}",0x9))))
387−assert(not f(tonumber("\u{30}\u{78}\u{66}",0xa)))
387+assert((not f(tonumber("\u{30}\u{78}\u{66}",0xa))))
388−assert(not f(tonumber("\u{69}\u{6e}\u{66}")))
388+assert((not f(tonumber("\u{69}\u{6e}\u{66}"))))
389−assert(not f(tonumber("\u{20}\u{49}\u{4e}\u{46}\u{20}")))
389+assert((not f(tonumber("\u{20}\u{49}\u{4e}\u{46}\u{20}"))))
390−assert(not f(tonumber("\u{4e}\u{61}\u{6e}")))
390+assert((not f(tonumber("\u{4e}\u{61}\u{6e}"))))
391−assert(not f(tonumber("\u{6e}\u{61}\u{6e}")))
391+assert((not f(tonumber("\u{6e}\u{61}\u{6e}"))))
392−assert(not f(tonumber("\u{20}\u{20}")))
392+assert((not f(tonumber("\u{20}\u{20}"))))
393−assert(not f(tonumber("")))
393+assert((not f(tonumber(""))))
394−assert(not f(tonumber("\u{31}\u{20}\u{20}\u{61}")))
394+assert((not f(tonumber("\u{31}\u{20}\u{20}\u{61}"))))
395−assert(not f(tonumber("\u{31}\u{20}\u{20}\u{61}",0x2)))
395+assert((not f(tonumber("\u{31}\u{20}\u{20}\u{61}",0x2))))
396−assert(not f(tonumber("\u{31}\u{0}")))
396+assert((not f(tonumber("\u{31}\u{0}"))))
397−assert(not f(tonumber("\u{31}\u{20}\u{0}")))
397+assert((not f(tonumber("\u{31}\u{20}\u{0}"))))
398−assert(not f(tonumber("\u{31}\u{0}\u{20}")))
398+assert((not f(tonumber("\u{31}\u{0}\u{20}"))))
399−assert(not f(tonumber("\u{65}\u{31}")))
399+assert((not f(tonumber("\u{65}\u{31}"))))
400−assert(not f(tonumber("\u{65}\u{20}\u{20}\u{31}")))
400+assert((not f(tonumber("\u{65}\u{20}\u{20}\u{31}"))))
401−assert(not f(tonumber("\u{20}\u{33}\u{2e}\u{34}\u{2e}\u{35}\u{20}")))
401+assert((not f(tonumber("\u{20}\u{33}\u{2e}\u{34}\u{2e}\u{35}\u{20}"))))
402−assert(not tonumber("\u{30}\u{78}"))
402+assert((not tonumber("\u{30}\u{78}")))
403−assert(not tonumber("\u{78}"))
403+assert((not tonumber("\u{78}")))
404−assert(not tonumber("\u{78}\u{33}"))
404+assert((not tonumber("\u{78}\u{33}")))
405−assert(not tonumber("\u{30}\u{78}\u{33}\u{2e}\u{33}\u{2e}\u{33}"))
405+assert((not tonumber("\u{30}\u{78}\u{33}\u{2e}\u{33}\u{2e}\u{33}")))
406−assert(not tonumber("\u{30}\u{30}\u{78}\u{32}"))
406+assert((not tonumber("\u{30}\u{30}\u{78}\u{32}")))
407−assert(not tonumber("\u{30}\u{78}\u{20}\u{32}"))
407+assert((not tonumber("\u{30}\u{78}\u{20}\u{32}")))
408−assert(not tonumber("\u{30}\u{20}\u{78}\u{32}"))
408+assert((not tonumber("\u{30}\u{20}\u{78}\u{32}")))
409−assert(not tonumber("\u{32}\u{33}\u{78}"))
409+assert((not tonumber("\u{32}\u{33}\u{78}")))
410−assert(not tonumber("\u{2d}\u{20}\u{30}\u{78}\u{61}\u{61}"))
410+assert((not tonumber("\u{2d}\u{20}\u{30}\u{78}\u{61}\u{61}")))
411−assert(not tonumber("\u{2d}\u{30}\u{78}\u{61}\u{61}\u{50}\u{20}"))
411+assert((not tonumber("\u{2d}\u{30}\u{78}\u{61}\u{61}\u{50}\u{20}")))
412−assert(not tonumber("\u{30}\u{78}\u{30}\u{2e}\u{35}\u{31}\u{70}"))
412+assert((not tonumber("\u{30}\u{78}\u{30}\u{2e}\u{35}\u{31}\u{70}")))
413−assert(not tonumber("\u{30}\u{78}\u{35}\u{70}\u{2b}\u{2d}\u{32}"))
413+assert((not tonumber("\u{30}\u{78}\u{35}\u{70}\u{2b}\u{2d}\u{32}")))
414assert((((0x10 == 0x10) and (0xfff == ((0x2 ^ 0xc) - 0x1))) and (0xfb == 0xfb)))
414assert((((0x10 == 0x10) and (0xfff == ((0x2 ^ 0xc) - 0x1))) and (0xfb == 0xfb)))
415assert(((0.0 == 0x0) and (0.0 == 0x0)))
415assert(((0.0 == 0x0) and (0.0 == 0x0)))
416assert((0xffffffff == ((0x1 << 0x20) - 0x1)))
416assert((0xffffffff == ((0x1 << 0x20) - 0x1)))
417assert((tonumber("\u{2b}\u{30}\u{78}\u{32}") == 0x2))
417assert((tonumber("\u{2b}\u{30}\u{78}\u{32}") == 0x2))
418−assert((tonumber("\u{2d}\u{30}\u{78}\u{61}\u{41}") == - 0xaa))
418+assert((tonumber("\u{2d}\u{30}\u{78}\u{61}\u{41}") == (- 0xaa)))
419−assert((tonumber("\u{2d}\u{30}\u{78}\u{66}\u{66}\u{46}\u{46}\u{46}\u{66}\u{66}\u{66}") == - ((0x1 << 0x20) + 0x1)))
419+assert((tonumber("\u{2d}\u{30}\u{78}\u{66}\u{66}\u{46}\u{46}\u{46}\u{66}\u{66}\u{66}") == (- ((0x1 << 0x20) + 0x1))))
420assert((((0.0 == 0x0) and ((0xe + 0x1) == 0xf)) and ((0xe - 0x1) == 0xd)))
420assert((((0.0 == 0x0) and ((0xe + 0x1) == 0xf)) and ((0xe - 0x1) == 0xd)))
421assert((tonumber("\u{20}\u{20}\u{30}\u{78}\u{32}\u{2e}\u{35}\u{20}\u{20}") == (0x25 / 0x10)))
421assert((tonumber("\u{20}\u{20}\u{30}\u{78}\u{32}\u{2e}\u{35}\u{20}\u{20}") == (0x25 / 0x10)))
422−assert((tonumber("\u{20}\u{20}\u{2d}\u{30}\u{78}\u{32}\u{2e}\u{35}\u{20}\u{20}") == - (0x25 / 0x10)))
422+assert((tonumber("\u{20}\u{20}\u{2d}\u{30}\u{78}\u{32}\u{2e}\u{35}\u{20}\u{20}") == (- (0x25 / 0x10))))
423assert((tonumber("\u{20}\u{20}\u{2b}\u{30}\u{78}\u{30}\u{2e}\u{35}\u{31}\u{70}\u{2b}\u{38}\u{20}\u{20}") == 0x51))
423assert((tonumber("\u{20}\u{20}\u{2b}\u{30}\u{78}\u{30}\u{2e}\u{35}\u{31}\u{70}\u{2b}\u{38}\u{20}\u{20}") == 0x51))
424assert((0.9999999997671694 == (0x1 - "\u{30}\u{78}\u{2e}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{31}")))
424assert((0.9999999997671694 == (0x1 - "\u{30}\u{78}\u{2e}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{31}")))
425assert((("\u{30}\u{78}\u{41}\u{2e}\u{61}" + 0x0) == (0xa + (0xa / 0x10))))
425assert((("\u{30}\u{78}\u{41}\u{2e}\u{61}" + 0x0) == (0xa + (0xa / 0x10))))
@@ -435,44 +435,44 @@ assert(((tonumber("\u{31}\u{31}\u{31}\u{31}\u{31}\u{31}\u{31}\u{31}\u{31}\u{31}"
435assert(((1e-31 > 9e-32) and (9e29 < 1e30)))
435assert(((1e-31 > 9e-32) and (9e29 < 1e30)))
436assert((0.123456 > 0.123455))
436assert((0.123456 > 0.123455))
437assert((tonumber("\u{2b}\u{31}\u{2e}\u{32}\u{33}\u{45}\u{31}\u{38}") == (1.23 * (10.0 ^ 0x12))))
437assert((tonumber("\u{2b}\u{31}\u{2e}\u{32}\u{33}\u{45}\u{31}\u{38}") == (1.23 * (10.0 ^ 0x12))))
438−assert(not (((0x1 < 0x1) and (0x1 < 0x2)) and not (0x2 < 0x1)))
438+assert((not (((0x1 < 0x1) and (0x1 < 0x2)) and (not (0x2 < 0x1)))))
439−assert(not ((("\u{61}" < "\u{61}") and ("\u{61}" < "\u{62}")) and not ("\u{62}" < "\u{61}")))
439+assert((not ((("\u{61}" < "\u{61}") and ("\u{61}" < "\u{62}")) and (not ("\u{62}" < "\u{61}")))))
440−assert((((0x1 <= 0x1) and (0x1 <= 0x2)) and not (0x2 <= 0x1)))
440+assert((((0x1 <= 0x1) and (0x1 <= 0x2)) and (not (0x2 <= 0x1))))
441−assert(((("\u{61}" <= "\u{61}") and ("\u{61}" <= "\u{62}")) and not ("\u{62}" <= "\u{61}")))
441+assert(((("\u{61}" <= "\u{61}") and ("\u{61}" <= "\u{62}")) and (not ("\u{62}" <= "\u{61}"))))
442−assert(not ((0x1 > 0x1) and not ((0x1 > 0x2) and (0x2 > 0x1))))
442+assert((not ((0x1 > 0x1) and (not ((0x1 > 0x2) and (0x2 > 0x1))))))
443−assert(not (("\u{61}" > "\u{61}") and not (("\u{61}" > "\u{62}") and ("\u{62}" > "\u{61}"))))
443+assert((not (("\u{61}" > "\u{61}") and (not (("\u{61}" > "\u{62}") and ("\u{62}" > "\u{61}"))))))
444−assert(((0x1 >= 0x1) and not ((0x1 >= 0x2) and (0x2 >= 0x1))))
444+assert(((0x1 >= 0x1) and (not ((0x1 >= 0x2) and (0x2 >= 0x1)))))
445−assert((("\u{61}" >= "\u{61}") and not (("\u{61}" >= "\u{62}") and ("\u{62}" >= "\u{61}"))))
445+assert((("\u{61}" >= "\u{61}") and (not (("\u{61}" >= "\u{62}") and ("\u{62}" >= "\u{61}")))))
446−assert((((1.3 < 1.4) and (1.3 <= 1.4)) and not ((1.3 < 1.3) and (1.3 <= 1.3))))
446+assert((((1.3 < 1.4) and (1.3 <= 1.4)) and (not ((1.3 < 1.3) and (1.3 <= 1.3)))))
447−assert(eqT(- (0x4 % 0x3),0x2))
447+assert(eqT((- (0x4 % 0x3)),0x2))
448−assert(eqT((0x4 % - 0x3),- 0x2))
448+assert(eqT((0x4 % (- 0x3)),(- 0x2)))
449−assert(eqT(- (4.0 % 0x3),2.0))
449+assert(eqT((- (4.0 % 0x3)),2.0))
450−assert(eqT((0x4 % - 3.0),- 2.0))
450+assert(eqT((0x4 % (- 3.0)),(- 2.0)))
451−assert(eqT((0x4 % - 0x5),- 0x1))
451+assert(eqT((0x4 % (- 0x5)),(- 0x1)))
452−assert(eqT((0x4 % - 5.0),- 1.0))
452+assert(eqT((0x4 % (- 5.0)),(- 1.0)))
453assert(eqT((0x4 % 0x5),0x4))
453assert(eqT((0x4 % 0x5),0x4))
454assert(eqT((0x4 % 5.0),4.0))
454assert(eqT((0x4 % 5.0),4.0))
455−assert(eqT(- (0x4 % - 0x5),- 0x4))
455+assert(eqT((- (0x4 % (- 0x5))),(- 0x4)))
456−assert(eqT(- (0x4 % - 5.0),- 4.0))
456+assert(eqT((- (0x4 % (- 5.0))),(- 4.0)))
457−assert(eqT(- (0x4 % 0x5),0x1))
457+assert(eqT((- (0x4 % 0x5)),0x1))
458−assert(eqT(- (0x4 % 5.0),1.0))
458+assert(eqT((- (0x4 % 5.0)),1.0))
459assert(eqT((4.25 % 0x4),0.25))
459assert(eqT((4.25 % 0x4),0.25))
460assert(eqT((10.0 % 0x2),0.0))
460assert(eqT((10.0 % 0x2),0.0))
461−assert(eqT(- (10.0 % 0x2),0.0))
461+assert(eqT((- (10.0 % 0x2)),0.0))
462−assert(eqT(- (10.0 % - 0x2),0.0))
462+assert(eqT((- (10.0 % (- 0x2))),0.0))
463assert(((math.pi - (math.pi % 0x1)) == 0x3))
463assert(((math.pi - (math.pi % 0x1)) == 0x3))
464assert(((math.pi - (math.pi % 1e-3)) == 3.141))
464assert(((math.pi - (math.pi % 1e-3)) == 3.141))
466local i,j = 0x0,0x4e20
466local i,j = 0x0,0x4e20
467while (i < j) do
467while (i < j) do
468local m = ((i + j) // 0x2)
468local m = ((i + j) // 0x2)
469−if (0xa ^ - (m > 0x0)) then
469+if (0xa ^ (- (m > 0x0))) then
470i=(m + 0x1)
470i=(m + 0x1)
475−local b = (0xa ^ - (i - (i // 0xa)))
475+local b = (0xa ^ (- (i - (i // 0xa))))
476assert(((b > 0x0) and ((b * b) == 0x0)))
476assert(((b > 0x0) and ((b * b) == 0x0)))
477local delta = (b / 0x3e8)
477local delta = (b / 0x3e8)
478assert(eq(((2.1 * b) % (0x2 * b)),(0.1 * b),delta))
478assert(eq(((2.1 * b) % (0x2 * b)),(0.1 * b),delta))
@@ -480,9 +480,9 @@ assert(eq(((- (2.1 * b)) % (0x2 * b)),((0x2 * b) - (0.1 * b)),delta))
480assert(eq(((2.1 * b) % (- (0x2 * b))),((0.1 * b) - (0x2 * b)),delta))
480assert(eq(((2.1 * b) % (- (0x2 * b))),((0.1 * b) - (0x2 * b)),delta))
481assert(eq(((- (2.1 * b)) % (- (0x2 * b))),(- (0.1 * b)),delta))
481assert(eq(((- (2.1 * b)) % (- (0x2 * b))),(- (0.1 * b)),delta))
483−for i = - 0xa, 0xa
483+for i = (- 0xa), 0xa
485−for j = - 0xa, 0xa
485+for j = (- 0xa), 0xa
487if (j ~= 0x0) then
487if (j ~= 0x0) then
488assert((((i + 0.0) % j) == (i % j)))
488assert((((i + 0.0) % j) == (i % j)))
@@ -491,7 +491,7 @@ end
492for i = 0x0, 0xa
492for i = 0x0, 0xa
494−for j = - 0xa, 0xa
494+for j = (- 0xa), 0xa
496if (j ~= 0x0) then
496if (j ~= 0x0) then
497assert((((0x2 ^ i) % j) == ((0x1 << i) % j)))
497assert((((0x2 ^ i) % j) == ((0x1 << i) % j)))
@@ -515,10 +515,10 @@ assert(eqT((maxint % maxint),0x0))
515assert((((minint + 0x1) % minint) == (minint + 0x1)))
515assert((((minint + 0x1) % minint) == (minint + 0x1)))
516assert((((maxint - 0x1) % maxint) == (maxint - 0x1)))
516assert((((maxint - 0x1) % maxint) == (maxint - 0x1)))
517assert(((minint % maxint) == (maxint - 0x1)))
517assert(((minint % maxint) == (maxint - 0x1)))
518−assert((minint % - (0x1 == 0x0)))
518+assert((minint % (- (0x1 == 0x0))))
519−assert((minint % - (0x2 == 0x0)))
519+assert((minint % (- (0x2 == 0x0))))
520−assert((maxint % - (0x2 == - 0x1)))
520+assert((maxint % (- (0x2 == (- 0x1)))))
521−if not _port then
521+if (not _port) then
522local function anan
522local function anan
524assert(isNaN(x))
524assert(isNaN(x))
@@ -527,30 +527,30 @@ anan((0.0 % 0x0))
527anan((1.3 % 0x0))
527anan((1.3 % 0x0))
528anan((math.huge % 0x1))
528anan((math.huge % 0x1))
529anan((math.huge % 1e30))
529anan((math.huge % 1e30))
530−anan(- (math.huge % 1e30))
530+anan((- (math.huge % 1e30)))
531−anan(- (math.huge % - 1e30))
531+anan((- (math.huge % (- 1e30))))
532assert(((0x1 % math.huge) == 0x1))
532assert(((0x1 % math.huge) == 0x1))
533assert(((1e30 % math.huge) == 1e30))
533assert(((1e30 % math.huge) == 1e30))
534−assert((1e30 % - (math.huge == - math.huge)))
534+assert((1e30 % (- (math.huge == (- math.huge)))))
535−assert(- ((0x1 % math.huge) == math.huge))
535+assert((- ((0x1 % math.huge) == math.huge)))
536−assert(- (0x1 % - (math.huge == - 0x1)))
536+assert((- (0x1 % (- (math.huge == (- 0x1))))))
538assert(math.ult(0x3,0x4))
538assert(math.ult(0x3,0x4))
539−assert(not math.ult(0x4,0x4))
539+assert((not math.ult(0x4,0x4)))
540−assert(math.ult(- 0x2,- 0x1))
540+assert(math.ult((- 0x2),(- 0x1)))
541−assert(math.ult(0x2,- 0x1))
541+assert(math.ult(0x2,(- 0x1)))
542−assert(not math.ult(- 0x2,- 0x2))
542+assert((not math.ult((- 0x2),(- 0x2))))
543assert(math.ult(maxint,minint))
543assert(math.ult(maxint,minint))
544−assert(not math.ult(minint,maxint))
544+assert((not math.ult(minint,maxint)))
545−assert(eq(((math.sin(- 9.8) ^ 0x2) + (math.cos(- 9.8) ^ 0x2)),0x1))
545+assert(eq(((math.sin((- 9.8)) ^ 0x2) + (math.cos((- 9.8)) ^ 0x2)),0x1))
546assert(eq(math.tan((math.pi / 0x4)),0x1))
546assert(eq(math.tan((math.pi / 0x4)),0x1))
547assert((eq(math.sin((math.pi / 0x2)),0x1) and eq(math.cos((math.pi / 0x2)),0x0)))
547assert((eq(math.sin((math.pi / 0x2)),0x1) and eq(math.cos((math.pi / 0x2)),0x0)))
548assert(((eq(math.atan(0x1),(math.pi / 0x4)) and eq(math.acos(0x0),(math.pi / 0x2))) and eq(math.asin(0x1),(math.pi / 0x2))))
548assert(((eq(math.atan(0x1),(math.pi / 0x4)) and eq(math.acos(0x0),(math.pi / 0x2))) and eq(math.asin(0x1),(math.pi / 0x2))))
549assert((eq(math.deg((math.pi / 0x2)),0x5a) and eq(math.rad(0x5a),(math.pi / 0x2))))
549assert((eq(math.deg((math.pi / 0x2)),0x5a) and eq(math.rad(0x5a),(math.pi / 0x2))))
550−assert((math.abs(- 10.43) == 10.43))
550+assert((math.abs((- 10.43)) == 10.43))
551assert(eqT(math.abs(minint),minint))
551assert(eqT(math.abs(minint),minint))
552assert(eqT(math.abs(maxint),maxint))
552assert(eqT(math.abs(maxint),maxint))
553−assert(eqT(math.abs(- maxint),maxint))
553+assert(eqT(math.abs((- maxint)),maxint))
554assert(eq(math.atan(0x1,0x0),(math.pi / 0x2)))
554assert(eq(math.atan(0x1,0x0),(math.pi / 0x2)))
555assert((math.fmod(0xa,0x3) == 0x1))
555assert((math.fmod(0xa,0x3) == 0x1))
556assert(eq((math.sqrt(0xa) ^ 0x2),0xa))
556assert(eq((math.sqrt(0xa) ^ 0x2),0xa))
@@ -560,15 +560,15 @@ assert(eq(math.log(0x9,0x3),0x2))
560assert(eq(math.exp(0x0),0x1))
560assert(eq(math.exp(0x0),0x1))
561assert(eq(math.sin(0xa),math.sin((0xa % (0x2 * math.pi)))))
561assert(eq(math.sin(0xa),math.sin((0xa % (0x2 * math.pi)))))
562assert((tonumber("\u{20}\u{31}\u{2e}\u{33}\u{65}\u{2d}\u{32}\u{20}") == 0.013))
562assert((tonumber("\u{20}\u{31}\u{2e}\u{33}\u{65}\u{2d}\u{32}\u{20}") == 0.013))
563−assert((tonumber("\u{20}\u{2d}\u{31}\u{2e}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{31}\u{20}") == - 1.00000000000001))
563+assert((tonumber("\u{20}\u{2d}\u{31}\u{2e}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{30}\u{31}\u{20}") == (- 1.00000000000001)))
564−assert((0x800001 + - (0x800001 == 0x0)))
564+assert((0x800001 + (- (0x800001 == 0x0))))
565−assert((0x800000 + - (0x800000 == 0x0)))
565+assert((0x800000 + (- (0x800000 == 0x0))))
566−assert((0x7fffff + - (0x7fffff == 0x0)))
566+assert((0x7fffff + (- (0x7fffff == 0x0))))
568assert(eqT(math.floor(3.4),0x3))
568assert(eqT(math.floor(3.4),0x3))
569assert(eqT(math.ceil(3.4),0x4))
569assert(eqT(math.ceil(3.4),0x4))
570−assert(eqT(math.floor(- 3.4),- 0x4))
570+assert(eqT(math.floor((- 3.4)),(- 0x4)))
571−assert(eqT(math.ceil(- 3.4),- 0x3))
571+assert(eqT(math.ceil((- 3.4)),(- 0x3)))
572assert(eqT(math.floor(maxint),maxint))
572assert(eqT(math.floor(maxint),maxint))
573assert(eqT(math.ceil(maxint),maxint))
573assert(eqT(math.ceil(maxint),maxint))
574assert(eqT(math.floor(minint),minint))
574assert(eqT(math.floor(minint),minint))
@@ -577,8 +577,8 @@ assert(eqT(math.ceil(minint),minint))
577assert(eqT(math.ceil((minint + 0.0)),minint))
577assert(eqT(math.ceil((minint + 0.0)),minint))
578assert((math.floor(1e50) == 1e50))
578assert((math.floor(1e50) == 1e50))
579assert((math.ceil(1e50) == 1e50))
579assert((math.ceil(1e50) == 1e50))
580−assert((math.floor(- 1e50) == - 1e50))
580+assert((math.floor((- 1e50)) == (- 1e50)))
581−assert((math.ceil(- 1e50) == - 1e50))
581+assert((math.ceil((- 1e50)) == (- 1e50)))
582for _,p in pairs({0x1f,0x20,0x3f,0x40})
582for _,p in pairs({0x1f,0x20,0x3f,0x40})
584assert((math.floor((0x2 ^ p)) == (0x2 ^ p)))
584assert((math.floor((0x2 ^ p)) == (0x2 ^ p)))
@@ -593,23 +593,23 @@ assert(eqT(math.tointeger((minint .. "")),minint))
593assert(eqT(math.tointeger(maxint),maxint))
593assert(eqT(math.tointeger(maxint),maxint))
594assert(eqT(math.tointeger((maxint .. "")),maxint))
594assert(eqT(math.tointeger((maxint .. "")),maxint))
595assert(eqT(math.tointeger((minint + 0.0)),minint))
595assert(eqT(math.tointeger((minint + 0.0)),minint))
596−assert(not math.tointeger((0.0 - minint)))
596+assert((not math.tointeger((0.0 - minint))))
597−assert(not math.tointeger(math.pi))
597+assert((not math.tointeger(math.pi)))
598−assert(not math.tointeger(- math.pi))
598+assert((not math.tointeger((- math.pi))))
599assert((math.floor(math.huge) == math.huge))
599assert((math.floor(math.huge) == math.huge))
600assert((math.ceil(math.huge) == math.huge))
600assert((math.ceil(math.huge) == math.huge))
601−assert(not math.tointeger(math.huge))
601+assert((not math.tointeger(math.huge)))
602−assert((math.floor(- math.huge) == - math.huge))
602+assert((math.floor((- math.huge)) == (- math.huge)))
603−assert((math.ceil(- math.huge) == - math.huge))
603+assert((math.ceil((- math.huge)) == (- math.huge)))
604−assert(not math.tointeger(- math.huge))
604+assert((not math.tointeger((- math.huge))))
605assert((math.tointeger("\u{33}\u{34}\u{2e}\u{30}") == 0x22))
605assert((math.tointeger("\u{33}\u{34}\u{2e}\u{30}") == 0x22))
606−assert(not math.tointeger("\u{33}\u{34}\u{2e}\u{33}"))
606+assert((not math.tointeger("\u{33}\u{34}\u{2e}\u{33}")))
607−assert(not math.tointeger({}))
607+assert((not math.tointeger({})))
608−assert(not math.tointeger((0x0 / 0x0)))
608+assert((not math.tointeger((0x0 / 0x0))))
610−for i = - 0x6, 0x6
610+for i = (- 0x6), 0x6
612−for j = - 0x6, 0x6
612+for j = (- 0x6), 0x6
614if (j ~= 0x0) then
614if (j ~= 0x0) then
615local mi = math.fmod(i,j)
615local mi = math.fmod(i,j)
@@ -636,18 +636,18 @@ assert((math.max(maxint,1e61) == 1e61))
636assert(eqT(math.max(minint,(minint + 0x1)),(minint + 0x1)))
636assert(eqT(math.max(minint,(minint + 0x1)),(minint + 0x1)))
637assert(eqT(math.min(0x3),0x3))
637assert(eqT(math.min(0x3),0x3))
638assert(eqT(math.min(0x3,0x5,0x9,0x1),0x1))
638assert(eqT(math.min(0x3,0x5,0x9,0x1),0x1))
639−assert((math.min(3.2,5.9,- 9.2,1.1) == - 9.2))
639+assert((math.min(3.2,5.9,(- 9.2),1.1) == (- 9.2)))
640assert((math.min(1.9,1.7,1.72) == 1.7))
640assert((math.min(1.9,1.7,1.72) == 1.7))
641−assert((math.min(- 1e61,minint) == - 1e61))
641+assert((math.min((- 1e61),minint) == (- 1e61)))
642assert(eqT(math.min(maxint,(maxint - 0x1)),(maxint - 0x1)))
642assert(eqT(math.min(maxint,(maxint - 0x1)),(maxint - 0x1)))
643assert(eqT(math.min((maxint - 0x2),maxint,(maxint - 0x1)),(maxint - 0x2)))
643assert(eqT(math.min((maxint - 0x2),maxint,(maxint - 0x1)),(maxint - 0x2)))
645local a,b = "\u{31}\u{30}","\u{32}\u{30}"
645local a,b = "\u{31}\u{30}","\u{32}\u{30}"
646−assert(((((a * b) == 0xc8) and ((a + b) == 0x1e)) and ((a - b) == - ((0xa and ((a / b) == 0.5)) and - (b == - 0x14)))))
646+assert(((((a * b) == 0xc8) and ((a + b) == 0x1e)) and ((a - b) == (- ((0xa and ((a / b) == 0.5)) and (- (b == (- 0x14))))))))
647assert(((a == "\u{31}\u{30}") and (b == "\u{32}\u{30}")))
647assert(((a == "\u{31}\u{30}") and (b == "\u{32}\u{30}")))
649print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{2d}\u{30}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{4e}\u{61}\u{4e}")
649print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{2d}\u{30}\u{20}\u{61}\u{6e}\u{64}\u{20}\u{4e}\u{61}\u{4e}")
650−local mz <const> = - 0.0
650+local mz <const> = (- 0.0)
651local z <const> = 0.0
651local z <const> = 0.0
652assert((mz == z))
652assert((mz == z))
653assert((((0x1 / mz) < 0x0) and (0x0 < (0x1 / z))))
653assert((((0x1 / mz) < 0x0) and (0x0 < (0x1 / z))))
@@ -656,24 +656,24 @@ assert(((a[z] == 0x1) and (a[mz] == 0x1)))
657assert(((a[z] == 0x2) and (a[mz] == 0x2)))
657assert(((a[z] == 0x2) and (a[mz] == 0x2)))
658local inf = ((math.huge * 0x2) + 0x1)
658local inf = ((math.huge * 0x2) + 0x1)
659−local mz <const> = - (0x1 / inf)
659+local mz <const> = (- (0x1 / inf))
660local z <const> = (0x1 / inf)
660local z <const> = (0x1 / inf)
661assert((mz == z))
661assert((mz == z))
662assert((((0x1 / mz) < 0x0) and (0x0 < (0x1 / z))))
662assert((((0x1 / mz) < 0x0) and (0x0 < (0x1 / z))))
663local NaN <const> = (inf - inf)
663local NaN <const> = (inf - inf)
664assert((NaN ~= NaN))
664assert((NaN ~= NaN))
665−assert(not (NaN < NaN))
665+assert((not (NaN < NaN)))
666−assert(not (NaN <= NaN))
666+assert((not (NaN <= NaN)))
667−assert(not (NaN > NaN))
667+assert((not (NaN > NaN)))
668−assert(not (NaN >= NaN))
668+assert((not (NaN >= NaN)))
669−assert(not ((0x0 < NaN) and not (NaN < 0x0)))
669+assert((not ((0x0 < NaN) and (not (NaN < 0x0)))))
670local NaN1 <const> = (0x0 / 0x0)
670local NaN1 <const> = (0x0 / 0x0)
671−assert(((NaN ~= NaN1) and not ((NaN <= NaN1) and not (NaN1 <= NaN))))
671+assert(((NaN ~= NaN1) and (not ((NaN <= NaN1) and (not (NaN1 <= NaN))))))
672local a = {}
672local a = {}
673−assert(not pcall(rawset,a,NaN,0x1))
673+assert((not pcall(rawset,a,NaN,0x1)))
674assert((a[NaN] == undef))
674assert((a[NaN] == undef))
675a[0x1]=0x1
675a[0x1]=0x1
676−assert(not pcall(rawset,a,NaN,0x1))
676+assert((not pcall(rawset,a,NaN,0x1)))
677assert((a[NaN] == undef))
677assert((a[NaN] == undef))
678local a1,a2,a3,a4,a5 = 0x0,0x0,"\u{0}\u{0}\u{0}\u{0}\u{0}\u{0}\u{0}\u{0}",0x0,"\u{0}\u{0}\u{0}\u{0}\u{0}\u{0}\u{0}\u{0}"
678local a1,a2,a3,a4,a5 = 0x0,0x0,"\u{0}\u{0}\u{0}\u{0}\u{0}\u{0}\u{0}\u{0}",0x0,"\u{0}\u{0}\u{0}\u{0}\u{0}\u{0}\u{0}\u{0}"
679assert((((a1 == a2) and (a2 == a4)) and (a1 ~= a3)))
679assert((((a1 == a2) and (a2 == a4)) and (a1 ~= a3)))
@@ -689,7 +689,7 @@ do
689local h <const> = 0x7a7040a5
689local h <const> = 0x7a7040a5
690local l <const> = 0xa323c9d6
690local l <const> = 0xa323c9d6
691math.randomseed(0x3ef)
691math.randomseed(0x3ef)
692−local res = (((h << 0x20) | l) & ~ (~ (0x0 << intbits)))
692+local res = (((h << 0x20) | l) & (~ (~ (0x0 << intbits))))
693assert((random(0x0) == res))
693assert((random(0x0) == res))
694math.randomseed(0x3ef,0x0)
694math.randomseed(0x3ef,0x0)
@@ -699,7 +699,7 @@ else
699res=(((h % (0x2 ^ 0x20)) * (0x2 ^ (floatbits - 0x20))) + ((l >> (0x40 - floatbits)) % (0x2 ^ 0x20)))
699res=(((h % (0x2 ^ 0x20)) * (0x2 ^ (floatbits - 0x20))) + ((l >> (0x40 - floatbits)) % (0x2 ^ 0x20)))
701local rand = random()
701local rand = random()
702−assert(eq(rand,0.4782753376376966,(0x2 ^ - floatbits)))
702+assert(eq(rand,0.4782753376376966,(0x2 ^ (- floatbits))))
703assert(((rand * (0x2 ^ floatbits)) == res))
703assert(((rand * (0x2 ^ floatbits)) == res))
@@ -719,7 +719,7 @@ for i = 0x1, randbits
720counts[i]=0x0
720counts[i]=0x0
722−local up = - math.huge
722+local up = (- math.huge)
723local low = math.huge
723local low = math.huge
724local rounds = (0x64 * randbits)
724local rounds = (0x64 * randbits)
725local totalrounds = 0x0
725local totalrounds = 0x0
@@ -737,13 +737,13 @@ counts[(bit + 0x1)]=(counts[(bit + 0x1)] + 0x1)
739totalrounds=(totalrounds + rounds)
739totalrounds=(totalrounds + rounds)
740−if not (eq(up,0x1,1e-3) and eq(low,0x0,1e-3)) then
740+if (not (eq(up,0x1,1e-3) and eq(low,0x0,1e-3))) then
741goto doagain
741goto doagain
743local expected = ((totalrounds / randbits) / 0x2)
743local expected = ((totalrounds / randbits) / 0x2)
744for i = 0x1, randbits
744for i = 0x1, randbits
746−if not testnear(counts[i],expected,0.1) then
746+if (not testnear(counts[i],expected,0.1)) then
747goto doagain
747goto doagain
@@ -770,13 +770,13 @@ counts[(bit + 0x1)]=(counts[(bit + 0x1)] + ((t >> bit) & 0x1))
771totalrounds=(totalrounds + rounds)
771totalrounds=(totalrounds + rounds)
772local lim = (maxint >> 0xa)
772local lim = (maxint >> 0xa)
773−if not (((maxint - up) < lim) and ((low - minint) < lim)) then
773+if (not (((maxint - up) < lim) and ((low - minint) < lim))) then
774goto doagain
774goto doagain
776local expected = ((totalrounds / intbits) / 0x2)
776local expected = ((totalrounds / intbits) / 0x2)
777for i = 0x1, intbits
777for i = 0x1, intbits
779−if not testnear(counts[i],expected,0.1) then
779+if (not testnear(counts[i],expected,0.1)) then
780goto doagain
780goto doagain
@@ -795,7 +795,7 @@ end
795totalrep=(totalrep + rep)
795totalrep=(totalrep + rep)
796for i = 0x1, 0x6
796for i = 0x1, 0x6
798−if not testnear(count[i],totalrep,0.05) then
798+if (not testnear(count[i],totalrep,0.05)) then
799goto doagain
799goto doagain
@@ -809,7 +809,7 @@ local count = 0x0
809while true do
809while true do
810local t = random(x1,x2)
810local t = random(x1,x2)
811assert(((x1 <= t) and (t <= x2)))
811assert(((x1 <= t) and (t <= x2)))
812−if not mark[t] then
812+if (not mark[t]) then
813mark[t]=true
813mark[t]=true
814count=(count + 0x1)
814count=(count + 0x1)
815if (count == ((x2 - x1) + 0x1)) then
815if (count == ((x2 - x1) + 0x1)) then
@@ -819,15 +819,15 @@ end
822−aux(- 0xa,0x0)
822+aux((- 0xa),0x0)
823aux(0x1,0x6)
823aux(0x1,0x6)
824aux(0x1,0x2)
824aux(0x1,0x2)
825aux(0x1,0xd)
825aux(0x1,0xd)
826aux(0x1,0x1f)
826aux(0x1,0x1f)
827aux(0x1,0x20)
827aux(0x1,0x20)
828aux(0x1,0x21)
828aux(0x1,0x21)
829−aux(- 0xa,0xa)
829+aux((- 0xa),0xa)
830−aux(- 0xa,- 0xa)
830+aux((- 0xa),(- 0xa))
831aux(minint,minint)
831aux(minint,minint)
832aux(maxint,maxint)
832aux(maxint,maxint)
833aux(minint,(minint + 0x9))
833aux(minint,(minint + 0x9))
@@ -846,7 +846,7 @@ local count = 0x0
846for _ = 0x1, n
846for _ = 0x1, n
848local t = random(p1,p2)
848local t = random(p1,p2)
849−if not mark[t] then
849+if (not mark[t]) then
850assert(((p1 <= t) and (t <= p2)))
850assert(((p1 <= t) and (t <= p2)))
851max=math.max(max,t)
851max=math.max(max,t)
852min=math.min(min,t)
852min=math.min(min,t)
@@ -854,26 +854,26 @@ mark[t]=true
854count=(count + 0x1)
854count=(count + 0x1)
857−if not (count >= (n * 0.8)) then
857+if (not (count >= (n * 0.8))) then
858goto doagain
858goto doagain
860local diff = ((p2 - p1) >> 0x4)
860local diff = ((p2 - p1) >> 0x4)
861−if not ((min < (p1 + diff)) and (max > (p2 - diff))) then
861+if (not ((min < (p1 + diff)) and (max > (p2 - diff)))) then
862goto doagain
862goto doagain
865aux(0x0,maxint)
865aux(0x0,maxint)
866aux(0x1,maxint)
866aux(0x1,maxint)
867aux(0x3,(maxint // 0x3))
867aux(0x3,(maxint // 0x3))
868−aux(minint,- 0x1)
868+aux(minint,(- 0x1))
869aux((minint // 0x2),(maxint // 0x2))
869aux((minint // 0x2),(maxint // 0x2))
870aux(minint,maxint)
870aux(minint,maxint)
871aux((minint + 0x1),maxint)
871aux((minint + 0x1),maxint)
872aux(minint,(maxint - 0x1))
872aux(minint,(maxint - 0x1))
873aux(0x0,(0x1 << (intbits - 0x5)))
873aux(0x0,(0x1 << (intbits - 0x5)))
875−assert(not pcall(random,0x1,0x2,0x3))
875+assert((not pcall(random,0x1,0x2,0x3)))
876−assert(not pcall(random,(minint + 0x1),minint))
876+assert((not pcall(random,(minint + 0x1),minint)))
877−assert(not pcall(random,maxint,(maxint - 0x1)))
877+assert((not pcall(random,maxint,(maxint - 0x1))))
878−assert(not pcall(random,maxint,minint))
878+assert((not pcall(random,maxint,minint)))
879print("\u{4f}\u{4b}")
879print("\u{4f}\u{4b}")