This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2024-01-25
Channels
- # aleph (1)
- # announcements (6)
- # babashka (13)
- # beginners (21)
- # clj-http (25)
- # clj-kondo (23)
- # clojure (17)
- # clojure-europe (49)
- # clojure-nl (1)
- # clojure-norway (8)
- # clojure-uk (4)
- # clojuredesign-podcast (15)
- # clojurescript (6)
- # cursive (18)
- # datomic (22)
- # emacs (29)
- # hyperfiddle (55)
- # introduce-yourself (4)
- # polylith (34)
- # portal (10)
- # releases (1)
- # shadow-cljs (16)
- # spacemacs (2)
In bb:
user=> [ ##NaN ##Inf Double/NaN ]
[##NaN ##Inf ##NaN]
user=> Double/Inf
java.lang.IllegalArgumentException: No matching field found: Inf for class java.lang.Double [at <repl>:3:-10]
user=> (type ##Inf)
java.lang.Double
why is Double/Inf
not working there?✅ 1
for the same reason it doesn't work in clj?
$ clj
Clojure 1.12.0-alpha5
user=> Double/Inf
Syntax error compiling at (REPL:0:0).
Unable to find static field: Inf in class java.lang.Double
$ bb -e Double/POSITIVE_INFINITY
##Inf
$ bb -e Double/NEGATIVE_INFINITY
##-Inf
kudos to lein repl
tab completion 🙂
Right. I figured out what inf is called in java.
I had assumed that since ##NaN
was Double/NaN
then ##Inf
would be Double/Inf
And to round it out I just learned about ##-Inf
$ bb -e '(== ##-Inf Double/NEGATIVE_INFINITY)'
true