gpt4 book ai didi

c - 为什么float的最小值是0?

转载 作者:太空宇宙 更新时间:2023-11-04 05:55:13 26 4
gpt4 key购买 nike

<分区>

这段代码:

int main(){

printf("The value of FLT_MAX is %.5f\n", FLT_MAX);
printf("The value of FLT_MIN is %.5f\n", FLT_MIN);
printf("A float takes %i bytes\n", sizeof(float));

float fx = -1.24;
printf("The value of fx is %f\n", fx);

}

返回:

The value of FLT_MAX is 340282346638528859811704183484516925440.00000
The value of FLT_MIN is 0.00000
A float takes 4 bytes
The value of fx is -1.240000

float 是无符号的还是有符号的?为什么 FLT_MIN 0 但另一方面我可以将负值存储在 float 中?

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com