Skip to content

Commit 192a8a7

Browse files
committed
CLJCLR-171: Fix (parse-double "Infinity")
1 parent 90fa269 commit 192a8a7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Clojure/Clojure.Source/clojure/core.clj

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8173,7 +8173,7 @@ clojure.lang.IKVReduce
81738173
[^String s] ;;; ^Long -- no equivalent since this can return nil -- at least until we can return Nullable<long>
81748174
(if (string? s)
81758175
(try
8176-
(Int64/Parse s) ;;; Long/Parse
8176+
(Int64/Parse s (.NumberFormat System.Globalization.CultureInfo/InvariantCulture)) ;;; Long/Parse
81778177
(catch FormatException _ nil)(catch OverflowException _ nil)) ;;; NumberFormatException -- and added other cases
81788178
(throw (ArgumentException. (parsing-err s))))) ;;; IllegalArgumentException
81798179

@@ -8186,9 +8186,9 @@ clojure.lang.IKVReduce
81868186
[^String s] ;;; ^Double -- no equivalent since this can return nil -- at least until we can return Nullable<double>
81878187
(if (string? s)
81888188
(try
8189-
(Double/Parse s) ;;; Double/valueOf
8190-
(catch FormatException _ nil)(catch OverflowException _ nil)) ;;; NumberFormatException -- and added other cases
8191-
(throw (ArgumentException. (parsing-err s))))) ;;; IllegalArgumentException
8189+
(Double/Parse s (.NumberFormat System.Globalization.CultureInfo/InvariantCulture)) ;;; Double/valueOf, added InvariantCulture
8190+
(catch FormatException _ nil)(catch OverflowException _ nil)) ;;; NumberFormatException -- and added other cases
8191+
(throw (ArgumentException. (parsing-err s))))) ;;; IllegalArgumentException
81928192

81938193
(defn parse-uuid
81948194
{:doc "Parse a string representing a UUID and return a java.util.UUID instance,

0 commit comments

Comments
 (0)