Most Votes
- What's the highest dollar price will Bitcoin reach in 2024? Posted on February 28th, 2024 | 8477 votes
- Will ByteDance be forced to divest TikTok Posted on March 20th, 2024 | 7123 votes
Most Comments
- What's the highest dollar price will Bitcoin reach in 2024? Posted on March 20th, 2024 | 68 comments
- Will ByteDance be forced to divest TikTok Posted on March 20th, 2024 | 20 comments
Re:Missing Option (Score:5, Informative)
Except (YYYY % 4) is not how you calculate leap years.
End-of-century years that are exactly divisible by 4 but not by 400 are common years. 1800, 1900 or 2100 are not leap years, while 2000 was a leap year.
Re:A Very Special Leap Day for comics readers (Score:5, Informative)
It gets even more interesting.
Leap years aren't quite periodic under the Gregorian calendar, since every hundredth year isn't a leap year, but every four-hundredth is. This also makes the distribution of days uneven. There are actually more Sunday February 29s than Thursday February 29s. There are 14 Wednesdays in the 400-year cycle, so it happens on average once every 28.57 years.
Utterly meaningless, but interesting nonetheless.
Re:There's no way (Score:2, Informative)
Well, it doesn't neccesarily have to be your own birthday.
I chose that option because my son turns four today on his first birthday.
Leap day is NOT today (Score:4, Informative)
Rename Feb 29 as "contractors' day" (Score:4, Informative)
Salaried staff get paid by the month - so they effectively work on Feb 29 for free. Contractors get paid by the day or by the week, and therefore get an extra days pay for their extra days work.
Maybe, in order to celebrate, IT staff everywhere should get their nearest "consultant" to pay for lunch today - so long as they have a cost code to bill the time to.
Re:Missing Option (Score:5, Informative)
It's amazing how much software ends up released with no, or wrong, leap year calculations. You'd think that they could get ordinary (YYYY % 4) right, but Nooooo.
Hah, today it turned out that the programmers of the new information system for my country's public service were incapable after this fashion as well. No one can get a new ID card or a passport, since the identity card component of the IS went down, nation-wide.
Since this is not the first issue with the new software, the programmers of the old contractor must be rolling on the floor laughing. The new contractor clearly managed outbribe them, but the money should have been better spent on more capable programmers. The public is already in steaming rage; many of them have already happened to be greatly inconvenienced at their last visit to this or that government office, since a large part of the information system has been at a rather low level of nation-wide operational availability since its introduction in the beginning of the year. But, boy, this leap day blunder could really be the last drop of patience for the common citizen.
Girls proposing (Score:5, Informative)
By old Nordic tradition, on leap day girls can propose to men (and still follow tradition!). Also men are not allowed to say no, and have to pay damages if they do. 12 pair of gloves in Denmark, or a new dress in Finland, etc.
Pirates of Penzance Day (Score:4, Informative)
That's what this day means to me - a major plot point is that the main character was born on Feb 29.
Re:Missing Option (Score:4, Informative)
The code I've used (C++) is:
bool isleap = year % 4 ? false : year % 100 ? true : year % 400 ? false : true;
Re:Leap day is NOT today (Score:5, Informative)
While it's true that the 24th was the traditional leap day, this explanation of why is, shall we say, orthogonal to reality. If a full day of error accumulated so early in the year, the one day every four years intercalation would be much more wrong than it actually is; if there were no leap years, a full day of error would accumulate a few minutes before midnight on Dec. 31 of the fourth year.
In fact, the reason is that in the ancient Roman calendar the days of each month were counted relative to the kalends (first day of the month), ides (fixed day about mid-month, the 15th in March, May, July and October, and the 13th in other months) and nones (two each month mid-way between ides and kalends). Thus, the Romans would have called Feb. 24 in a common year ante diem sextum Kalendas Martias (the sixth day before the Kalends of March; in Latin one counts from one in such contexts, so Feb. 28 would have been ante diem secundum Kalendas Martias in a common year). See Wikipedia on months of the Roman calendar [wikipedia.org].
After Julius Caesar's calendar reform in 46 B.C., the leap day was inserted after the 24th, and called ante diem bis sextum Kalendas Martias ("second sixth day before the Kalends of March"); thus, the purpose of designating a particular day as the leap day at all becomes apparent in regards to the Roman calendar. At some point later on [wikipedia.org], the bis was attached to the first day of the two sixths (the 24th), leading to the custom of regarding the 24th as the leap day and the alternate terms 'bissextile day' and 'bissextile year' [wikipedia.org].
Re:Missing Option (Score:3, Informative)
static int __isleap(long year)
{
return (year) % 4 == 0 && ((year) % 100 != 0 || (year) % 400 == 0);
}
I think it was originally implemented as a #define. Hence the remaining parenthesis around 'year'?