程序里面带有浮点数,默认会自动转换为double类型存储

                                                    带有浮点数,默认会转换为double类型存储。 

                                                   

#include "common.h"
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

static float test_equation = 0;

int main()
{


    //只有一个4.0类型,却可以说double类型
    test_equation = 18 / 4 * sqrt(4.0) / 8;
    

    while (1)
    {
        getchar();
    }

    return 0;
} 
一勤天下无难事。
原文地址:https://www.cnblogs.com/nowroot/p/12374122.html