Skip to content

Commit ff2f52e

Browse files
committed
Mention clojure.math
1 parent fe80b3d commit ff2f52e

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.adoc

+17
Original file line numberDiff line numberDiff line change
@@ -774,6 +774,8 @@ Some common, idiomatic aliases are shown below:
774774
| Namespace | Idiomatic Alias
775775
| clojure.java.io
776776
| io
777+
| clojure.math
778+
| math
777779
| clojure.set
778780
| set
779781
| clojure.string
@@ -2137,6 +2139,21 @@ Try to use `swap!` rather than `reset!`, where possible.
21372139
(reset! a 5)
21382140
----
21392141

2142+
== Math
2143+
2144+
=== Prefer `clojure.math` Functions Over Interop [[prefer-clojure-math-over-interop]]
2145+
2146+
Prefer math functions from `clojure.math` over (Java) interop or rolling your own.
2147+
2148+
[source,clojure]
2149+
----
2150+
;; good
2151+
(clojure.math/pow 2 5)
2152+
2153+
;; okish
2154+
(Math/pow 2 5)
2155+
----
2156+
21402157
== Strings
21412158

21422159
=== Prefer `clojure.string` Functions Over Interop [[prefer-clojure-string-over-interop]]

0 commit comments

Comments
 (0)