Converting Integers to Floating-Point Formats
In the C programming language, conversions from integers stored in an integer format to floating-point formats are automatic when you assign an integer to a floating-point variable.
double d; int x = 1; d = x; /* value 1 automatically converted to double format */