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

string representation of floats larger than 2^53 differs from other engines #5363

Closed
sunlili opened this issue Jun 25, 2018 · 2 comments
Closed

Comments

@sunlili
Copy link

sunlili commented Jun 25, 2018

Hello,
The following code behaves incorrectly (inconsistent with the standard and other engines).
ch version 1.8.5.0

var nonArray=({                                                                                                                                                      
    length:4,
    0:42,
    2:37,
    0xf7da5000:undefined,
    0x8000000000000800:0
});
Array.prototype.sort.call(nonArray);

print(JSON.stringify(nonArray));
print("BT_FLAG");

The output is:
{"0":37,"1":42,"length":4,"9223372036854777000":0}
BT_FLAG

However, other engines' output are:
{"0":37,"1":42,"length":4,"9223372036854778000":0}
BT_FLAG

BT group
2018.6.25

@MSLaguana MSLaguana changed the title Inconsistent output compared with other JS engines string representation of floats larger than 2^53 differs from other engines Jun 25, 2018
@zenparsing
Copy link
Contributor

Minimum repro:

print(0x8000000000000800);

@rhuanjl
Copy link
Collaborator

rhuanjl commented Jun 25, 2018

Possibly a duplicate of this issue #149

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

4 participants