Welcome! Please see the About page for a little more info on how this works.

0 votes
in ClojureScript by
The docstrings for {{cljs.core/long}} and {{cljs.core/unchecked-long}} say: {{"Coerce to long by stripping decimal places. Identical to `int'."}} However, their implementation and behavior differs from {{cljs.core/int}}. Some examples:

|| {{x}} || {{(int x)}} || {{(long x)}} ||
| {{-5671919744}} | {{-1376952448}} | {{-5671919744}}
| {{##Inf}} | {{0}} | {{##Inf}} |
| {{"a"}} | {{0}} | {{##NaN}} |
| {{"24248082057"}} | {{-1521721719}} | {{24248082057}} |

{{unchecked-long}}'s implementation is identical to {{long}}'s so the results are the same. The solution I propose is to just drop the claim about identicalness.

1 Answer

0 votes
by
Reference: https://clojure.atlassian.net/browse/CLJS-3059 (reported by arcatan)
...