C# 中的十进制类型与 IEEE-754 标准
C# 中的 Decimal 类型是否遵循经典双精度表示(IEEE-754 标准)的相同规则(公式、标准化/非标准化、隐含 1、指数偏差),除了使用基数 10 而不是基数 2。
隐含使用基数是什么意思10 而不是基数 2 ?
是否存在像“IEEE-754 double”一样的相同行为,即即使对于有限精度(例如 28/29 位),相邻值之间也存在一些间隙?
Is Decimal type in C# follow the same rules (formula,normalized/denormalized,implied 1,Exponent bias) of classic double representation (IEEE-754 standard) except the use of base 10 instead of base 2.
What does implied the use of base 10 instead of base 2 ?
Is there, like "IEEE-754 double", the same behavior namely some gaps between adjacent values even for a finite precision (like 28/29 digits)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,C#
十进制
不遵循与 IEEE 754 浮点数相同的规则。 C# 4 规范非常清楚地说明了它的行为方式(第 4.1.7 节):No, C#
decimal
doesn't follow the same rules as IEEE 754 floating point numbers. The C# 4 specification is quite clear on how it should behave (§4.1.7):