【发布时间】:2018-01-04 01:07:18
【问题描述】:
似乎我们可以轻松推导出小于numeric_limits<float>::min() 的浮点数。为什么。如果numeric_limits<float>::min() 不应该是最小的正浮点数,它应该是什么?
#include <iostream>
#include <limits>
using namespace std;
int main(){
float mind = numeric_limits<float>::min();
float smaller_than_mind = numeric_limits<float>::min()/2;
cout<< ( mind > smaller_than_mind && smaller_than_mind > 0 ) <<endl;
}
【问题讨论】:
标签: c++ floating-point