From 83c7e440f68bc4c271abe0f22de6ed8edea3e13b Mon Sep 17 00:00:00 2001 From: Ryan Boldi Date: Sat, 12 Mar 2022 13:55:47 -0500 Subject: [PATCH] added step function to math utils --- src/propeller/tools/math.cljc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/propeller/tools/math.cljc b/src/propeller/tools/math.cljc index 03ed549..2b42be1 100755 --- a/src/propeller/tools/math.cljc +++ b/src/propeller/tools/math.cljc @@ -6,6 +6,11 @@ (defonce E #?(:clj Math/E :cljs js/Math.PI)) +(defn step + "returns 1 if number is nonzero, 0 otherwise" + [x] + (if (zero? x) 0 1)) + (defn abs "Returns the absolute value of a number." [x]