C语言:float表示范围

时间:2021-04-06 20:27:11   收藏:0   阅读:60
#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();

}

 

原文:https://www.cnblogs.com/xkdn/p/14623075.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!