A faster way to calculate the day-of-the-week
benjoffe.com · 5,787 words · saved by 1 readers
A range of fast modulus techniques that beat compiler output
A range of fast modulus techniques that beat compiler output 17 August 2026 Converting a day-count ("rata-die") to the day-of-the-week (“weekday”) sounds like it should be so trivial, that there's almost nothing to say about it. But, as it turns out, when we look under the hood, this is a surprisingly complex problem. Throughout this article I will present a range of really fast functions to solve this problem, tuned for different use cases (throughput vs latency, different platforms etc.). Each (full range 32-bit algorithm) outperforms existing solutions, and many have a latency of just…
saved by
related reading
- VROOM: Accelerating (Almost All) Number-Theoretic Cryptography Using Vectorization and the Residue Number Systemeprint.iacr.org
- Day Of The Week Analysis in SQL - Issue 39dataanalysis.substack.com
- Fastest Possible Processing Speed of the Human Brain – World Mental Calculationworldmentalcalculation.com
- Competitive Programmer's Handbookcses.fi
- Algorithms for Modern Hardware - Algorithmicaen.algorithmica.org
- Day 14:[離散數學]同餘(Mod)是什麼? - iT 邦幫忙::一起幫忙解決難題,拯救 IT 人的一天ithelp.ithome.com.tw
- The Aggregate Magic Algorithmsaggregate.org
- Binary Exponentiation - Algorithms for Competitive Programmingcp-algorithms.com
- Numbers Every Programmer Should Know By Yearcolin-scott.github.io
- LeetCode-Solutions/0001-1000.md at master · Holychung/LeetCode-Solutionsgithub.com
- Arithmetic Game – Online Speed Drillarithmetic.zetamac.com
- 9.9. 时间/日期函数和操作符postgres.cn