Talk:Leap year

From Wikipedia, the free encyclopedia
Latest comment: 18 June by Ponyo in topic Protected edit request on 18 June 2025
Jump to navigation Jump to search

<templatestyles src="Module:Message box/tmbox.css"/><templatestyles src="Talk header/styles.css" />

Script error: No such module "Check for unknown parameters".Script error: No such module "Check for deprecated parameters".

User:MiszaBot/config Script error: No such module "English variant notice". Template:On this day Template:WikiProject banner shell Template:Top 25 Report

  1. REDIRECT Template:Press

Template:Redirect template

section Algorithm: adding Excel example

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

Changing content

This edit: https://en.m.wikipedia.org/w/index.php?title=Leap_year&diff=prev&oldid=1230828637

was reverted for some unknown reason. How could we handle this and keep it as the current form, with the example as Halloween and not Christmas? 2601:C6:D200:E9B0:99C2:CF40:D108:35E0 (talk) 00:18, 25 June 2024 (UTC)Reply

The person wanting a change needs to justify their proposal. It is not reasonable to expect other to justify reverting arbitrary changes. Johnuniq (talk) 00:22, 25 June 2024 (UTC)Reply
A lot of people in the world have no idea what, and when, Halloween is. - Arjayay (talk) 09:21, 25 June 2024 (UTC)Reply
So how about we compromise and change the example to a very specific day? 2601:C6:D200:E9B0:A0E3:7891:AA06:7FAE (talk) 16:39, 25 June 2024 (UTC)Reply
I’ll go make that edit. 2601:C6:D200:E9B0:A0E3:7891:AA06:7FAE (talk) 16:40, 25 June 2024 (UTC)Reply
The edit has now been made. 2601:C6:D200:E9B0:A0E3:7891:AA06:7FAE (talk) 16:43, 25 June 2024 (UTC)Reply
Maybe we could remove the example all together as a neutral compromise? I’ll make that edit now. 2601:C6:D200:E9B0:A0E3:7891:AA06:7FAE (talk) 16:50, 25 June 2024 (UTC)Reply
I have reverted your totally undiscussed removal, made with an edit summary of "as discussed on talk page". You suggested it and immediately did it before anyone else had had a chance to discuss it. - Arjayay (talk) 21:04, 25 June 2024 (UTC)Reply
If 14 Feb 2024 already passed, and naming holidays would cause an argument, it would make sense to specifically mention March 1st as a notable example, as that day immediately follows February 29 in leap years.Allan Bao (talk) 14:24, 15 July 2024 (UTC)Reply

Protected edit request on 18 June 2025

Script error: No such module "protected edit request". Change civilization to civilisation (article uses en-GB) 2600:1005:B0CD:EDFD:714C:803A:4206:65D (talk) 22:20, 18 June 2025 (UTC)Reply

File:Yes check.svg Done - Ponyobons mots 22:25, 18 June 2025 (UTC)Reply