What does -1.#IND mean (double stream output) [duplicate]

半城伤御伤魂 提交于 2021-01-29 07:59:18

问题


I could neither find it via google, search here or on Microsofts helppages...

After some extensive calculations, sometimes, when outputting my doubles via std::cout i prints as result on console:

-1.#IND

There are no modifcations(like precision etc) to the cout-stream. I assume the program wants to tell me about some sort of error, but I can't figure it out :/ It doesn't happen that often but with a low frequency (it is a genetical algorithm, so i have an output after every generation, and in about every 5th to 10th generation this seems to happen...)

For information, I'm using Visual Studio Pro 2013.


回答1:


Windows displays NaN as -1.#IND. NaN is a result of a mathematical operation that does not make sense. For example, 0.0 / 0.0, or sqrt(-1.0) will return NaN. I can't really help further without more details about the underlying operation. Hopefully this is enough to point you in the right direction, though.



来源:https://stackoverflow.com/questions/23525192/what-does-1-ind-mean-double-stream-output

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!