97jaz / gregor

Date and time library for Racket
45 stars 10 forks source link

bug: seconds-between breaks contract #4

Closed 97jaz closed 9 years ago

97jaz commented 9 years ago

Ex.:

(seconds-between (datetime 2015) (now))
97jaz commented 9 years ago

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.)

97jaz commented 9 years ago

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