on master help sign in
wip
commitd0e78398b6322c49dea0b5d7d8630dbcebf44771 authoriko <mail@iko.soy> dateSun 28 Jul 2024, 02:41 (2 years ago) parent4193b5f
8 files changed+45−45
zod/luau/lib/lua/printer.hoon+1−1 zod/luau/res/lua/cycled/attrib.lua+2−2 zod/luau/res/lua/cycled/code.lua+4−4 zod/luau/res/lua/cycled/files.lua+1−1 zod/luau/res/lua/cycled/math.lua+27−27 zod/luau/res/lua/cycled/nextvar.lua+7−7 zod/luau/res/lua/cycled/strings.lua+1−1 zod/luau/res/lua/cycled/tpack.lua+2−2
zod/luau/lib/lua/printer.hoon+1−1
@@ -509,7 +509,7 @@ print
509509 %- rlyd
510510 x
511511 :: if there is no dot then it will be interpreted as an int. add `.0` to force a float.
512− ?: =(~ (find ~['.'] res))
512+ ?: ?&(=(~ (find ~['.'] res)) =(~ (find ~['e'] res)))
513513 (weld res ".0")
514514 res
515515 --
zod/luau/res/lua/cycled/attrib.lua+2−2
@@ -309,12 +309,12 @@ do
309309a[i + 0.0]=i
310310;
311311end
312−a[1e31.0]="\97\108\111"
312+a[1e31]="\97\108\111"
313313;
314314a[true]=10
315315;
316316a[false]=20
317−assert(a[1e31.0] == "\97\108\111" and a[not 1] == 20 and a[10 < 20] == 10)
317+assert(a[1e31] == "\97\108\111" and a[not 1] == 20 and a[10 < 20] == 10)
318318for i = 3000, - 3000, - 1
319319do
320320assert(a[i] == i)
zod/luau/res/lua/cycled/code.lua+4−4
@@ -71,13 +71,13 @@ foo=function (f,a)
7171f(100 * 1000)
7272f(100.0 * 1000)
7373f(- 100 * 1000)
74−f(- 100 * 1e3.0)
74+f(- 100 * 1e3)
7575f(100000)
76−f(1e5.0)
76+f(1e5)
7777f(- 100000)
78−f(- 1e5.0)
78+f(- 1e5)
7979end
80−checkKlist(foo,{100000,1e5.0,- 100000,- 1e5.0})
80+checkKlist(foo,{100000,1e5,- 100000,- 1e5})
8181foo=function (t,a)
8282t[a]=1
8383;
zod/luau/res/lua/cycled/files.lua+1−1
@@ -167,7 +167,7 @@ assert(f:read(2) == "\43\32")
167167assert(f:read("\110") == 0.3)
168168;
169169assert(f:read(1) == "\124")
170−assert(f:read("\110") == 5e-3.0)
170+assert(f:read("\110") == 5e-3)
171171;
172172assert(f:read(1) == "\88")
173173assert(f:read("\110") == 2.34e15)
zod/luau/res/lua/cycled/math.lua+27−27
@@ -35,9 +35,9 @@ local function eq
3535(a,b,limit)
3636if not limit then
3737if floatbits >= 50 then
38−limit=1e-11.0
38+limit=1e-11
3939else
40−limit=1e-5.0
40+limit=1e-5
4141end
4242end
4343return a == b or math.abs(a - b) <= limit
@@ -67,10 +67,10 @@ local a,b = math.modf(3.5)
6767assert(a == 3.0 and b == 0.5)
6868a,b=math.modf(- 2.5)
6969assert(a == - 2.0 and b == - 0.5)
70−a,b=math.modf(- 3e23.0)
71−assert(a == - 3e23.0 and b == 0.0)
72−a,b=math.modf(3e35.0)
73−assert(a == 3e35.0 and b == 0.0)
70+a,b=math.modf(- 3e23)
71+assert(a == - 3e23 and b == 0.0)
72+a,b=math.modf(3e35)
73+assert(a == 3e35 and b == 0.0)
7474a,b=math.modf(- 1 / 0)
7575assert(a == - 1 / 0 and b == 0.0)
7676a,b=math.modf(1 / 0)
@@ -82,8 +82,8 @@ assert(eqT(a,3) and eqT(b,0.0))
8282a,b=math.modf(minint)
8383assert(eqT(a,minint) and eqT(b,0.0))
8484end
85−assert(math.huge > 1e31.0)
86−assert(- math.huge < - 1e31.0)
85+assert(math.huge > 1e31)
86+assert(- math.huge < - 1e31)
8787assert(minint < minint + 1)
8888assert(maxint - 1 < maxint)
8989assert(0 - minint == minint)
@@ -313,13 +313,13 @@ return s
313313end
314314assert(eqT(tonumber(incd(maxint)),maxint + 1.0))
315315assert(eqT(tonumber(incd(minint)),minint - 1.0))
316−assert(eqT(tonumber("\49" .. string.rep("\48",30)),1e30.0))
317−assert(eqT(tonumber("\45\49" .. string.rep("\48",30)),- 1e30.0))
316+assert(eqT(tonumber("\49" .. string.rep("\48",30)),1e30))
317+assert(eqT(tonumber("\45\49" .. string.rep("\48",30)),- 1e30))
318318assert(eqT(tonumber("\48\120\49" .. string.rep("\48",30)),0))
319319assert(minint == load("\114\101\116\117\114\110\32" .. minint)())
320320assert(eqT(maxint,load("\114\101\116\117\114\110\32" .. maxint)()))
321−assert(eqT(1e22.0,10000000000000000000000))
322−assert(eqT(- 1e22.0,- 10000000000000000000000))
321+assert(eqT(1e22,10000000000000000000000))
322+assert(eqT(- 1e22,- 10000000000000000000000))
323323end
324324assert(tonumber(3.4) == 3.4)
325325assert(eqT(tonumber(3),3))
@@ -432,7 +432,7 @@ assert(100.0 == 100.0 and 0.01 == 0.01)
432432assert(1111111111 - 1111111110 == 1.0)
433433assert(1.1 == "\49\46" + "\46\49")
434434assert(tonumber("\49\49\49\49\49\49\49\49\49\49") - tonumber("\49\49\49\49\49\49\49\49\49\48") == tonumber("\32\32\43\48\46\48\48\49\101\43\51\32\10\9"))
435−assert(1e-31.0 > 9e-32.0 and 9e29.0 < 1e30.0)
435+assert(1e-31 > 9e-32 and 9e29 < 1e30)
436436assert(0.123456 > 0.123455)
437437assert(tonumber("\43\49\46\50\51\69\49\56") == 1.23 * 10.0 ^ 18)
438438assert(not (1 < 1) and (1 < 2) and not (2 < 1))
@@ -461,7 +461,7 @@ assert(eqT(10.0 % 2,0.0))
461461assert(eqT(- 10.0 % 2,0.0))
462462assert(eqT(- 10.0 % - 2,0.0))
463463assert(math.pi - math.pi % 1 == 3)
464−assert(math.pi - math.pi % 1e-3.0 == 3.141)
464+assert(math.pi - math.pi % 1e-3 == 3.141)
465465do
466466local i,j = 0,20000
467467while i < j do
@@ -526,12 +526,12 @@ end
526526anan(0.0 % 0)
527527anan(1.3 % 0)
528528anan(math.huge % 1)
529−anan(math.huge % 1e30.0)
530−anan(- math.huge % 1e30.0)
531−anan(- math.huge % - 1e30.0)
529+anan(math.huge % 1e30)
530+anan(- math.huge % 1e30)
531+anan(- math.huge % - 1e30)
532532assert(1 % math.huge == 1)
533−assert(1e30.0 % math.huge == 1e30.0)
534−assert(1e30.0 % - math.huge == - math.huge)
533+assert(1e30 % math.huge == 1e30)
534+assert(1e30 % - math.huge == - math.huge)
535535assert(- 1 % math.huge == math.huge)
536536assert(- 1 % - math.huge == - 1)
537537end
@@ -575,10 +575,10 @@ assert(eqT(math.floor(minint),minint))
575575assert(eqT(math.floor(minint + 0.0),minint))
576576assert(eqT(math.ceil(minint),minint))
577577assert(eqT(math.ceil(minint + 0.0),minint))
578−assert(math.floor(1e50.0) == 1e50.0)
579−assert(math.ceil(1e50.0) == 1e50.0)
580−assert(math.floor(- 1e50.0) == - 1e50.0)
581−assert(math.ceil(- 1e50.0) == - 1e50.0)
578+assert(math.floor(1e50) == 1e50)
579+assert(math.ceil(1e50) == 1e50)
580+assert(math.floor(- 1e50) == - 1e50)
581+assert(math.ceil(- 1e50) == - 1e50)
582582for _,p in pairs({31,32,63,64})
583583do
584584assert(math.floor(2 ^ p) == 2 ^ p)
@@ -632,13 +632,13 @@ checkerror("\118\97\108\117\101\32\101\120\112\101\99\116\101\100",math.max)
632632checkerror("\118\97\108\117\101\32\101\120\112\101\99\116\101\100",math.min)
633633assert(eqT(math.max(3),3))
634634assert(eqT(math.max(3,5,9,1),9))
635−assert(math.max(maxint,1e61.0) == 1e61.0)
635+assert(math.max(maxint,1e61) == 1e61)
636636assert(eqT(math.max(minint,minint + 1),minint + 1))
637637assert(eqT(math.min(3),3))
638638assert(eqT(math.min(3,5,9,1),1))
639639assert(math.min(3.2,5.9,- 9.2,1.1) == - 9.2)
640640assert(math.min(1.9,1.7,1.72) == 1.7)
641−assert(math.min(- 1e61.0,minint) == - 1e61.0)
641+assert(math.min(- 1e61,minint) == - 1e61)
642642assert(eqT(math.min(maxint,maxint - 1),maxint - 1))
643643assert(eqT(math.min(maxint - 2,maxint,maxint - 1),maxint - 2))
644644end
@@ -737,7 +737,7 @@ counts[bit + 1]=counts[bit + 1] + 1
737737end
738738end
739739totalrounds=totalrounds + rounds
740−if not (eq(up,1,1e-3.0) and eq(low,0,1e-3.0)) then
740+if not (eq(up,1,1e-3) and eq(low,0,1e-3)) then
741741goto doagain
742742end
743743local expected = (totalrounds / randbits / 2)
@@ -780,7 +780,7 @@ if not testnear(counts[i],expected,0.1) then
780780goto doagain
781781end
782782end
783−print(string.format("\105\110\116\101\103\101\114\32\114\97\110\100\111\109\32\114\97\110\103\101\32\105\110\32\37\100\32\99\97\108\108\115\58\32\91\109\105\110\105\110\116\32\43\32\37\46\48\102\112\112\109\44\32\109\97\120\105\110\116\32\45\32\37\46\48\102\112\112\109\93",totalrounds,(minint - low) / minint * 1e6.0,(maxint - up) / maxint * 1e6.0))
783+print(string.format("\105\110\116\101\103\101\114\32\114\97\110\100\111\109\32\114\97\110\103\101\32\105\110\32\37\100\32\99\97\108\108\115\58\32\91\109\105\110\105\110\116\32\43\32\37\46\48\102\112\112\109\44\32\109\97\120\105\110\116\32\45\32\37\46\48\102\112\112\109\93",totalrounds,(minint - low) / minint * 1e6,(maxint - up) / maxint * 1e6))
784784end
785785do
786786local count = {0,0,0,0,0,0}
zod/luau/res/lua/cycled/nextvar.lua+7−7
@@ -679,7 +679,7 @@ end
679679assert(a == 1)
680680a=0
681681;
682−for i = 10000, 1e4.0, - 1
682+for i = 10000, 1e4, - 1
683683do
684684a=a + 1
685685end
@@ -695,7 +695,7 @@ end
695695assert(a == 0)
696696a=0
697697;
698−for i = 9999, 1e4.0, - 1
698+for i = 9999, 1e4, - 1
699699do
700700a=a + 1
701701end
@@ -735,7 +735,7 @@ end
735735assert(a == 1)
736736a=0
737737;
738−for i = 1e6.0, 1e6.0, - 1
738+for i = 1e6, 1e6, - 1
739739do
740740a=a + 1
741741end
@@ -751,7 +751,7 @@ end
751751assert(a == 0)
752752a=0
753753;
754−for i = 99999, 1e5.0, - 1.0
754+for i = 99999, 1e5, - 1.0
755755do
756756a=a + 1
757757end
@@ -840,7 +840,7 @@ end
840840assert(c == 10)
841841c=0
842842;
843−for i = 10, 1e-3.0, - 1
843+for i = 10, 1e-3, - 1
844844do
845845checkint(i)
846846end
@@ -895,11 +895,11 @@ end
895895checkint(i)
896896end
897897assert(c == 10)
898−for i = math.mininteger, - 1e101.0
898+for i = math.mininteger, - 1e101
899899do
900900assert(false)
901901end
902−for i = math.maxinteger, 1e101.0, - 1
902+for i = math.maxinteger, 1e101, - 1
903903do
904904assert(false)
905905end
zod/luau/res/lua/cycled/strings.lua+1−1
@@ -273,7 +273,7 @@ s=string.format("\37\65",n)
273273assert(string.find(s,"\94\37\45\63\48\88\91\49\45\57\65\45\70\93\37\46\63\91\48\45\57\65\45\70\93\42\80\91\45\43\93\63\37\100\43\36"))
274274assert(tonumber(s) == n)
275275end
276−for _,n in ipairs({0.1,- 0.1,1 / 3,- 1 / 3,1e30.0,- 1e30.0,- 45 / 247,1,- 1,2,- 2,3e-20.0,- 3e-20.0})
276+for _,n in ipairs({0.1,- 0.1,1 / 3,- 1 / 3,1e30,- 1e30,- 45 / 247,1,- 1,2,- 2,3e-20,- 3e-20})
277277do
278278matchhexa(n)
279279end
zod/luau/res/lua/cycled/tpack.lua+2−2
@@ -129,7 +129,7 @@ else
129129assert(pack("\102",24) == pack("\62\102",24))
130130end
131131print("\116\101\115\116\105\110\103\32\112\97\99\107\47\117\110\112\97\99\107\32\111\102\32\102\108\111\97\116\105\110\103\45\112\111\105\110\116\32\110\117\109\98\101\114\115")
132−for _,n in ipairs({0,- 1.1,1.9,1 / 0,- 1 / 0,1e20.0,- 1e20.0,0.1,2000.7})
132+for _,n in ipairs({0,- 1.1,1.9,1 / 0,- 1 / 0,1e20,- 1e20,0.1,2000.7})
133133do
134134assert(unpack("\110",pack("\110",n)) == n)
135135assert(unpack("\60\110",pack("\60\110",n)) == n)
@@ -137,7 +137,7 @@ assert(unpack("\62\110",pack("\62\110",n)) == n)
137137assert(pack("\60\102",n) == pack("\62\102",n):reverse())
138138assert(pack("\62\100",n) == pack("\60\100",n):reverse())
139139end
140−for _,n in ipairs({0,- 1.5,1 / 0,- 1 / 0,1e10.0,- 1e9.0,0.5,2000.25})
140+for _,n in ipairs({0,- 1.5,1 / 0,- 1 / 0,1e10,- 1e9,0.5,2000.25})
141141do
142142assert(unpack("\60\102",pack("\60\102",n)) == n)
143143assert(unpack("\62\102",pack("\62\102",n)) == n)