chakra-core / chakra-core/ChakraCore

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

Open
#7,014 3 comments 0 reactions 0 assignees View on GitHub
Duplicate
Dominant language
JavaScript
Stars
9.3k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Description

### 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

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

### Exception or Error

```text
9.758231785433682
```

### Additional Context

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.