Validating a leap year
I have questions regarding checking if a year is a leap year and a new error message i have been getting. I suspect i am overwriting the variable somehwere in my logic.I have done research to determine what this means and possible problems in the code and how to fix them, but I cannot for my life figure out what is causing the problem in my code. Please help because if have listened to every AC/DC album twice over while working on this code and i shouldnt have gray hair at 16 years old. The if statement checks if the year is a multiple of 4 but isn’t a multiple of 100 or if it is a multiple of 400 (not every year that is a multiple of 4 is a leap year).
Similarly, 1200, 1600, 2000, 2400 are leap years but, 1700, 1800, 1900 etc are not.
In leap years, February has 29 days, so the DATE function will simply return the date February 29 of the year.
In non-leap years however, DATE will return the date March 1 of the year, because there is no 29th day and DATE simply rolls the date forward into the next month.
In particular the southern hemisphere and equatorial region may show a substantial derivation from these results - assuming that climate is a determining factor.
Furthermore, there's the issue of "elective birth" (touched upon by the authors of - in poorer regions of the globe, I would expect a different distribution of births, simply because (non-emergency-) cesarian sections or induced birth are rarer than in developed countries. Using the American data, assuming ~71 Million births (rough graphed mean * 366) and 46.000 births on February 29ths, not correcting for the distribution of leap years in the data, because the precise period is not indicated, I arrive at a probability of around ~0.000648.