Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Transformation from integer type to real number type in C language
Transformation from integer type to real number type in C language
In C language, integer operation and real number operation are two different operations, which are different from mathematics.

For example:

int a= 1,b = 2;

A/b=0, not 0.5.

Floating point numbers a= 1, b = 2;;

a/b=0.5

Therefore, in the mixed operation of integer and real number types, the integer type should be converted into real number type before the operation.