Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

Jump to content

Talk:Leap year

Page contents not supported in other languages.
Add topic
From Wikipedia, the free encyclopedia
Latest comment: 9 months ago by ~2025-41294-19 in topic Folk traditions: women can ask men to dance

section Algorithm: adding Excel example

[edit]
Algorithm

The following pseudocode determines whether a year is a leap year or a common year in the Gregorian calendar (and in the proleptic Gregorian calendar before 1582). The year variable being tested is the integer representing the number of the year in the Gregorian calendar, and the tests are arranged to dispatch the most common cases first. Care should be taken in translating mathematical integer divisibility into specific programming languages.

if (year is not exactly divisible by 4) then (it is a common year)
else
if (year is not exactly divisible by 100) then (it is a leap year)
else
if (year is not exactly divisible by 400) then (it is a common year)
else (it is a leap year)

Excel

This algorithm translates into Excel like this, whereas year stands for the cell which refers to the input cell:

=IF(NOT((year/4=TRUNC(year/4)));"common year";IF(NOT((year/100=TRUNC(year/100)));"leap year";IF(NOT((year/400=TRUNC(year/400)));"common year";"leap year")))
or reversed, more simplified:
=IF((year/400=TRUNC(year/400));"leap year";IF((year/100=TRUNC(year/100));"common year";IF((year/4=TRUNC(year/4));"leap year";"common year"))

-- 23:17, 20 August 2015 31.151.83.20

Fine, but an Excel formula is not the sort of thing WP would ordinarily supply. The shape of the algorithm in pseudo-code is appropriate, but translations into specific languages generally not. -- Elphion (talk) 17:51, 26 August 2015 (UTC)Reply

Folk traditions: women can ask men to dance

[edit]

I recall from my younger years that at dances, women considered leap years times when they could ask men to dance (though men were not excluded from asking women to do so). Here are some Google Books links that support that. (They also refer to women inviting men to dances; but the dances I went to, at colleges, weren't one's where people invited others.) https://www.google.com/books?id=gkhFR-P4HagC&dq=%22leap+year%22+ask+dance&pg=RA4-PA98 https://books.google.com/books?id=pGB6EAAAQBAJ&pg=PT139 (5th paragraph), https://books.google.com/books?id=LElr_lnlEAIC&dq=%22to+the+leap+year%22&pg=RA2-PA681 ~2025-41294-19 (talk) 18:56, 29 December 2025 (UTC)Reply