Skip to content

Commit 6e0bd78

Browse files
swannodettequoll
andauthored
CLJS-3347: Create clojure.math namespace (#124)
* CLJS-3347: Create clojure.math namespace This introduces the cljs.math namespace and clojure.core/abs for parity with Clojure 1.11.0-alpha4. Also introduces clojure.math-tests, which is an equivalent sets of ClojureScript tests to the associated tests in Clojure. Also include the Clojure test clojure.gen-math-test to compare all reimplemented functions between the JVM versions and the equivalent function calls executed on a ClojureScript prepl. * Cleaned up references to Java Double in docs Co-authored-by: Paula Gearon <[email protected]>
1 parent 8b16b44 commit 6e0bd78

File tree

6 files changed

+1481
-0
lines changed

6 files changed

+1481
-0
lines changed

src/main/cljs/cljs/core.cljs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2712,6 +2712,11 @@ reduces them without incurring seq initialization"
27122712
"Returns a number one less than num."
27132713
[x] (- x 1))
27142714

2715+
(defn ^number abs
2716+
{:doc "Returns the absolute value of a."
2717+
:added "1.11.10"}
2718+
[a] (Math/abs a))
2719+
27152720
(defn ^number max
27162721
"Returns the greatest of the nums."
27172722
([x] x)

0 commit comments

Comments
 (0)