c语言中浮点数的上溢

1、c语言中浮点值的上溢

#include <stdio.h>

int main(void)
{
    float test1 = 5.2e4 * 100.0f;
    float test2 = 5.2e40 * 100.0f;  //超出float类型可以表示的范围。
    
    printf("test1: %e.
", test1);
    printf("test2: %e.
", test2);
    
    return 0;
}

原文地址:https://www.cnblogs.com/liujiaxin2018/p/15037251.html