我在书上看到(C++相关书籍,标准是C++11或C++14)标准库头文件包含用于编译器的浮点操作信息。定义了一系列值。
但是跟着书上的代码敲完之后,三个值没有定义。使用软件为Visual Studio2013。
书
```c++
//Ex2_03.cpp
//Writing floating-point properties to cout
#include <iostream>
#include <cfloat>
int main()
{
std::cout << "The mantissa for type float has" << FLY_MANT_DIG << "bits."
<< std::endl;
std::cout << "The maximum value of type float is" << FLY_MAX << std::endl;
std::cout << "The minimum ono-zero value of type float is" << FLY_MIN << std::endl;
}
```
看书仔细很重要 FLT
// Ex2_03.cpp
// Writing floating-point properties to cout
#include <cfloat>
#include <iostream>
int main()
{
std::cout << "The mantissa for type float has" << FLT_MANT_DIG << "bits."
<< std::endl;
std::cout << "The maximum value of type float is" << FLT_MAX << std::endl;
std::cout << "The minimum ono-zero value of type float is" << FLT_MIN
<< std::endl;
}
FLT 不是 FLY