@@ -2,8 +2,8 @@ print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{6e}\u{75}\u{6d}\u{62}\
22local minint <const> = math.mininteger
33local maxint <const> = math.maxinteger
44local intbits <const> = (math.floor((math.log(maxint,0x2) + 0.5)) + 0x1)
5−assert((((0x1 << intbits)) == 0x0))
6−assert((minint == (0x1 << ((intbits - 0x1)))))
5+assert(((0x1 << intbits) == 0x0))
6+assert((minint == (0x1 << (intbits - 0x1))))
77assert((maxint == (minint - 0x1)))
88local floatbits = 0x18
99do
@@ -15,7 +15,7 @@ end
1515end
1616local function isNaN
1717(x)
18−return ((x ~= x))
18+return (x ~= x)
1919end
2020assert(isNaN((0x0 / 0x0)))
2121assert(not isNaN((0x1 / 0x0)))
@@ -133,15 +133,15 @@ assert(eqT((x // y),- 3.0))
133133end
134134assert(((maxint // maxint) == 0x1))
135135assert(((maxint // 0x1) == maxint))
136−assert(((((maxint - 0x1)) // maxint) == 0x0))
137−assert(((maxint // ((maxint - 0x1))) == 0x1))
136+assert((((maxint - 0x1) // maxint) == 0x0))
137+assert(((maxint // (maxint - 0x1)) == 0x1))
138138assert(((minint // minint) == 0x1))
139139assert(((minint // minint) == 0x1))
140−assert(((((minint + 0x1)) // minint) == 0x0))
141−assert(((minint // ((minint + 0x1))) == 0x1))
140+assert((((minint + 0x1) // minint) == 0x0))
141+assert(((minint // (minint + 0x1)) == 0x1))
142142assert(((minint // 0x1) == minint))
143143assert((minint // - (0x1 == - minint)))
144−assert((minint // - (0x2 == (0x2 ^ ((intbits - 0x2))))))
144+assert((minint // - (0x2 == (0x2 ^ (intbits - 0x2)))))
145145assert((maxint // - (0x1 == - maxint)))
146146do
147147assert((0x2 ^ - (0x3 == (0x1 / (0x2 ^ 0x3)))))
@@ -157,25 +157,25 @@ end
157157end
158158end
159159if (floatbits < intbits) then
160−assert(((2.0 ^ floatbits) == ((0x1 << floatbits))))
161−assert((((2.0 ^ floatbits) - 1.0) == (((0x1 << floatbits)) - 1.0)))
162−assert((((2.0 ^ floatbits) - 1.0) ~= ((0x1 << floatbits))))
163−assert((((2.0 ^ floatbits) + 1.0) ~= (((0x1 << floatbits)) + 0x1)))
160+assert(((2.0 ^ floatbits) == (0x1 << floatbits)))
161+assert((((2.0 ^ floatbits) - 1.0) == ((0x1 << floatbits) - 1.0)))
162+assert((((2.0 ^ floatbits) - 1.0) ~= (0x1 << floatbits)))
163+assert((((2.0 ^ floatbits) + 1.0) ~= ((0x1 << floatbits) + 0x1)))
164164else
165165assert((maxint == (maxint + 0.0)))
166166assert(((maxint - 0x1) == (maxint - 1.0)))
167167assert(((minint + 0x1) == (minint + 1.0)))
168168assert((maxint ~= (maxint - 1.0)))
169169end
170−assert(((maxint + 0.0) == ((2.0 ^ ((intbits - 0x1))) - 1.0)))
170+assert(((maxint + 0.0) == ((2.0 ^ (intbits - 0x1)) - 1.0)))
171171assert(((minint + 0.0) == minint))
172−assert(((minint + 0.0) == - (2.0 ^ ((intbits - 0x1)))))
172+assert(((minint + 0.0) == - (2.0 ^ (intbits - 0x1))))
173173assert((0x1 < 1.1))
174174;
175−assert(not ((0x1 < 0.9)))
175+assert(not (0x1 < 0.9))
176176assert((0x1 <= 1.1))
177177;
178−assert(not ((0x1 <= 0.9)))
178+assert(not (0x1 <= 0.9))
179179assert(- (0x1 < - 0.9))
180180;
181181assert(not (- (0x1 < - 1.1)))
@@ -190,17 +190,17 @@ assert(- (0x1 <= - 0.9))
190190assert(not (- (0x1 <= - 1.1)))
191191assert((minint <= (minint + 0.0)))
192192assert(((minint + 0.0) <= minint))
193−assert(not ((minint < (minint + 0.0))))
194−assert(not (((minint + 0.0) < minint)))
193+assert(not (minint < (minint + 0.0)))
194+assert(not ((minint + 0.0) < minint))
195195assert((maxint < (minint * - 1.0)))
196196assert((maxint <= (minint * - 1.0)))
197197do
198−local fmaxi1 = (0x2 ^ ((intbits - 0x1)))
198+local fmaxi1 = (0x2 ^ (intbits - 0x1))
199199assert((maxint < fmaxi1))
200200assert((maxint <= fmaxi1))
201−assert(not ((fmaxi1 <= maxint)))
202−assert((minint <= - (0x2 ^ ((intbits - 0x1)))))
203−assert(- ((0x2 ^ ((intbits - 0x1))) <= minint))
201+assert(not (fmaxi1 <= maxint))
202+assert((minint <= - (0x2 ^ (intbits - 0x1))))
203+assert(- ((0x2 ^ (intbits - 0x1)) <= minint))
204204end
205205if (floatbits < intbits) then
206206print("\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,12 +208,12 @@ local fmax = (0x2 ^ floatbits)
208208local ifmax = (fmax | 0x0)
209209assert((fmax < (ifmax + 0x1)))
210210assert(((fmax - 0x1) < ifmax))
211−assert(- (((fmax - 0x1)) > - ifmax))
212−assert(not ((fmax <= (ifmax - 0x1))))
213−assert(- (fmax > - ((ifmax + 0x1))))
214−assert(not (- (fmax >= - ((ifmax - 0x1)))))
211+assert(- ((fmax - 0x1) > - ifmax))
212+assert(not (fmax <= (ifmax - 0x1)))
213+assert(- (fmax > - (ifmax + 0x1)))
214+assert(not (- (fmax >= - (ifmax - 0x1))))
215215assert((((fmax / 0x2) - 0.5) < (ifmax // 0x2)))
216−assert(- ((((fmax / 0x2) - 0.5)) > - (ifmax // 0x2)))
216+assert(- (((fmax / 0x2) - 0.5) > - (ifmax // 0x2)))
217217assert((maxint < (0x2 ^ intbits)))
218218assert((minint > - (0x2 ^ intbits)))
219219assert((maxint <= (0x2 ^ intbits)))
@@ -224,40 +224,40 @@ assert((maxint < (maxint + 1.0)))
224224assert((maxint < (maxint + 0.5)))
225225assert(((maxint - 1.0) < maxint))
226226assert(((maxint - 0.5) < maxint))
227−assert(not (((maxint + 0.0) < maxint)))
227+assert(not ((maxint + 0.0) < maxint))
228228assert(((maxint + 0.0) <= maxint))
229−assert(not ((maxint < (maxint + 0.0))))
229+assert(not (maxint < (maxint + 0.0)))
230230assert(((maxint + 0.0) <= maxint))
231231assert((maxint <= (maxint + 0.0)))
232−assert(not (((maxint + 1.0) <= maxint)))
233−assert(not (((maxint + 0.5) <= maxint)))
234−assert(not ((maxint <= (maxint - 1.0))))
235−assert(not ((maxint <= (maxint - 0.5))))
232+assert(not ((maxint + 1.0) <= maxint))
233+assert(not ((maxint + 0.5) <= maxint))
234+assert(not (maxint <= (maxint - 1.0)))
235+assert(not (maxint <= (maxint - 0.5)))
236236assert((minint < (minint + 1.0)))
237237assert((minint < (minint + 0.5)))
238238assert((minint <= (minint + 0.5)))
239239assert(((minint - 1.0) < minint))
240240assert(((minint - 1.0) <= minint))
241−assert(not (((minint + 0.0) < minint)))
242−assert(not (((minint + 0.5) < minint)))
243−assert(not ((minint < (minint + 0.0))))
241+assert(not ((minint + 0.0) < minint))
242+assert(not ((minint + 0.5) < minint))
243+assert(not (minint < (minint + 0.0)))
244244assert(((minint + 0.0) <= minint))
245245assert((minint <= (minint + 0.0)))
246−assert(not (((minint + 1.0) <= minint)))
247−assert(not (((minint + 0.5) <= minint)))
248−assert(not ((minint <= (minint - 1.0))))
246+assert(not ((minint + 1.0) <= minint))
247+assert(not ((minint + 0.5) <= minint))
248+assert(not (minint <= (minint - 1.0)))
249249end
250250do
251251local NaN <const> = (0x0 / 0x0)
252−assert(not ((NaN < 0x0)))
253−assert(not ((NaN > minint)))
254−assert(not ((NaN <= - 0x9)))
255−assert(not ((NaN <= maxint)))
256−assert(not ((NaN < maxint)))
257−assert(not ((minint <= NaN)))
258−assert(not ((minint < NaN)))
259−assert(not ((0x4 <= NaN)))
260−assert(not ((0x4 < NaN)))
252+assert(not (NaN < 0x0))
253+assert(not (NaN > minint))
254+assert(not (NaN <= - 0x9))
255+assert(not (NaN <= maxint))
256+assert(not (NaN < maxint))
257+assert(not (minint <= NaN))
258+assert(not (minint < NaN))
259+assert(not (0x4 <= NaN))
260+assert(not (0x4 < NaN))
261261end
262262local function checkcompt
263263(msg,code)
@@ -280,10 +280,10 @@ if (floatbits < intbits) then
280280assert(((maxint + 1.0) == (maxint + 0.0)))
281281assert(((minint - 1.0) == (minint + 0.0)))
282282checkerror(msgf2i,f2i,(maxint + 0.0))
283−assert((f2i((2.0 ^ ((intbits - 0x2)))) == (0x1 << ((intbits - 0x2)))))
284−assert((f2i(- (2.0 ^ ((intbits - 0x2)))) == - ((0x1 << ((intbits - 0x2))))))
285−assert((((((2.0 ^ ((floatbits - 0x1))) + 1.0)) // 0x1) == (((0x1 << ((floatbits - 0x1)))) + 0x1)))
286−local mf = ((maxint - ((0x1 << ((floatbits - intbits))))) + 0x1)
283+assert((f2i((2.0 ^ (intbits - 0x2))) == (0x1 << (intbits - 0x2))))
284+assert((f2i(- (2.0 ^ (intbits - 0x2))) == - (0x1 << (intbits - 0x2))))
285+assert(((((2.0 ^ (floatbits - 0x1)) + 1.0) // 0x1) == ((0x1 << (floatbits - 0x1)) + 0x1)))
286+local mf = ((maxint - (0x1 << (floatbits - intbits))) + 0x1)
287287assert((f2i((mf + 0.0)) == mf))
288288mf=(mf + 0x1)
289289assert((f2i((mf + 0.0)) ~= mf))
@@ -335,9 +335,9 @@ assert(((((tonumber("\u{2b}\u{30}\u{2e}\u{30}\u{31}") == (0x1 / 0x64)) and (tonu
335335assert(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}"))))))
336336assert((tonumber("\u{2d}\u{30}\u{31}\u{32}") == - (0xa - 0x2)))
337337assert((tonumber("\u{2d}\u{31}\u{2e}\u{32}\u{65}\u{32}") == - - - 0x78))
338−assert((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))
340−assert((tonumber(("\u{2d}\u{30}\u{78}" .. string.rep("\u{66}",((intbits // 0x4))))) == 0x1))
338+assert((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))
340+assert((tonumber(("\u{2d}\u{30}\u{78}" .. string.rep("\u{66}",(intbits // 0x4)))) == 0x1))
341341assert((tonumber("\u{20}\u{20}\u{30}\u{30}\u{31}\u{30}\u{31}\u{30}\u{20}\u{20}",0x2) == 0xa))
342342assert((tonumber("\u{20}\u{20}\u{30}\u{30}\u{31}\u{30}\u{31}\u{30}\u{20}\u{20}",0xa) == 0x3f2))
343343assert((tonumber("\u{20}\u{20}\u{2d}\u{31}\u{30}\u{31}\u{30}\u{20}\u{20}",0x2) == - 0xa))
@@ -345,11 +345,11 @@ assert((tonumber("\u{31}\u{30}",0x24) == 0x24))
345345assert((tonumber("\u{20}\u{20}\u{2d}\u{31}\u{30}\u{20}\u{20}",0x24) == - 0x24))
346346assert((tonumber("\u{20}\u{20}\u{2b}\u{31}\u{5a}\u{20}\u{20}",0x24) == (0x24 + 0x23)))
347347assert((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))))))))))))))
349−assert(((tonumber(string.rep("\u{31}",((intbits - 0x2))),0x2) + 0x1) == (0x2 ^ ((intbits - 0x2)))))
350−assert(((tonumber("\u{66}\u{66}\u{66}\u{66}\u{46}\u{46}\u{46}\u{46}",0x10) + 0x1) == ((0x1 << 0x20))))
351−assert(((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))))
348+assert((tonumber("\u{2d}\u{66}\u{46}\u{66}\u{61}",0x10) == - (0xa + (0x10 * (0xf + (0x10 * (0xf + (0x10 * 0xf))))))))
349+assert(((tonumber(string.rep("\u{31}",(intbits - 0x2)),0x2) + 0x1) == (0x2 ^ (intbits - 0x2))))
350+assert(((tonumber("\u{66}\u{66}\u{66}\u{66}\u{46}\u{46}\u{46}\u{46}",0x10) + 0x1) == (0x1 << 0x20)))
351+assert(((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)))
353353for i = 0x2, 0x24
354354do
355355local i2 = (i * i)
@@ -357,10 +357,10 @@ local i10 = ((((i2 * i2) * i2) * i2) * i2)
357357assert((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))
358358end
359359if not _soft then
360−assert((tonumber(("\u{30}\u{78}" .. (string.rep("\u{66}",0xd) .. "\u{2e}\u{30}"))) == ((2.0 ^ ((0x4 * 0xd))) - 0x1)))
361−assert((tonumber(("\u{30}\u{78}" .. (string.rep("\u{66}",0x96) .. "\u{2e}\u{30}"))) == ((2.0 ^ ((0x4 * 0x96))) - 0x1)))
362−assert((tonumber(("\u{30}\u{78}" .. (string.rep("\u{66}",0x12c) .. "\u{2e}\u{30}"))) == ((2.0 ^ ((0x4 * 0x12c))) - 0x1)))
363−assert((tonumber(("\u{30}\u{78}" .. (string.rep("\u{66}",0x1f4) .. "\u{2e}\u{30}"))) == ((2.0 ^ ((0x4 * 0x1f4))) - 0x1)))
360+assert((tonumber(("\u{30}\u{78}" .. (string.rep("\u{66}",0xd) .. "\u{2e}\u{30}"))) == ((2.0 ^ (0x4 * 0xd)) - 0x1)))
361+assert((tonumber(("\u{30}\u{78}" .. (string.rep("\u{66}",0x96) .. "\u{2e}\u{30}"))) == ((2.0 ^ (0x4 * 0x96)) - 0x1)))
362+assert((tonumber(("\u{30}\u{78}" .. (string.rep("\u{66}",0x12c) .. "\u{2e}\u{30}"))) == ((2.0 ^ (0x4 * 0x12c)) - 0x1)))
363+assert((tonumber(("\u{30}\u{78}" .. (string.rep("\u{66}",0x1f4) .. "\u{2e}\u{30}"))) == ((2.0 ^ (0x4 * 0x1f4)) - 0x1)))
364364assert((tonumber(("\u{30}\u{78}\u{33}\u{2e}" .. string.rep("\u{30}",0x3e8))) == 0x3))
365365assert((tonumber(("\u{30}\u{78}" .. (string.rep("\u{30}",0x3e8) .. "\u{61}"))) == 0xa))
366366assert((tonumber(("\u{30}\u{78}\u{30}\u{2e}" .. (string.rep("\u{30}",0xd) .. "\u{31}"))) == (2.0 ^ (- (0x4 * 0xe)))))
@@ -413,10 +413,10 @@ assert(not tonumber("\u{30}\u{78}\u{30}\u{2e}\u{35}\u{31}\u{70}"))
413413assert(not tonumber("\u{30}\u{78}\u{35}\u{70}\u{2b}\u{2d}\u{32}"))
414414assert((((0x10 == 0x10) and (0xfff == ((0x2 ^ 0xc) - 0x1))) and (0xfb == 0xfb)))
415415assert(((0.0 == 0x0) and (0.0 == 0x0)))
416−assert((0xffffffff == (((0x1 << 0x20)) - 0x1)))
416+assert((0xffffffff == ((0x1 << 0x20) - 0x1)))
417417assert((tonumber("\u{2b}\u{30}\u{78}\u{32}") == 0x2))
418418assert((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)))
420420assert((((0.0 == 0x0) and ((0xe + 0x1) == 0xf)) and ((0xe - 0x1) == 0xd)))
421421assert((tonumber("\u{20}\u{20}\u{30}\u{78}\u{32}\u{2e}\u{35}\u{20}\u{20}") == (0x25 / 0x10)))
422422assert((tonumber("\u{20}\u{20}\u{2d}\u{30}\u{78}\u{32}\u{2e}\u{35}\u{20}\u{20}") == - (0x25 / 0x10)))
@@ -435,15 +435,15 @@ assert(((tonumber("\u{31}\u{31}\u{31}\u{31}\u{31}\u{31}\u{31}\u{31}\u{31}\u{31}"
435435assert(((1e-31 > 9e-32) and (9e29 < 1e30)))
436436assert((0.123456 > 0.123455))
437437assert((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))))
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))))
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)))))
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)))))
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))))
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}")))
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}")))
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}"))))
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}"))))
446+assert((((1.3 < 1.4) and (1.3 <= 1.4)) and not ((1.3 < 1.3) and (1.3 <= 1.3))))
447447assert(eqT(- (0x4 % 0x3),0x2))
448448assert(eqT((0x4 % - 0x3),- 0x2))
449449assert(eqT(- (4.0 % 0x3),2.0))
@@ -465,19 +465,19 @@ assert(((math.pi - (math.pi % 1e-3)) == 3.141))
465465do
466466local i,j = 0x0,0x4e20
467467while (i < j) do
468−local m = (((i + j)) // 0x2)
468+local m = ((i + j) // 0x2)
469469if (0xa ^ - (m > 0x0)) then
470470i=(m + 0x1)
471471else
472472j=m
473473end
474474end
475−local b = (0xa ^ - ((i - ((i // 0xa)))))
475+local b = (0xa ^ - (i - (i // 0xa)))
476476assert(((b > 0x0) and ((b * b) == 0x0)))
477477local delta = (b / 0x3e8)
478−assert(eq((((2.1 * b)) % ((0x2 * b))),((0.1 * b)),delta))
479−assert(eq(((- (2.1 * b)) % ((0x2 * b))),(((0x2 * b)) - ((0.1 * b))),delta))
480−assert(eq((((2.1 * b)) % (- (0x2 * b))),(((0.1 * b)) - ((0x2 * b))),delta))
478+assert(eq(((2.1 * b) % (0x2 * b)),(0.1 * b),delta))
479+assert(eq(((- (2.1 * b)) % (0x2 * b)),((0x2 * b) - (0.1 * b)),delta))
480+assert(eq(((2.1 * b) % (- (0x2 * b))),((0.1 * b) - (0x2 * b)),delta))
481481assert(eq(((- (2.1 * b)) % (- (0x2 * b))),(- (0.1 * b)),delta))
482482end
483483for i = - 0xa, 0xa
@@ -485,7 +485,7 @@ do
485485for j = - 0xa, 0xa
486486do
487487if (j ~= 0x0) then
488−assert(((((i + 0.0)) % j) == (i % j)))
488+assert((((i + 0.0) % j) == (i % j)))
489489end
490490end
491491end
@@ -494,14 +494,14 @@ do
494494for j = - 0xa, 0xa
495495do
496496if (j ~= 0x0) then
497−assert(((((0x2 ^ i)) % j) == (((0x1 << i)) % j)))
497+assert((((0x2 ^ i) % j) == ((0x1 << i) % j)))
498498end
499499end
500500end
501501do
502502local i = 0xa
503−while (((0x1 << i)) > 0x0) do
504−assert(((((0x1 << i)) % 0x3) == ((i % 0x2) + 0x1)))
503+while ((0x1 << i) > 0x0) do
504+assert((((0x1 << i) % 0x3) == ((i % 0x2) + 0x1)))
505505i=(i + 0x1)
506506end
507507i=0xa
@@ -512,8 +512,8 @@ end
512512end
513513assert(eqT((minint % minint),0x0))
514514assert(eqT((maxint % maxint),0x0))
515−assert(((((minint + 0x1)) % minint) == (minint + 0x1)))
516−assert(((((maxint - 0x1)) % maxint) == (maxint - 0x1)))
515+assert((((minint + 0x1) % minint) == (minint + 0x1)))
516+assert((((maxint - 0x1) % maxint) == (maxint - 0x1)))
517517assert(((minint % maxint) == (maxint - 0x1)))
518518assert((minint % - (0x1 == 0x0)))
519519assert((minint % - (0x2 == 0x0)))
@@ -558,7 +558,7 @@ assert(eq(math.log(0x2,0xa),(math.log(0x2) / math.log(0xa))))
558558assert(eq(math.log(0x2,0x2),0x1))
559559assert(eq(math.log(0x9,0x3),0x2))
560560assert(eq(math.exp(0x0),0x1))
561−assert(eq(math.sin(0xa),math.sin((0xa % ((0x2 * math.pi))))))
561+assert(eq(math.sin(0xa),math.sin((0xa % (0x2 * math.pi)))))
562562assert((tonumber("\u{20}\u{31}\u{2e}\u{33}\u{65}\u{2d}\u{32}\u{20}") == 0.013))
563563assert((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))
564564assert((0x800001 + - (0x800001 == 0x0)))
@@ -616,7 +616,7 @@ local mi = math.fmod(i,j)
616616local mf = math.fmod((i + 0.0),j)
617617assert((mi == mf))
618618assert(((math.type(mi) == "\u{69}\u{6e}\u{74}\u{65}\u{67}\u{65}\u{72}") and (math.type(mf) == "\u{66}\u{6c}\u{6f}\u{61}\u{74}")))
619−if (((((i >= 0x0) and (j >= 0x0))) or (((i <= 0x0) and (j <= 0x0)))) or (mi == 0x0)) then
619+if ((((i >= 0x0) and (j >= 0x0)) or ((i <= 0x0) and (j <= 0x0))) or (mi == 0x0)) then
620620assert(eqT(mi,(i % j)))
621621end
622622end
@@ -662,13 +662,13 @@ assert((mz == z))
662662assert((((0x1 / mz) < 0x0) and (0x0 < (0x1 / z))))
663663local NaN <const> = (inf - inf)
664664assert((NaN ~= NaN))
665−assert(not ((NaN < NaN)))
666−assert(not ((NaN <= NaN)))
667−assert(not ((NaN > NaN)))
668−assert(not ((NaN >= NaN)))
669−assert(not (((0x0 < NaN)) and not ((NaN < 0x0))))
665+assert(not (NaN < NaN))
666+assert(not (NaN <= NaN))
667+assert(not (NaN > NaN))
668+assert(not (NaN >= NaN))
669+assert(not ((0x0 < NaN) and not (NaN < 0x0)))
670670local 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))))
672672local a = {}
673673assert(not pcall(rawset,a,NaN,0x1))
674674assert((a[NaN] == undef))
@@ -683,20 +683,20 @@ print("\u{74}\u{65}\u{73}\u{74}\u{69}\u{6e}\u{67}\u{20}\u{27}\u{6d}\u{61}\u{74}\
683683local random,max,min = math.random,math.max,math.min
684684local function testnear
685685(val,ref,tol)
686−return ((math.abs((val - ref)) < (ref * tol)))
686+return (math.abs((val - ref)) < (ref * tol))
687687end
688688do
689689local h <const> = 0x7a7040a5
690690local l <const> = 0xa323c9d6
691691math.randomseed(0x3ef)
692−local res = ((((h << 0x20) | l)) & ~ (~ (0x0 << intbits)))
692+local res = (((h << 0x20) | l) & ~ (~ (0x0 << intbits)))
693693assert((random(0x0) == res))
694694math.randomseed(0x3ef,0x0)
695695local res
696696if (floatbits <= 0x20) then
697−res=(((h >> ((0x20 - floatbits)))) % (0x2 ^ 0x20))
697+res=((h >> (0x20 - floatbits)) % (0x2 ^ 0x20))
698698else
699−res=((((h % (0x2 ^ 0x20))) * (0x2 ^ ((floatbits - 0x20)))) + ((((l >> ((0x40 - floatbits)))) % (0x2 ^ 0x20))))
699+res=(((h % (0x2 ^ 0x20)) * (0x2 ^ (floatbits - 0x20))) + ((l >> (0x40 - floatbits)) % (0x2 ^ 0x20)))
700700end
701701local rand = random()
702702assert(eq(rand,0.4782753376376966,(0x2 ^ - floatbits)))
@@ -732,15 +732,15 @@ up=max(up,t)
732732low=min(low,t)
733733assert((((t * mult) % 0x1) == 0x0))
734734local bit = (i % randbits)
735−if ((((t * (0x2 ^ bit))) % 0x1) >= 0.5) then
735+if (((t * (0x2 ^ bit)) % 0x1) >= 0.5) then
736736counts[(bit + 0x1)]=(counts[(bit + 0x1)] + 0x1)
737737end
738738end
739739totalrounds=(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
741741goto doagain
742742end
743−local expected = (((totalrounds / randbits) / 0x2))
743+local expected = ((totalrounds / randbits) / 0x2)
744744for i = 0x1, randbits
745745do
746746if not testnear(counts[i],expected,0.1) then
@@ -766,21 +766,21 @@ local t = random(0x0)
766766up=max(up,t)
767767low=min(low,t)
768768local bit = (i % intbits)
769−counts[(bit + 0x1)]=(counts[(bit + 0x1)] + ((((t >> bit)) & 0x1)))
769+counts[(bit + 0x1)]=(counts[(bit + 0x1)] + ((t >> bit) & 0x1))
770770end
771771totalrounds=(totalrounds + rounds)
772772local 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
774774goto doagain
775775end
776−local expected = (((totalrounds / intbits) / 0x2))
776+local expected = ((totalrounds / intbits) / 0x2)
777777for i = 0x1, intbits
778778do
779779if not testnear(counts[i],expected,0.1) then
780780goto doagain
781781end
782782end
783−print(string.format("\u{69}\u{6e}\u{74}\u{65}\u{67}\u{65}\u{72}\u{20}\u{72}\u{61}\u{6e}\u{64}\u{6f}\u{6d}\u{20}\u{72}\u{61}\u{6e}\u{67}\u{65}\u{20}\u{69}\u{6e}\u{20}\u{25}\u{64}\u{20}\u{63}\u{61}\u{6c}\u{6c}\u{73}\u{3a}\u{20}\u{5b}\u{6d}\u{69}\u{6e}\u{69}\u{6e}\u{74}\u{20}\u{2b}\u{20}\u{25}\u{2e}\u{30}\u{66}\u{70}\u{70}\u{6d}\u{2c}\u{20}\u{6d}\u{61}\u{78}\u{69}\u{6e}\u{74}\u{20}\u{2d}\u{20}\u{25}\u{2e}\u{30}\u{66}\u{70}\u{70}\u{6d}\u{5d}",totalrounds,((((minint - low)) / minint) * 1e6),((((maxint - up)) / maxint) * 1e6)))
783+print(string.format("\u{69}\u{6e}\u{74}\u{65}\u{67}\u{65}\u{72}\u{20}\u{72}\u{61}\u{6e}\u{64}\u{6f}\u{6d}\u{20}\u{72}\u{61}\u{6e}\u{67}\u{65}\u{20}\u{69}\u{6e}\u{20}\u{25}\u{64}\u{20}\u{63}\u{61}\u{6c}\u{6c}\u{73}\u{3a}\u{20}\u{5b}\u{6d}\u{69}\u{6e}\u{69}\u{6e}\u{74}\u{20}\u{2b}\u{20}\u{25}\u{2e}\u{30}\u{66}\u{70}\u{70}\u{6d}\u{2c}\u{20}\u{6d}\u{61}\u{78}\u{69}\u{6e}\u{74}\u{20}\u{2d}\u{20}\u{25}\u{2e}\u{30}\u{66}\u{70}\u{70}\u{6d}\u{5d}",totalrounds,(((minint - low) / minint) * 1e6),(((maxint - up) / maxint) * 1e6)))
784784end
785785do
786786local count = {0x0,0x0,0x0,0x0,0x0,0x0}
@@ -854,11 +854,11 @@ mark[t]=true
854854count=(count + 0x1)
855855end
856856end
857−if not ((count >= (n * 0.8))) then
857+if not (count >= (n * 0.8)) then
858858goto doagain
859859end
860−local diff = (((p2 - p1)) >> 0x4)
861−if not (((min < (p1 + diff)) and (max > (p2 - diff)))) then
860+local diff = ((p2 - p1) >> 0x4)
861+if not ((min < (p1 + diff)) and (max > (p2 - diff))) then
862862goto doagain
863863end
864864end
@@ -870,7 +870,7 @@ aux((minint // 0x2),(maxint // 0x2))
870870aux(minint,maxint)
871871aux((minint + 0x1),maxint)
872872aux(minint,(maxint - 0x1))
873−aux(0x0,(0x1 << ((intbits - 0x5))))
873+aux(0x0,(0x1 << (intbits - 0x5)))
874874end
875875assert(not pcall(random,0x1,0x2,0x3))
876876assert(not pcall(random,(minint + 0x1),minint))