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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Real Close to the Machine: Floating Point in D

25 点作者 yawniek超过 9 年前

1 comment

shultays超过 9 年前
defaulting floats to NaN seemed a little weird, so I checked what D defaults other data types.<p><a href="https:&#x2F;&#x2F;dlang.org&#x2F;spec&#x2F;type.html" rel="nofollow">https:&#x2F;&#x2F;dlang.org&#x2F;spec&#x2F;type.html</a><p>Well, it good weirder. int types are 0s except char types which are 0xFF, 0xFFFF (-1). Except dchar (32bit uint) which is 0x0000FFFF. And all floating types are NaN. Why the inconsistency?<p>Is there a reason for this? If you are gonna initialize your locals why not 0 for all? It would be more expected, consistent and probably efficient.
评论 #11057617 未加载
评论 #11057370 未加载
评论 #11057673 未加载