Mike’s Nearly Non-Euclidean Leap Year Lister
ContactAboutArticlesLinksToggle Color
[medal]
Mike’s Nearly Non-Euclidean Leap Year Lister

Michael Kaarhus
The Feast of St. Thomas Aquinas, 2023.
Edited on the Feasts of St. John Bosco and the Presentation, 2023
Edited 18:35 June 13, 2023
Shangri-La

This page calculates and displays all Gregorian leap years from start_year to end_year. My script does at most eight Euclidean remainders, none of which are in a loop. It is nearly non-Euclidean and faster than a script deserves to be.

All years here are Anno Domini (AD). In theory, end_year can be as large an integer as javascript will work with. However, my script stores its output in a list, and my browser tab crashes if the list is too large for it to handle. To prevent that, I set an upper_limit for end_year.

The initial value of upper_limit = 100,004.
Hitting upper_limit ++ increases upper_limit by 100,000 to as large as 1,000,004, and sets that as end_year.
Hitting upper_limit -- decreases upper_limit by 100,000, and sets that as end_year.

end_year must be at least four years larger than the start_year. Both years must be in decimal (numerals 0-9 only).
start_year must be ≥ 1582.

Shorthand to make start_year = 1582: enter 1 in the start_year box.
Shorthand to make end_year = upper_limit: enter 1 in the end_year box.

See you in 10,000 years, bright shining as the Sun!

My old machine has no problem running this script at the maximum settings: end_year = 1,000,004, start_year = 1582, and printing the resulting 242,118 leap years. However, people could be using older browsers, or doing other, CPU-intensive tasks in other tabs or windows. And of course some might edit the code to increase upper_limit. In those cases, the browser tab or window could crash. Therefore, out of an abundance of caution,

WARNING:
Use at your own risk! Michael Kaarhus will not be held liable for any crash, damage or loss, that may result from running this script.
 I recommend that this script be run with no other browser tabs or windows open, or at least when no important tasks are being done in other browser tabs or windows. 

Copyright © 2023 Michael Kaarhus

Ω
Page last modified on Wednesday, 02-Aug-2023 06:16:16 PDT
ContactAboutArticlesLinksTopPrivacySitemapToggle Color
NTAS Advisory
Main Page