Section 6.3 Converting Floats to Integers
Casting a float to an integer sets the data type for that stored
float
as an int
now, which means that instead of using mantissa and exponent to store the number, the binary 2’s complement is used. What happens if the original float had decimal places after the decimal point? Will they get lost? Will rounding occur? Try it out: