memset所有位为零将浮动/加倍为零?

编程入门 行业动态 更新时间:2024-10-26 18:25:30
本文介绍了memset所有位为零将浮动/加倍为零?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

全部 我正在阅读这个小组的常见问题解答。我对此有疑问: www.eskimo/~scs/C-faq/q7.31.html 它说: " ; p = malloc(m * n); memset(p,0,m * n); 零填充全部 - bits-zero,因此不保证有用的null 指针值(参见本列表的第5部分)或浮点零值。 " 但是ieee754定义浮点零为全位零。 任何人都可以帮忙解释一下这个吗? 提前致谢。

Hi, All I am reading FAQ of this group. I have a question about this: www.eskimo/~scs/C-faq/q7.31.html It says: " p = malloc(m * n); memset(p, 0, m * n); The zero fill is all-bits-zero, and does not therefore guarantee useful null pointer values (see section 5 of this list) or floating-point zero values. " but ieee754 defined float zero to be all-bits-zero. Anyone can help to explain about this? Thanks in advance.

推荐答案

文章< ca *********** @ mail99> ;, Zhiqiang Ye< ye ** @ mail.cbi.pku.edu>写道: In article <ca***********@mail99>, Zhiqiang Ye <ye**@mail.cbi.pku.edu> wrote: 零填充是全位零,因此不保证有用的空指针值(参见本列表第5节)或浮点零点值。 但ieee754定义浮点零为全位零。 The zero fill is all-bits-zero, and does not therefore guarantee useful nullpointer values (see section 5 of this list) or floating-point zero values. but ieee754 defined float zero to be all-bits-zero.

为零。 - Richard

So *if* your C omplementation uses IEEE floating point, the values will be zero. -- Richard

Zhiqiang Ye写道: Zhiqiang Ye wrote: 我正在阅读这个小组的常见问题。我对此有疑问: www.eskimo/~scs/C-faq/q7.31.html 它说:" p = malloc (m * n); memset(p,0,m * n); 零填充是全位零,因此不保证有用的空指针值(参见这个列表的第5部分)或浮点零值。> 但ieee754定义了浮零为全零位。 任何人都可以有助于解释这个吗? I am reading FAQ of this group. I have a question about this: www.eskimo/~scs/C-faq/q7.31.html It says: " p = malloc(m * n); memset(p, 0, m * n); The zero fill is all-bits-zero, and does not therefore guarantee useful null pointer values (see section 5 of this list) or floating-point zero values. " but ieee754 defined float zero to be all-bits-zero. Anyone can help to explain about this?

这是一个疯狂的猜测。 因为IEEE 754支持不是强制性的?因此,你不能,或许,假设每个编译器都将实现 IEEE 754标准规定的格式。

Here''s a wild guess. Because IEEE 754 support is not mandatory? Thus you cannot, portably, assume that every compiler will implement the formats specified by the IEEE 754 standard.

在< ca *********** @ mail99> 志强叶 <叶** @ mail.cbi.pku.edu>写道: In <ca***********@mail99> "Zhiqiang Ye" <ye**@mail.cbi.pku.edu> writes: 我正在阅读这个小组的常见问题。我对此有疑问: www.eskimo/~scs/C-faq/q7.31.html 它说:" p = malloc (m * n); memset(p,0,m * n); 零填充是全位零,因此不保证有用的空指针值(参见这个列表的第5部分)或浮点零值。> 但ieee754定义了浮零为全零位。 任何人都可以有助于解释这个吗? I am reading FAQ of this group. I have a question about this:www.eskimo/~scs/C-faq/q7.31.htmlIt says:"p = malloc(m * n);memset(p, 0, m * n);The zero fill is all-bits-zero, and does not therefore guarantee useful nullpointer values (see section 5 of this list) or floating-point zero values."but ieee754 defined float zero to be all-bits-zero.Anyone can help to explain about this?

C标准并没有说浮点类型*必须*遵循 IEEE-754规格。还有其他浮点表示 其中所有位零并不意味着零。 Dan - Dan Pop DESY Zeuthen,RZ集团 电子邮件: Da*****@ifh.de

更多推荐

memset所有位为零将浮动/加倍为零?

本文发布于:2023-11-26 19:35:20,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1634917.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:为零   memset

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!