Skip to content

[Bug]: A problem about rounding double precision floating point numbers #7014

@ayuan0828

Description

@ayuan0828

ChakraCore Version

36becec

Steps to reproduce

When I use the 'print()' method to output an array containing a specific double-precision floating-point number, there is an unexpected rounding error in the last digit. Should the binary representation of the value be stored accurately?

Proof of concept

const testNumber = 9.758231785433683;
const numberArray = [testNumber];
print(numberArray);

Exception or Error

9.758231785433682

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions