#include <stdio.h>
#include <limits.h> //整数限制
#include <float.h> //浮点数限制
void main()
{
printf("the FLOAT_MIN number is : %f\n",FLT_MIN); //float的最小值 printf("the FLOAT_MAX number is : %f\n",FLT_MAX); //float的最大值
printf("the FLOAT_MAX number is : %e\n",FLT_MAX); //float的最大值
getchar(); }

#include <stdio.h>
#include <limits.h> //整数限制
#include <float.h> //浮点数限制
void main()
{
printf("the FLOAT_MIN number is : %f\n",FLT_MIN); //float的最小值 printf("the FLOAT_MAX number is : %f\n",FLT_MAX); //float的最大值
printf("the FLOAT_MAX number is : %e\n",FLT_MAX); //float的最大值
printf("the INT_MAX number is : %d\n",INT_MAX);
printf("the INT_MIN number is : %d\n",INT_MIN);
printf("the CHAR_MAX number is : %d\n",CHAR_MAX);
printf("the CHAR_MIN number is : %d\n",CHAR_MIN);
printf("the SHORT_MAX number is : %d\n",SHRT_MAX);
printf("the SHORT_MIN number is : %d\n",SHRT_MIN);
printf("the LONG_MAX number is : %d\n",LONG_MAX);
printf("the LONG_MIN number is : %d\n",LONG_MIN);
printf("the DOUBLE_MAX number is : %d\n",DBL_MAX);
printf("the DOUBLE_MIN number is : %d\n",DBL_MIN);
getchar(); }

float:

  1bit(符号位) 8bits(指数位) 23bits(尾数位)
double:
  1bit(符号位) 11bits(指数位) 52bits(尾数位)

于是,float的指数范围为-127~+128,而double的指数范围为-1023~+1024,并且指数位是按补码的形式来划分的。
  其中负指数决定了浮点数所能表达的绝对值最小的非零数;而正指数决定了浮点数所能表达的绝对值最大的数,也即决定了浮点数的取值范围。
  float的范围为-2^128 ~ +2^128,也即-3.40E+38 ~ +3.40E+38;double的范围为-2^1024 ~ +2^1024,也即-1.79E+308 ~ +1.79E+308。

最新文章

  1. DBUtils框架
  2. [转]Asp.Net调用前台js调用后台代码分享
  3. v-charts
  4. 微信小程序的MVVM思想
  5. Game Engine Architecture 3
  6. shiro源码篇 - shiro的filter,你值得拥有
  7. loadrunner&#160;脚本录制-Protocol&#160;Advisor协议分析器的使用
  8. 【ZJOI2012】灾难
  9. 2018年东北农业大学春季校赛 E-wyh的阶乘(求n!的0的个数)
  10. js添加锚点
  11. Andriod开发第一步-部署环境(搬运&amp;&amp;总结)
  12. ActiveReports 报表应用教程 (12)---交互式报表之贯穿钻取
  13. 1064: 不明飞行物(ufo)
  14. MIUI添加内存调试工具:查看进程中的Bitmap信息
  15. GO.db
  16. java POI创建Excel示例(xslx和xsl区别 )
  17. 家谱(gen)
  18. Oracle 分析函数及常用函数
  19. kubernetes 与LVM的结合
  20. plsql programming 01 plsql概述

热门文章

  1. Xilinx FPGA全局介绍
  2. TensorFlow+TVM优化NMT神经机器翻译
  3. MindInsight训练可视整体设计介绍
  4. 功率半导体碳化硅(SiC)技术
  5. 实时双频Wi-Fi如何实现下一代车内连接
  6. Net Core 5.0 部署IIS错误-500.31-Failed to load ASP.NET Core runtime
  7. Java基础知识之this关键字知识讲解
  8. 【NX二次开发】图标图像
  9. 10:ValueError: Cannot assign &quot;&#39;2&#39;&quot;: &quot;Comment.article&quot; must be a &quot;Article&quot; instance
  10. SpringBoot实现通用的接口参数校验