Data update

This commit is contained in:
Ingy döt Net 2023-08-01 14:30:30 -07:00
parent 07c7092a52
commit 61b93a2cd1
313 changed files with 6160 additions and 346 deletions

View file

@ -0,0 +1,12 @@
function isLongYear (y)
local function p (y)
local f = math.floor
return (y + f(y/4) - f(y/100) + f(y/400)) % 7
end
return p(y) == 4 or p(y - 1) == 3
end
print("Long years in the 21st century:")
for year = 2001, 2100 do
if isLongYear(year) then io.write(year .. " ") end
end

View file

@ -25,8 +25,8 @@ end = z
comment
The simplest of several possible tests is that
any calendar year starting or ending on a
Thursday is "long", i.e., has 53 ISO weeks
any ISO year starting or ending on a
Thursday is "long", i.e., spans 53 weeks
end
function islongyear(yr = integer) = integer
var thursday, result = integer