> On 17. Dec 2024, at 16:44, Pablo Rodriguez via ntg-context
> <ntg-context@ntg.nl> wrote:
>
> I guess Lua code would be easier to write, but I cannot get how each
> Easter Sunday may be computed.
Here you go:
a = math.fmod(year,19)
b = math.floor(year / 100)
c = math.fmod(year,100)
d = math.floor(b / 4)
e = math.fmod(b,4)
f = math.floor((b + 8) / 25)
g = math.floor((b - f + 1) / 3)
h = math.fmod((19 * a + b - d - g + 15),30)
i = math.floor(c / 4)
k = math.fmod(c,4)
L = math.fmod((32 + 2 * e + 2 * i - h - k),7)
m = math.floor((a + 11 * h + 22 * L) / 451)
eastersundaymonth = math.floor((h + L - 7 * m + 114) / 31)
eastersunday = math.fmod((h + L - 7 * m + 114),31) + 1
Thomas
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the
Wiki!
maillist : ntg-context@ntg.nl /
https://mailman.ntg.nl/mailman3/lists/ntg-context.ntg.nl
webpage : https://www.pragma-ade.nl / https://context.aanhet.net (mirror)
archive : https://github.com/contextgarden/context
wiki : https://wiki.contextgarden.net
___________________________________________________________________________________