on master help sign in
wip
d0e7839iko
zod/luau/lib/lua/printer.hoon+1−1
@@ -509,7 +509,7 @@ print
509 %- rlyd
509 %- rlyd
510 x
510 x
511 :: if there is no dot then it will be interpreted as an int. add `.0` to force a float.
511 :: 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)))
513 (weld res ".0")
513 (weld res ".0")
514 res
514 res
515 --
515 --
zod/luau/res/lua/cycled/attrib.lua+2−2
@@ -309,12 +309,12 @@ do
309a[i + 0.0]=i
309a[i + 0.0]=i
310;
310;
311end
311end
312−a[1e31.0]="\97\108\111"
312+a[1e31]="\97\108\111"
313;
313;
314a[true]=10
314a[true]=10
315;
315;
316a[false]=20
316a[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)
318for i = 3000, - 3000, - 1
318for i = 3000, - 3000, - 1
319do
319do
320assert(a[i] == i)
320assert(a[i] == i)
zod/luau/res/lua/cycled/code.lua+4−4
@@ -71,13 +71,13 @@ foo=function (f,a)
71f(100 * 1000)
71f(100 * 1000)
72f(100.0 * 1000)
72f(100.0 * 1000)
73f(- 100 * 1000)
73f(- 100 * 1000)
74−f(- 100 * 1e3.0)
74+f(- 100 * 1e3)
75f(100000)
75f(100000)
76−f(1e5.0)
76+f(1e5)
77f(- 100000)
77f(- 100000)
78−f(- 1e5.0)
78+f(- 1e5)
79end
79end
80−checkKlist(foo,{100000,1e5.0,- 100000,- 1e5.0})
80+checkKlist(foo,{100000,1e5,- 100000,- 1e5})
81foo=function (t,a)
81foo=function (t,a)
82t[a]=1
82t[a]=1
83;
83;
zod/luau/res/lua/cycled/files.lua+1−1
@@ -167,7 +167,7 @@ assert(f:read(2) == "\43\32")
167assert(f:read("\110") == 0.3)
167assert(f:read("\110") == 0.3)
168;
168;
169assert(f:read(1) == "\124")
169assert(f:read(1) == "\124")
170−assert(f:read("\110") == 5e-3.0)
170+assert(f:read("\110") == 5e-3)
171;
171;
172assert(f:read(1) == "\88")
172assert(f:read(1) == "\88")
173assert(f:read("\110") == 2.34e15)
173assert(f:read("\110") == 2.34e15)
zod/luau/res/lua/cycled/math.lua+27−27
@@ -35,9 +35,9 @@ local function eq
35(a,b,limit)
35(a,b,limit)
36if not limit then
36if not limit then
37if floatbits >= 50 then
37if floatbits >= 50 then
38−limit=1e-11.0
38+limit=1e-11
39else
39else
40−limit=1e-5.0
40+limit=1e-5
41end
41end
42end
42end
43return a == b or math.abs(a - b) <= limit
43return a == b or math.abs(a - b) <= limit
@@ -67,10 +67,10 @@ local a,b = math.modf(3.5)
67assert(a == 3.0 and b == 0.5)
67assert(a == 3.0 and b == 0.5)
68a,b=math.modf(- 2.5)
68a,b=math.modf(- 2.5)
69assert(a == - 2.0 and b == - 0.5)
69assert(a == - 2.0 and b == - 0.5)
70−a,b=math.modf(- 3e23.0)
70+a,b=math.modf(- 3e23)
71−assert(a == - 3e23.0 and b == 0.0)
71+assert(a == - 3e23 and b == 0.0)
72−a,b=math.modf(3e35.0)
72+a,b=math.modf(3e35)
73−assert(a == 3e35.0 and b == 0.0)
73+assert(a == 3e35 and b == 0.0)
74a,b=math.modf(- 1 / 0)
74a,b=math.modf(- 1 / 0)
75assert(a == - 1 / 0 and b == 0.0)
75assert(a == - 1 / 0 and b == 0.0)
76a,b=math.modf(1 / 0)
76a,b=math.modf(1 / 0)
@@ -82,8 +82,8 @@ assert(eqT(a,3) and eqT(b,0.0))
82a,b=math.modf(minint)
82a,b=math.modf(minint)
83assert(eqT(a,minint) and eqT(b,0.0))
83assert(eqT(a,minint) and eqT(b,0.0))
84end
84end
85−assert(math.huge > 1e31.0)
85+assert(math.huge > 1e31)
86−assert(- math.huge < - 1e31.0)
86+assert(- math.huge < - 1e31)
87assert(minint < minint + 1)
87assert(minint < minint + 1)
88assert(maxint - 1 < maxint)
88assert(maxint - 1 < maxint)
89assert(0 - minint == minint)
89assert(0 - minint == minint)
@@ -313,13 +313,13 @@ return s
313end
313end
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))
316−assert(eqT(tonumber("\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.0))
317+assert(eqT(tonumber("\45\49" .. string.rep("\48",30)),- 1e30))
318assert(eqT(tonumber("\48\120\49" .. string.rep("\48",30)),0))
318assert(eqT(tonumber("\48\120\49" .. string.rep("\48",30)),0))
319assert(minint == load("\114\101\116\117\114\110\32" .. minint)())
319assert(minint == load("\114\101\116\117\114\110\32" .. minint)())
320assert(eqT(maxint,load("\114\101\116\117\114\110\32" .. maxint)()))
320assert(eqT(maxint,load("\114\101\116\117\114\110\32" .. maxint)()))
321−assert(eqT(1e22.0,10000000000000000000000))
321+assert(eqT(1e22,10000000000000000000000))
322−assert(eqT(- 1e22.0,- 10000000000000000000000))
322+assert(eqT(- 1e22,- 10000000000000000000000))
323end
323end
324assert(tonumber(3.4) == 3.4)
324assert(tonumber(3.4) == 3.4)
325assert(eqT(tonumber(3),3))
325assert(eqT(tonumber(3),3))
@@ -432,7 +432,7 @@ assert(100.0 == 100.0 and 0.01 == 0.01)
432assert(1111111111 - 1111111110 == 1.0)
432assert(1111111111 - 1111111110 == 1.0)
433assert(1.1 == "\49\46" + "\46\49")
433assert(1.1 == "\49\46" + "\46\49")
434assert(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"))
434assert(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)
436assert(0.123456 > 0.123455)
436assert(0.123456 > 0.123455)
437assert(tonumber("\43\49\46\50\51\69\49\56") == 1.23 * 10.0 ^ 18)
437assert(tonumber("\43\49\46\50\51\69\49\56") == 1.23 * 10.0 ^ 18)
438assert(not (1 < 1) and (1 < 2) and not (2 < 1))
438assert(not (1 < 1) and (1 < 2) and not (2 < 1))
@@ -461,7 +461,7 @@ assert(eqT(10.0 % 2,0.0))
461assert(eqT(- 10.0 % 2,0.0))
461assert(eqT(- 10.0 % 2,0.0))
462assert(eqT(- 10.0 % - 2,0.0))
462assert(eqT(- 10.0 % - 2,0.0))
463assert(math.pi - math.pi % 1 == 3)
463assert(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)
465do
465do
466local i,j = 0,20000
466local i,j = 0,20000
467while i < j do
467while i < j do
@@ -526,12 +526,12 @@ end
526anan(0.0 % 0)
526anan(0.0 % 0)
527anan(1.3 % 0)
527anan(1.3 % 0)
528anan(math.huge % 1)
528anan(math.huge % 1)
529−anan(math.huge % 1e30.0)
529+anan(math.huge % 1e30)
530−anan(- math.huge % 1e30.0)
530+anan(- math.huge % 1e30)
531−anan(- math.huge % - 1e30.0)
531+anan(- math.huge % - 1e30)
532assert(1 % math.huge == 1)
532assert(1 % math.huge == 1)
533−assert(1e30.0 % math.huge == 1e30.0)
533+assert(1e30 % math.huge == 1e30)
534−assert(1e30.0 % - math.huge == - math.huge)
534+assert(1e30 % - math.huge == - math.huge)
535assert(- 1 % math.huge == math.huge)
535assert(- 1 % math.huge == math.huge)
536assert(- 1 % - math.huge == - 1)
536assert(- 1 % - math.huge == - 1)
537end
537end
@@ -575,10 +575,10 @@ assert(eqT(math.floor(minint),minint))
575assert(eqT(math.floor(minint + 0.0),minint))
575assert(eqT(math.floor(minint + 0.0),minint))
576assert(eqT(math.ceil(minint),minint))
576assert(eqT(math.ceil(minint),minint))
577assert(eqT(math.ceil(minint + 0.0),minint))
577assert(eqT(math.ceil(minint + 0.0),minint))
578−assert(math.floor(1e50.0) == 1e50.0)
578+assert(math.floor(1e50) == 1e50)
579−assert(math.ceil(1e50.0) == 1e50.0)
579+assert(math.ceil(1e50) == 1e50)
580−assert(math.floor(- 1e50.0) == - 1e50.0)
580+assert(math.floor(- 1e50) == - 1e50)
581−assert(math.ceil(- 1e50.0) == - 1e50.0)
581+assert(math.ceil(- 1e50) == - 1e50)
582for _,p in pairs({31,32,63,64})
582for _,p in pairs({31,32,63,64})
583do
583do
584assert(math.floor(2 ^ p) == 2 ^ p)
584assert(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)
632checkerror("\118\97\108\117\101\32\101\120\112\101\99\116\101\100",math.min)
632checkerror("\118\97\108\117\101\32\101\120\112\101\99\116\101\100",math.min)
633assert(eqT(math.max(3),3))
633assert(eqT(math.max(3),3))
634assert(eqT(math.max(3,5,9,1),9))
634assert(eqT(math.max(3,5,9,1),9))
635−assert(math.max(maxint,1e61.0) == 1e61.0)
635+assert(math.max(maxint,1e61) == 1e61)
636assert(eqT(math.max(minint,minint + 1),minint + 1))
636assert(eqT(math.max(minint,minint + 1),minint + 1))
637assert(eqT(math.min(3),3))
637assert(eqT(math.min(3),3))
638assert(eqT(math.min(3,5,9,1),1))
638assert(eqT(math.min(3,5,9,1),1))
639assert(math.min(3.2,5.9,- 9.2,1.1) == - 9.2)
639assert(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.0,minint) == - 1e61.0)
641+assert(math.min(- 1e61,minint) == - 1e61)
642assert(eqT(math.min(maxint,maxint - 1),maxint - 1))
642assert(eqT(math.min(maxint,maxint - 1),maxint - 1))
643assert(eqT(math.min(maxint - 2,maxint,maxint - 1),maxint - 2))
643assert(eqT(math.min(maxint - 2,maxint,maxint - 1),maxint - 2))
644end
644end
@@ -737,7 +737,7 @@ counts[bit + 1]=counts[bit + 1] + 1
737end
737end
738end
738end
739totalrounds=totalrounds + rounds
739totalrounds=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
741goto doagain
741goto doagain
742end
742end
743local expected = (totalrounds / randbits / 2)
743local expected = (totalrounds / randbits / 2)
@@ -780,7 +780,7 @@ if not testnear(counts[i],expected,0.1) then
780goto doagain
780goto doagain
781end
781end
782end
782end
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))
784end
784end
785do
785do
786local count = {0,0,0,0,0,0}
786local count = {0,0,0,0,0,0}
zod/luau/res/lua/cycled/nextvar.lua+7−7
@@ -679,7 +679,7 @@ end
679assert(a == 1)
679assert(a == 1)
680a=0
680a=0
681;
681;
682−for i = 10000, 1e4.0, - 1
682+for i = 10000, 1e4, - 1
683do
683do
684a=a + 1
684a=a + 1
685end
685end
@@ -695,7 +695,7 @@ end
695assert(a == 0)
695assert(a == 0)
696a=0
696a=0
697;
697;
698−for i = 9999, 1e4.0, - 1
698+for i = 9999, 1e4, - 1
699do
699do
700a=a + 1
700a=a + 1
701end
701end
@@ -735,7 +735,7 @@ end
735assert(a == 1)
735assert(a == 1)
736a=0
736a=0
737;
737;
738−for i = 1e6.0, 1e6.0, - 1
738+for i = 1e6, 1e6, - 1
739do
739do
740a=a + 1
740a=a + 1
741end
741end
@@ -751,7 +751,7 @@ end
751assert(a == 0)
751assert(a == 0)
752a=0
752a=0
753;
753;
754−for i = 99999, 1e5.0, - 1.0
754+for i = 99999, 1e5, - 1.0
755do
755do
756a=a + 1
756a=a + 1
757end
757end
@@ -840,7 +840,7 @@ end
840assert(c == 10)
840assert(c == 10)
841c=0
841c=0
842;
842;
843−for i = 10, 1e-3.0, - 1
843+for i = 10, 1e-3, - 1
844do
844do
845checkint(i)
845checkint(i)
846end
846end
@@ -895,11 +895,11 @@ end
895checkint(i)
895checkint(i)
896end
896end
897assert(c == 10)
897assert(c == 10)
898−for i = math.mininteger, - 1e101.0
898+for i = math.mininteger, - 1e101
899do
899do
900assert(false)
900assert(false)
901end
901end
902−for i = math.maxinteger, 1e101.0, - 1
902+for i = math.maxinteger, 1e101, - 1
903do
903do
904assert(false)
904assert(false)
905end
905end
zod/luau/res/lua/cycled/strings.lua+1−1
@@ -273,7 +273,7 @@ s=string.format("\37\65",n)
273assert(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"))
273assert(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"))
274assert(tonumber(s) == n)
274assert(tonumber(s) == n)
275end
275end
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})
277do
277do
278matchhexa(n)
278matchhexa(n)
279end
279end
zod/luau/res/lua/cycled/tpack.lua+2−2
@@ -129,7 +129,7 @@ else
129assert(pack("\102",24) == pack("\62\102",24))
129assert(pack("\102",24) == pack("\62\102",24))
130end
130end
131print("\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")
131print("\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})
133do
133do
134assert(unpack("\110",pack("\110",n)) == n)
134assert(unpack("\110",pack("\110",n)) == n)
135assert(unpack("\60\110",pack("\60\110",n)) == n)
135assert(unpack("\60\110",pack("\60\110",n)) == n)
@@ -137,7 +137,7 @@ assert(unpack("\62\110",pack("\62\110",n)) == n)
137assert(pack("\60\102",n) == pack("\62\102",n):reverse())
137assert(pack("\60\102",n) == pack("\62\102",n):reverse())
138assert(pack("\62\100",n) == pack("\60\100",n):reverse())
138assert(pack("\62\100",n) == pack("\60\100",n):reverse())
139end
139end
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})
141do
141do
142assert(unpack("\60\102",pack("\60\102",n)) == n)
142assert(unpack("\60\102",pack("\60\102",n)) == n)
143assert(unpack("\62\102",pack("\62\102",n)) == n)
143assert(unpack("\62\102",pack("\62\102",n)) == n)