From cefdb2cd3d10678a487b7d042f07837582cdcd71 Mon Sep 17 00:00:00 2001 From: mokshasoft Date: Mon, 17 Jun 2024 02:55:13 +0200 Subject: [PATCH] Fixed reflection in with-precision and abs (#671) --- src/datahike/query_stats.cljc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/datahike/query_stats.cljc b/src/datahike/query_stats.cljc index 26a03cef2..dd1ab1fc0 100644 --- a/src/datahike/query_stats.cljc +++ b/src/datahike/query_stats.cljc @@ -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)))