The Date Hack
The PrimeTime
Resumen
This video breaks down the technical challenge of calculating the day of the week from a day count since the epoch. It explains how to move from simple modulo arithmetic to more efficient formulas, specifically exploring the logic behind handling negative numbers. The guide navigates through different algorithmic approaches, culminating in the fascinating use of bitwise operations and two's complement arithmetic, which allow computers to determine the day of the week with incredible speed and efficiency.
Temas tratados
- The basic modulo 7 formula
- Adjusting for the epoch offset
+5 temas más (contenido completo al seguir el canal)
Extracto de la transcripción
There are two hard problems when it comes to computer science. That's of course is naming things and getting a date. Now I know from great personal struggles the difficulty of of course getting a date and I thought I would help guide you through the process. You know, really teach those young budding computer scientists and vibe coders what exactly it takes to get a date and go on and live a happily married life. Now of course I'm talking about the fastest way to calculate the day of the week. Now this is one of the most amazing articles you have to see and we will first derive like the basic formula and then we'll see like a really cool just coincidental way to be able to make this work out and then the most insane bitwise operation that even thinking about it just gets me juiced. And I made a beautiful presentation for this. And you guys are always asking me for some technical video so…