Talk:Zeller's congruence
From Wikipedia, the free encyclopedia
The algorithm is ambiguous. It should be expanded out to actually discuss what it does, especially since it isn't actually using the formula. The German ( http://de.wikipedia.org/wiki/Zellers_Kongruenz) page gives a much better explanation (from what little german I can understand).
Contents |
[edit] Accuracy
The algorithm as given does not seem to be accurate: in particular, how does it handle the transition from February to March?
- The if m < 3 branch handles the transition from February to March, essentially using the trick of considering years to start on March 1. The algorithm seems correct (for the Gregorian calendar) and unambiguous to me. Note both the algorithm and the formulas are using the notation ⌊x⌋ for the floor function of x. Ray Spalding 03:34, 19 October 2005 (UTC)
- That is correct, but I should explain this in the article as well. --R.Koot 08:41, 19 October 2005 (UTC)
- The example code given does not appear to match the mathematical formula given. Why not?
- It is based on a fucntion in a C run-time library and it contains some optimizations. There is only one variable for the year and century, and floor((m+1)26/10) is precalculated, and the rather untransparent 'year start at march' trick. --R.Koot 19:42, 8 November 2005 (UTC)
- The example code given does not appear to match the mathematical formula given. Why not?
- That is correct, but I should explain this in the article as well. --R.Koot 08:41, 19 October 2005 (UTC)
+++++++++++++++ Formula Wrong ++++++++++++++++++ The formulas shown are wrong. The term containing the month should be (26*M-1)/10. Also note that the terms used to describe the formula are not the same as their common meaning. For example Year means the 2 digit year between 00 and 99, not the for digit year. The months are numbered from 1 for March to 10 for December, 11 for Jan and 12 for Feb. If the month is Jan or Feb the year gets decrimented by 1 and if approiate the century. The century is the higher two digits of the year. So for example 28 Feb 2000 has Zeller values of: Month = 12, Year = 99, Century = 19 then DOW = (Day of Month) + (26*Zeller_Month-1)/10 + Z_year + Z_Year/4 + Z_Cent/4 +5* Z_Cent DOW = 28 + ( 26 * 12 - 1) /10 + 99 + 99/4 + 19/4 + 19 DOW = 28MOD7 + 31MOD7 + 1 + 24MOD7 + 4MOD7 + 19MOD7 DOW = 0 + 3 + 1 + 3 + 4 + 4 DOW = 15MOD7 = 1 Monday (Sunday = 0) A good explanation is under the title Other Implementations for Day-of-Week at: http://www.merlyn.demon.co.uk/zeller-c.htm#OIW
Have Fun,
Brooke Clarke brooke@pacific.net
[edit] first sunday
4
[edit] Julian Algorithm
The algorithm also does not include a Julian calendar variant. While optimization of the month term is desirable in an implementation, it would probably be better to expand this out in an article on Zeller's Congruence. The optimization could also be shown, but it should be labeled as such. I'd also like to see some logic included to select which calendar is used based on the date. Farinata 16:16, 21 June 2006 (UTC)
-
- An article on Zeller's Congruence should present primarily what Zeller wrote, and show separately any optimisations based on Zeller.
-
- Selection logic is at best difficult, as the change date varied with location and dates on either Calendar may be wanted for when the other was, or neither were, in use. Negative years should be considered, if only to establish any limits to implementations.
-
- 82.163.24.100 23:40, 9 March 2007 (UTC)
[edit] Various Comment
Various Comment
Formula
For the avoidance of error, the formulae should be given primarily with respectively +5J & +6J. Zeller included those, albeit secondarily, in the 1882 paper.
A note might be added on the conversion between Zeller's day-of-week numbering and that in ISO 8601 - one just exchanges 0 & 7.
Algorithm
That is NOT Zeller's algorithm. In the 1882 1883 1885 & 1886 papers, Zeller had no lists of numbers or names. The algorithms in Formula are easily enough coded.
Since thare are computer languages which look like each other but differ in detail, any computer code presented should have the language in which it was written & tested, including the version, stated.
References
All four of Zeller's relevant papers should be listed.
Overall
Zeller's papers were as much on Date-of-Easter as Day-of-Week. That derserves a mention in both the "Congruence" and the "Zeller" pages (and in the "Easter" pages proper).
The "Zeller" page has an external link, mislabelled "Comprehensive". The Zeller Society has (or had) a much more comprehensive document.
The Slovenian page "Algoritem za dan v tednu" has a formula not taken directly from Zeller.
Comment about this Wiki page applies also, I think, to "Congruencia de Zeller" - which seems to lack a sidebar link to this English page.
82.163.24.100 16:39, 3 February 2007 (UTC)