sqrt() of int type in C

前端 未结 4 1998
春和景丽
春和景丽 2020-12-11 19:27

I am programming in the c language on mac os x. I am using sqrt, from math.h, function like this:

int start = Data -> start_number;
double localSum;

for          


        
4条回答
  •  不知归路
    2020-12-11 20:06

    Int can be safely upcast automatically to a double because there's no risk of data loss. The reverse is not true. To turn a double to an int, you have to explicitly cast it.

提交回复
热议问题