Skip to content

Can't divide by small durations #172

Description

@kimo-k

Hey, really nice work on tick.

Seems like these should work:

(t.i/divide (t/new-duration 1 :seconds) (t/new-duration 1 :millis))
(t.i/divide (t/new-duration 1 :seconds) (t/new-duration 1 :micros))
(t.i/divide (t/new-duration 1 :seconds) (t/new-duration 1 :nanos))

Error:

Unhandled java.lang.ArithmeticException
   Divide by zero 
              Numbers.java:  190  clojure.lang.Numbers/divide
                 core.cljc:  915  tick.core$eval17885$fn__17886/invoke
            protocols.cljc:   51  tick.protocols$eval15134$fn__15135$G__15125__15142/invoke
                 core.cljc:  921  tick.core$eval17889$fn__17890/invoke
            protocols.cljc:   48  tick.protocols$eval15106$fn__15107$G__15097__15114/invoke
             interval.cljc:  901  tick.alpha.interval$divide/invokeStatic
             interval.cljc:  900  tick.alpha.interval$divide/invoke

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions