TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Rendering floating point numbers is hard

38 pointsby donsalmost 14 years ago

5 comments

japagetalmost 14 years ago
Link appears to be down. No joy with Google or Corel cache. Google search turned up a PDF at <a href="http://0-dl.acm.org.millennium.lib.cyut.edu.tw/ft_gateway.cfm?id=1806623&#38;type=pdf" rel="nofollow">http://0-dl.acm.org.millennium.lib.cyut.edu.tw/ft_gateway.cf...</a>
评论 #2709700 未加载
sc68calalmost 14 years ago
<i>the Grisu family acts as the default rendering algorithms in both the V8 and Mozilla Javascript engines (replacing David Gay's 17-year-old dtoa code)</i><p>Hmm. I think maybe a weekend hack is in order. Perhaps dtoa in Python can be replaced in a similar fashion, since Python maintains David Gay's algorithm as an upstream source.<p><a href="http://hg.python.org/cpython/file/fc831c49216d/Python/dtoa.c" rel="nofollow">http://hg.python.org/cpython/file/fc831c49216d/Python/dtoa.c</a><p>EDIT: Looks like there has already been some gripes about the quality of David Gay's implementation.<p><a href="http://bugs.python.org/issue9009" rel="nofollow">http://bugs.python.org/issue9009</a>
nemoniacalmost 14 years ago
"Grisu3 works on 99.49% of random IEEE doubles."<p>What a curious benchmark! It makes you wonder all kinds of things like how many IEEE doubles there are; how you sample from them randomly; what kind of coverage of the reals you get; and how relevant it all is.
评论 #2709153 未加载
iwwralmost 14 years ago
Are logarithmic number systems a better alternative to floats?
评论 #2710247 未加载
评论 #2710306 未加载
chrisjsmithalmost 14 years ago
Keeping everything in rational form would be nice, and easy to present.
评论 #2709573 未加载