gpt4 book ai didi

c++ - 在 C++ 中解释非规范化 double 打印

转载 作者:行者123 更新时间:2023-11-30 02:55:31 24 4
gpt4 key购买 nike

C++程序打印出如下数字是什么意思,最后的H是什么意思?

-6.38442e-86H

整个系统太大,无法添加到这里,但是这里是打印出特定 double 的代码。

try{
newLogLikelihoodEM= hmm->learningLogLikelihood(data, Arglist::getDiffLogLikelihood(), fileNumbers, rng);
}
catch (SingularCovarianceMatrixException &scme)
{
std::cout << scme.what() << ": doing learning, so restarts for this start-point" << std::endl;
noRestarts++;
restart = true;
}

和异常类

class SingularCovarianceMatrixException: public std::exception
{
double det;
public:
SingularCovarianceMatrixException(double det):det(det){};

virtual const char* what() const throw()
{

std::stringstream msg;
msg<< "Singular covariance matrix: determinant="<<det;

return msg.str().c_str();
}
};

异常被抛出

if(*detCovarianceMatrix<1e-300)
{
throw SingularCovarianceMatrixException(*detCovarianceMatrix);
}

最佳答案

H 不是数字的一部分。这不是 float 的有效后缀。您代码中的其他内容应该打印它。

关于c++ - 在 C++ 中解释非规范化 double 打印,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16420240/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com