Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Integer variables are divided by floating-point constants and assigned to integer variables.
Integer variables are divided by floating-point constants and assigned to integer variables.
//Programming can be written directly:

int a,b;

b = a/ 1.3;

//When doing operation a/ 1.3, the compiler implicitly converts A into a floating-point type and gets a floating-point result, which is recorded as A..

//After getting the floating-point result A, do the assignment b=A, and the compiler does implicit type conversion, which can be understood as B = (int) A.

//finally, b is the upward integer value of a.

//If the written specification can be written as:

int a,b;

b =(int)(a/ 1.3);