GNOME Bugzilla – Bug 491954
The documentation of the interface "g_date_is_leap_year" is incomplete
Last modified: 2007-11-10 01:58:24 UTC
Documentation Section: http://library.gnome.org/devel/glib/unstable/glib-Date-and-Time-Functions.html#g-date-is-leap-year Returning TRUE if the year is a leap year. Correct version: Returning TRUE if the year is a leap year. Leap year is every year divisible by 4 unless that year is divisible by 100. If it is divisible by 100 it would be a leap year only if that year is also divisible by 400. Other information: The detailed issue description can be found at: http://linuxtesting.org/results/report?num=D0012
In what sense is the current short and concise documentation "incomplete"? The purpose of the documentation is not to teach people how leap years are defined in the Gregorian calendar. Surely, to make it "complete", we would have to include the whole Wikipedia article on leap years? One could also say that your "complete" version is equally incomplete, as it doesn't say that the function returns if the year is not a leap year... Anyway, sorry for being such a grumpy old man.
Yes, I do agree that there is no reason teaching people who read this documentation the definition of the leap year. This is just a suggestion, to give the reader a hint about the leap year definition, as it is done for example in the description of the interfaces "g_date_get_julian" or "g_date_get_monday_weeks_in_year". In the case term "incomplete" seems to be exaggerated, I could close/reopen this issue with title "Suggestion to enhance the description of the interface 'g_date_is_leap_year' with leap year definition". I think there will be a number of readers (including myself) that do not remember that for the leap year "If it is divisible by 100 it would only be a leap year if that year was also divisible by 400.", and could treat the outcome of the interface in such cases incorrectly.
I've made it a footnote.