- mongodb - 在 MongoDB mapreduce 中,如何展平值对象?
- javascript - 对象传播与 Object.assign
- html - 输入类型 ="submit"Vs 按钮标签它们可以互换吗?
- sql - 使用 MongoDB 而不是 MS SQL Server 的优缺点
我有:
double score = cvMatchContourTrees( CT1, CT2, CV_CONTOUR_TREES_MATCH_I1, 0.0 );
cout<<score<<endl;
返回值为 -1.#IND。除此之外,正值是正常的,例如 1.34543。
为什么会这样?我该如何解决?
最佳答案
正如 Frederic 所说,这是 ' Not a Number 的结果' 由在 Windows 上使用 Visual Studio 构建的应用程序进行格式化。约翰 D 库克有一个 excellent reference :
Windows displays a NaN as -1.#IND ("IND" for "indeterminate") while Linux displays nan.
...
In short, if you get 1.#INF or inf, look for overflow or division by zero. If you get 1.#IND or nan, look for illegal operations.
如果您对字符串进行任何类型的格式化,请注意截断;我遇到了related issues自己处理这类错误时。
关于c++ - 为什么这些 double 的返回值是 -1.#IND?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7476177/
函数返回一个包含float值的列表。如果我绘制此列表,我会发现一些 float 值等于 -1.#IND。我还检查了这些 -1.#IND 值的类型。它们也是float类型。但我如何理解这个 -1.#IN
这里很简单的问题:当我测试错误的数据输入时,我给出了一条错误消息,但是 -1.#IND 在它之后出现? 例如,我在应该是正数的地方输入了负数,结果出现“wrong input dummy-1.#IND
我正在尝试通过使用极坐标以及平均值和西格玛值生成两个标准正态变量 r1、r2 来生成随机变量。然而,当我运行我的代码时,我不断得到一个“-nan(ind)”作为我的输出。 我在这里做错了什么?代码如下
假设我正在评估 a/b,其中 a 和 b 都是浮点类型。 如果 b 为零,则答案为 -1.#IND。 是否有任何其他 b(和 a)值会给我 -1.#IND,或者正在检查非零 b 足以避免得到这个结果吗
我目前正在为二叉树编写 C++。整件事都写好了,但是,无论我想评估什么表达式,我都会让命令提示符告诉我 -1.#IND。关于解决此问题的任何想法,甚至这意味着什么? 提前致谢 代码: #include
我有一个 float 组,它存储一些由某些函数计算的值。但是,当我从数组中检索一个值时,有些值是 -1。#IND,这是一个浮点错误或我猜是某种错误。 所以这是我的小问题,我如何使用 if 语句来检查
我正在尝试获取which(..., arr.ind = TRUE)函数的结果,并删除不是第一个“彼此连接”的行。 示例: #example 1 example 2 example
我正在尝试将一个“大”因素转换为 R 中的一组指标(即虚拟、二进制、标志)变量: FLN <- data.frame(nnet::class.ind(FinelineNumber)) 其中 Finel
已关闭。这个问题是 not reproducible or was caused by typos 。目前不接受答案。 这个问题是由拼写错误或无法再重现的问题引起的。虽然类似的问题可能是 on-top
我正在尝试编写一个 Scaler 类,该类采用具有分数的子测试。 Scaler 使用其子级分数类的缩放方法来重新缩放其值(例如 1/1 缩放 5 = 5/5 或 0/1 缩放 5 = 0/5)。 但是
我有一些代码可以让我绘制新月形状,并提取了要绘制的 excel 值。但是,代替某些数字的是 -1.#IND。首先,如果有人能解释这意味着什么,因为谷歌返回 0 个链接。其次,是否有办法阻止它发生。 我
我正在为 iPad 开发一个应用程序。该应用程序具有以下详细信息: 基础 SDK:4.2部署目标:3.2 该应用程序是一个游戏应用程序,有 10 轮。 在每一轮中,我加载 6 个 Controller
我已经提取了一些我想查看的元素的数组索引,如下所示: mat = matrix(0,10,10) arrInd = which(mat ==0,arr.ind = T) 然后我对该矩阵进行更多操作,最
我正在尝试插入一个 2D 角度,它在 99.9% 的时间内都有效。出于某种原因,我得到 -nan(ind) 某些值,例如: lastAngle = -0.0613451 currentAngle =
我喜欢使用 akeneo 中的自定义命令从数据库中获取一些产品。我正在使用 ProductRepositoryInterface public function read() { return
我对这个问题很困惑。我正在运行的代码是: double dotProduct = dot(A, B); std::cout ; } else if (value>=1.0) {
我有: double score = cvMatchContourTrees( CT1, CT2, CV_CONTOUR_TREES_MATCH_I1, 0.0 ); cout<
这是 VB.NET 中的一个奇怪的计算错误。我已将我的问题简化为以下内容。我可以写: Console.WriteLine(-0.78125 ^ 2.5) 并获得 -0.5394796609394436
问题的不相关理由 : 我在调用 Lua 时遇到错误 format : integer overflow attempting to store -1.#IND 变量的 type(n)真的是number
我已经尝试了检测奇数(NaN、QNaN 等)的所有常规技巧,但我似乎无法检测到 -1。#IND。任何帮助将不胜感激。 最佳答案 试试这个: http://www.johndcook.com/IEEE_
我是一名优秀的程序员,十分优秀!