小编use*_*444的帖子

float 和 double 的实际最小/最大值是多少(C++)

我已经阅读了对浮动使用“FLT_MIN”和“FLT_MAX”值的建议。每当我这样做时,代码块都会告诉我

最大值:3.40282e+038 最小值:1.17549e-038

不知道这意味着什么我试图获得真正的价值并得到了

最大值:47.2498237715 最小值:-34.8045265148

......但这些并不能说明问题。

这是我的代码片段

   char c;         // reserve: 1 byte, store 1 character (-128 to 127)
   int i;          // reserve: 4 bytes, store -2147483648 to 2147483657
   short int s;    // reserve: 2 bytes, store -32768 to 32767
   float f;        // reserve: 4 bytes, store ?? - ?? (? digits)
   double d;       // reserve: 8 bytes, store ?? - ?? (? digits)
   unsigned int u; //reserve: r bytes store 0 to 4294967295

   c = 'c';
   cout << …
Run Code Online (Sandbox Code Playgroud)

c++ variables floating-point double

8
推荐指数
3
解决办法
4万
查看次数

标签 统计

c++ ×1

double ×1

floating-point ×1

variables ×1