💾 Archived View for midnight.pub › replies › 4961 captured on 2023-03-20 at 21:12:20. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2022-07-16)
-=-=-=-=-=-=-
I've done the math behind this after staring at a clock and having the same question while in high school. Unlike your code, however, I'd never considered 5:59:59 as a possibility. In a subtle way, I think it's a demonstration that 0.999... == 1.
It's amazing what pure boredom can do, hah. As a teen at an airport, I once proved the area of a circle by taking the angle of packed triangles to the limit of 0. Not perfect maths mind you, but I was chuffed at the time nonetheless.
As for 5:59:59, the problem occurs because 0 and 360 are both possible values instead of me excluding one from the other. I wasn't sure how to do that elegantly, so I just left it and walked away whistling.
/ahem/ "An exercise for the reader" /ahem/