ClojureScript

Contrary to their docstrings, long and unchecked-long are not identical to int

Details

  • Type: Defect Defect
  • Status: Open Open
  • Priority: Trivial Trivial
  • Resolution: Unresolved
  • Affects Version/s: 1.10.238
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    ClojureScript 1.10.520, Node 11.10.0

Description

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.

Activity

There are no comments yet on this issue.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated: