added step function to math utils
This commit is contained in:
parent
72e31b5c4d
commit
83c7e440f6
@ -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]
|
||||
|
Loading…
x
Reference in New Issue
Block a user