TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Emulating the FMAdd Instruction, Part 1: 32-bit Floats

43 点作者 TazeTSchnitzel4 个月前

3 条评论

RossBencina4 个月前
I would love to know how the author tested/verified that the code is correct.
评论 #42574425 未加载
评论 #42586969 未加载
评论 #42573569 未加载
anematode4 个月前
As a vaguely related observation, I recently found a bug in a JVM written in JavaScript which implemented the l2f (64-bit long to 32-bit float) instruction incorrectly as Math.fround(Number(x)), performing an intermediate conversion to double (because there&#x27;s no way to directly round a JS bigint to float in one step). My workaround was to round the intermediate result to odd before calling Math.fround: <a href="https:&#x2F;&#x2F;gist.github.com&#x2F;anematode&#x2F;46bb73dbe6134cc861975c6443098af2" rel="nofollow">https:&#x2F;&#x2F;gist.github.com&#x2F;anematode&#x2F;46bb73dbe6134cc861975c6443...</a>
msk-lywenn4 个月前
I think the link should be: <a href="https:&#x2F;&#x2F;drilian.com&#x2F;posts&#x2F;2024.12.31-emulating-the-fmadd-instruction-part-1-32-bit-floats&#x2F;" rel="nofollow">https:&#x2F;&#x2F;drilian.com&#x2F;posts&#x2F;2024.12.31-emulating-the-fmadd-ins...</a>