Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.equals() does not correctly handle big unsigned integers #83

Open
ruimoe opened this issue Nov 22, 2019 · 1 comment
Open

.equals() does not correctly handle big unsigned integers #83

ruimoe opened this issue Nov 22, 2019 · 1 comment

Comments

@ruimoe
Copy link

ruimoe commented Nov 22, 2019

Big unsigned Longs are not correctly checked for equality with a string.

Steps to reproduce:

see this JSFiddle

Expected behaviour:

.equals() returns true for given arguments

Actual behaviour:

.equals() returns false

@baryluk
Copy link

baryluk commented May 27, 2020

Yeah, indeed, it looks the equals, and comp functions are not finished for the case of comparing signed and unsigned value.

const value = '10234114402585926231'
let l1 = Long.fromValue(value, true);
let l2 = Long.fromValue(value, false);
console.log(l1.eq(l2));
console.log(l1.comp(l2));

Incorrectly show false, and -1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants