有人可以解释一下“-1.#QNAN”是什么意思吗?意思是?
当我使用g++编译以下语法时出现“-1.#QNAN”符号,只需简单地获取c++标准库中的最大值long double即可: cout << "max(long double): " << numeric_limits
有人可以帮我解释一下这个符号是什么意思吗?
The "-1.#QNAN" symbol appears when I use g++ to compile the following syntax, just simply get the max value long double in the c++ standard library:cout << "max(long double): " << numeric_limits<long double>::max() << endl;
could someone help me explain what does that symbol mean?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
NaN(非数字) 是数字数据类型的值表示未定义或无法表示的值,尤其是在浮点计算中。
提供了两种不同类型的 NaN,称为安静 NaN 和信号 NaN。
安静 NaN 用于传播因无效操作或值而导致的错误,而信号 NaN 可以支持高级功能,例如混合数字和符号计算或基本浮点算术的其他扩展。
参考:
维基百科
NaN (Not a Number) is a value of the numeric data type representing an undefined or unrepresentable value, especially in floating-point calculations.
Two separate kinds of NaNs are provided, termed quiet NaNs and signaling NaNs.
Quiet NaNs are used to propagate errors resulting from invalid operations or values, whereas signaling NaNs can support advanced features such as mixing numerical and symbolic computation or other extensions to basic floating-point arithmetic.
Reference:
Wikipedia