Skip to content

Commit 0e50ccb

Browse files
authored
Don't sign-extend unsigned input in fromInt(). (#94)
1 parent ee79b89 commit 0e50ccb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/long.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ function fromInt(value, unsigned) {
125125
if (cachedObj)
126126
return cachedObj;
127127
}
128-
obj = fromBits(value, (value | 0) < 0 ? -1 : 0, true);
128+
obj = fromBits(value, 0, true);
129129
if (cache)
130130
UINT_CACHE[value] = obj;
131131
return obj;

0 commit comments

Comments
 (0)