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)
[edit] Formula OK
It's important to use the correct values for month, year, century
For example:
Year means the 2 digit year between 00 and 99.
Century means the 2 digit century.
The months are numbered from 3 for March to 12 for December.
13 for Jan and 14 for Feb of the prior year (which impacts the century)
For example 29 Feb 2000 has Zeller values of:
Month = 14, 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 * (14 + 1)/10 + 99 + 99/4 + 19/4 + 19 DOW = 28MOD7 + 39MOD7 + 1 + 24MOD7 + 4MOD7 + 19MOD7 DOW = 0 + 4 + 1 + 3 + 4 + 4 DOW = 16MOD7 = 2 Monday (Saturday = 0)
Have Fun,
Brooke Clarke brooke@pacific.net updated 1 June 2007
—Preceding unsigned comment added by BrookeClarke (talk • contribs)
[edit] first sunday
2
[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)
Difference between two calendars:
The article claimed the Julian calendar was "offset from the Gregorian calendar by a fixed number of days," which isn't quite correct. It's offset by a fixed number of days each century, but that "fixed" number usually changes when the century changes. I modified the article to clarify this. --MiguelMunoz (talk) 20:56, 2 March 2008 (UTC)
[edit] Avoiding negative numbers
The article makes this ambiguous claim:
Both of these differences can be accounted for by replacing the term
with the term 5 − J, or 5 + 6J to avoid negative numbers.
Huh? I'm not sure when I'm supposed to replace what, and neither of these looks right. To avoid negative numbers, the -J may be replaced with +6J and the -2J may be replaced with +5J. The J/4 term doesn't need to be touched. Also, this point doesn't belong in an explanation of the difference between the two formulas. I also don't know what is meant by "both these differences..." --MiguelMunoz (talk) 06:23, 19 February 2008 (UTC)
[edit] Examples
Joe Kress: Why did you remove the examples? The transition from February to March is a major point of confusion, and I put in two good examples to clarify the point. If you have a problem with them, let's discuss it here. --MiguelMunoz (talk) 17:19, 20 February 2008 (UTC)
- I have no idea what happened, but I had no intention of removing the examples. I am readding them with some wikification. — Joe Kress (talk) 23:27, 20 February 2008 (UTC)
- Okay. That's cool. Thanks for putting them back. --75.5.4.210 (talk) 07:42, 21 February 2008 (UTC)
[edit] External links
The link "How to Memorize Zeller's Congruence" is not about Zeller's Congruence, and should be removed. 82.163.24.100 (talk) 23:47, 26 February 2008 (UTC)
with the term 
