Skip to content

Commit

Permalink
Fixed reflection in with-precision and abs (#671)
Browse files Browse the repository at this point in the history
  • Loading branch information
mokshasoft authored Jun 17, 2024
1 parent b62e9c7 commit cefdb2c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/datahike/query_stats.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
(:require [clojure.set :as set]
[datahike.tools :as dt]))

(defn round [precision x]
(defn round [^long precision ^java.math.BigDecimal x]
#?(:clj (with-precision precision x)
:cljs (let [y (Math/pow 10 precision)]
(/ (.round js/Math (* y x)) y))))

(defn compatible-abs [n]
(defn compatible-abs [^long n]
#?(:clj (Math/abs n)
:cljs (js/Math.abs n)))

Expand Down

0 comments on commit cefdb2c

Please sign in to comment.