97jaz/gregor

bug: seconds-between breaks contract

Closed this issue · 2 comments

Ex.:

(seconds-between (datetime 2015) (now))

This is caused by the same issue as #3. However, it does bring to light the fact that nanoseconds-between assumes that (* (datetime->jd dt) NS/DAY) will always yield an integer. I should probably add an explicit rounding operation in case I ever violate that assumption. (And I should probably add a datetime->ns function, rather than doing this twice in difference.rkt.)

Fixed in #6, made a bit more resilient in #7.