symbolic value | since v1.9.946 | Edit |
Floating point representation of NaN
(not a number), an undefined or
unrepresentable number.
To test for NaN, use the native JavaScript js/isNaN
or the safer js/Number.isNaN
.
##NaN
;;=> ##NaN
Testing for NaN:
(js/Number.isNaN ##NaN)
;;=> true
(js/Number.isNaN (/ 0 0))
;;=> true
(js/Number.isNaN 1)
;;=> false
Equivalent to the JavaScript symbol:
js/NaN
;;=> ##NaN
(defn- read-symbolic-value
[rdr _ opts pending-forms]
(let [sym (read* rdr true nil opts pending-forms)]
(case sym
Inf Double/POSITIVE_INFINITY
-Inf Double/NEGATIVE_INFINITY
NaN Double/NaN
(err/reader-error rdr (str "Invalid token: ##" sym)))))
(defn- dispatch-macros [ch]
(case ch
\^ read-meta ;deprecated
\' (wrapping-reader 'var)
\( read-fn
\= read-eval
\{ read-set
\< (throwing-reader "Unreadable form")
\" read-regex
\! read-comment
\_ read-discard
\? read-cond
\: read-namespaced-map
\# read-symbolic-value
nil))