Discombobulated: To be thrown into a state of confusion.

Sunday, October 24, 2004

Integer calculation

Right, here's an integer calculation, first person to tell me what it's calculating will be most impressive!

c = y / 100 n = y - 19 * ( y / 19 ) k = ( c - 17 ) / 25 i = c - c / 4 - ( c - k ) / 3 + 19 * n + 15 i = i - 30 * ( i / 30 ) i = i - ( i / 28 ) * ( 1 - ( i / 28 ) * ( 29 / ( i + 1 ) ) * ( ( 21 - n ) / 11 ) ) j = y + y / 4 + i + 2 - c + c / 4 j = j - 7 * ( j / 7 ) l = i - j m = 3 + ( l + 40 ) / 44 d = l + 28 - 31 * ( m / 4

6 comments:

Anonymous said...

It calculates the date of Easter d/m/y.

You're missing a parenthesis at the end too :-)

Matt

Mia said...

How on earth could you know that? I'm impressed!

Anonymous said...

Easter?

-shaky

Anonymous said...

Oh, Matt said that already.

Mia said...

Yup, Easter it is.

Simon said...

You all need to get out more.