▲ 272 ▼ I'm new to using Ruby and this tickled me pink (lemmy.ml) submitted 1 year ago by sunshine@lemmy.ml to c/programmerhumor@lemmy.ml 72 comments fedilink hide all child comments
[–] Crashumbc@lemmy.world 2 points 1 year ago (3 children) Yes, and I have no idea.. permalink fedilink source parent hideshow 3 child comments replies: [–] Kazumara@discuss.tchncs.de 5 points 1 year ago* (last edited 1 year ago) (2 children) Leap years are each fourth year, except each hundredth year, except each thousandth fourhundredth year. 1896 leap year 1900 not leap year 1904 leap year ... 1996 leap year 2000 leap year 2004 leap year ... 2096 leap year 2100 not leap year 2104 leap year Then you just arrange the 10 year window in different positions to overlap 1 to 3 leap years to reveal the three outcomes of the bug. - / - - - / - - - / - - / - - - / - - - - - 0 - - - / - - - - is a normal year, / is a leap year, 0 is an exceptional non-leap year. permalink fedilink source parent hideshow 2 child comments replies: [+] sexybenfranklin@ttrpg.network 3 points 1 year ago (1 child) [deleted] permalink fedilink source parent hideshow 1 child comment replies: [–] Kazumara@discuss.tchncs.de 3 points 1 year ago Ahh right! Thanks for correcting me. Now that you mention it I remember too. It also makes sense, a year is roughly 365.2425 days long. Add 0.25 (one out of four), subtract 0.01 (one out of hundred), add another 0.0025 (2.5 out of thousand which is 1 out of 400) permalink fedilink source parent
[–] Kazumara@discuss.tchncs.de 5 points 1 year ago* (last edited 1 year ago) (2 children) Leap years are each fourth year, except each hundredth year, except each thousandth fourhundredth year. 1896 leap year 1900 not leap year 1904 leap year ... 1996 leap year 2000 leap year 2004 leap year ... 2096 leap year 2100 not leap year 2104 leap year Then you just arrange the 10 year window in different positions to overlap 1 to 3 leap years to reveal the three outcomes of the bug. - / - - - / - - - / - - / - - - / - - - - - 0 - - - / - - - - is a normal year, / is a leap year, 0 is an exceptional non-leap year. permalink fedilink source parent hideshow 2 child comments replies: [+] sexybenfranklin@ttrpg.network 3 points 1 year ago (1 child) [deleted] permalink fedilink source parent hideshow 1 child comment replies: [–] Kazumara@discuss.tchncs.de 3 points 1 year ago Ahh right! Thanks for correcting me. Now that you mention it I remember too. It also makes sense, a year is roughly 365.2425 days long. Add 0.25 (one out of four), subtract 0.01 (one out of hundred), add another 0.0025 (2.5 out of thousand which is 1 out of 400) permalink fedilink source parent
[+] sexybenfranklin@ttrpg.network 3 points 1 year ago (1 child) [deleted] permalink fedilink source parent hideshow 1 child comment replies: [–] Kazumara@discuss.tchncs.de 3 points 1 year ago Ahh right! Thanks for correcting me. Now that you mention it I remember too. It also makes sense, a year is roughly 365.2425 days long. Add 0.25 (one out of four), subtract 0.01 (one out of hundred), add another 0.0025 (2.5 out of thousand which is 1 out of 400) permalink fedilink source parent
[–] Kazumara@discuss.tchncs.de 3 points 1 year ago Ahh right! Thanks for correcting me. Now that you mention it I remember too. It also makes sense, a year is roughly 365.2425 days long. Add 0.25 (one out of four), subtract 0.01 (one out of hundred), add another 0.0025 (2.5 out of thousand which is 1 out of 400) permalink fedilink source parent