Skip to content
Snippets Groups Projects
Commit 67f218dc authored by Simon Belak's avatar Simon Belak
Browse files

make nils comparable

parent fba6b3ae
Branches
Tags
No related merge requests found
......@@ -75,6 +75,10 @@
[a b]
{:difference 1})
(defmethod difference [nil nil]
[a b]
{:difference 0})
(defn chi-squared-distance
"Chi-squared distane between empirical probability distributions `p` and `q`.
http://www.aip.de/groups/soe/local/numres/bookcpdf/c14-3.pdf"
......
......@@ -28,7 +28,8 @@
1
1
0
0.25]
0.25
0]
(mapv :difference [(difference 1 2.0)
(difference 2.0 2.0)
(difference 2.0 nil)
......@@ -37,7 +38,8 @@
(difference true false)
(difference false true)
(difference false false)
(difference [1 0 1] [0 1 1])]))
(difference [1 0 1] [0 1 1])
(difference nil nil)]))
(expect
true
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment