Skip to content

Commit 409b671

Browse files
borkdudeswannodette
authored andcommitted
CLJS-3471: fix printing of negative zero
1 parent 8a596a8 commit 409b671

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/main/cljs/cljs/core.cljs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10470,6 +10470,7 @@ reduces them without incurring seq initialization"
1047010470
(js/isNaN obj) "##NaN"
1047110471
(identical? obj js/Number.POSITIVE_INFINITY) "##Inf"
1047210472
(identical? obj js/Number.NEGATIVE_INFINITY) "##-Inf"
10473+
(js/Object.is obj -0.0) "-0.0"
1047310474
:else (str_ obj)))
1047410475

1047510476
(object? obj)

src/test/cljs/cljs/printing_test.cljs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
(is (= (pr-str 1) "1"))
7575
(is (= (pr-str -1) "-1"))
7676
(is (= (pr-str -1.5) "-1.5"))
77+
(is (= (pr-str -0.0) "-0.0"))
7778
(is (= (pr-str [3 4]) "[3 4]"))
7879
(is (= (pr-str "foo") "\"foo\""))
7980
(is (= (pr-str :hello) ":hello"))

0 commit comments

Comments
 (0)