Positive float
Input
convert_float_to_int(3.9)
Output
3
The fractional part .9 is dropped, producing 3.
Full lesson preview
Convert a floating-point number to an integer by truncating the fractional part.
Problem statement
Task
Examples
Input
convert_float_to_int(3.9)
Output
3
The fractional part .9 is dropped, producing 3.
Input format
Output format
Constraints
Samples
Input
convert_float_to_int(-2.7)
Output
-2
Negative floats truncate toward zero, so -2.7 -> -2.