`7.120236347223045e-307` is stringified as `7.1202363472230444e-307`

未关闭
#449 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 3 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
停滞
技术栈
c, javascript
领域
compilers

调研方向

Start by reproducing the value and its stringification in the qjs REPL, comparing the two decimal forms shown in the issue. Trace the JavaScript number stringification path and add coverage for this exact value; done means qjs emits the shorter representation used by the other engines while preserving correct round-tripping.

由索引模型根据 Issue 内容生成。

描述

I am testing out using quickjs to fuzz typescript-go's JS number implementation more quickly than shelling out to Node.js (by way of https://gitlab.com/cznic/quickjs to avoid cgo, not important for this issue).

One thing showed up in fuzzing. The number value 7.120236347223045e-307 is stringified by quickjs as 7.1202363472230444e-307:

qjs > 7.120236347223045e-307
7.1202363472230444e-307
qjs > 7.1202363472230444e-307
7.1202363472230444e-307

Which seems to be a longer encoding of the same value (based on comparing the bits of both).

V8, SpiderMonkey, JSC, etc, give the shorter encoding:

# V8
d8> 7.120236347223045e-307
7.120236347223045e-307
d8> 7.1202363472230444e-307
7.120236347223045e-307
# spidermonkey
js> 7.120236347223045e-307
7.120236347223045e-307
js> 7.1202363472230444e-307
7.120236347223045e-307
js> 
# javascriptcore
>>> 7.120236347223045e-307
7.120236347223045e-307
>>> 7.1202363472230444e-307
7.120236347223045e-307
主要语言
C
星标
11.1k
派生
1.2k
平均合并
11 小时 20 分钟
30 天内合并 PR
1

环境准备

这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

bellard/quickjs 的其他 Issue

查看 bellard/quickjs 的全部 Issue

相似的 Issue

更多 C Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。