Conversation
|
I got bit by this today: For example: (.longValue (Double/valueOf "31697972792222222")) |
|
This requires a bit more thought on my part since parse-long is pretty broken for java use cases. |
558c646 to
3ec3ae8
Compare
|
I would recommend a bug fix release for this as soon as possible as it's a major bug. The current implementation does not parse long values correctly, and the users will silently get wrong data when calling In the long term I think the name is misleading since the function doesn't just parse integers. It would be better to rename it to |
|
It is called parse-int with the clojure conventions. clojure treats longs and ints as the same type in most circumstances (see the You are right. I will issue a new bugfix release this afternoon. |
|
In any case this PR, adds a duplicate parse-int function with wrong impl. I suggest submit an other PR (i'll fix it myself if this PR is not fixed for today) In any case, thanks to all!. |
|
Thanks for the quick response. Regarding |
do not coerce a long string into double which causes a loss of precision use BigDecimal instead
3ec3ae8 to
43f1834
Compare
|
@niwinz I removed the duplicated parse-int function. I think the function is keeping with the spirit of what you tried to do in terms of using Double, but relying on BigDecimal instead. |
do not coerce a long string into double which causes a loss of
precision