Closed klao closed 10 years ago
For fromOrdinalDate the change is trivial: just using bit shifts instead of dividing by 4.
fromOrdinalDate
For toOrdinalDate we do a completely different computation, which requires (about) 2 divisions instead of 4.
toOrdinalDate
Also adding appropriate benchmarks and tests, and making the tests a bit more thorough (100 iterations is not enough to catch subtle bugs).
(Apologies) I've chopped your commits up and shuffled them around a little, but they're basically picked. Thanks!
(Further apologies for my tardiness…)
For
fromOrdinalDate
the change is trivial: just using bit shifts instead of dividing by 4.For
toOrdinalDate
we do a completely different computation, which requires (about) 2 divisions instead of 4.Also adding appropriate benchmarks and tests, and making the tests a bit more thorough (100 iterations is not enough to catch subtle bugs).