Discovery, (int)fpi will truncate the value to an integer. If you want to round to the nearest integer value you would need to add 0.5 if fpi is positive, or subtract 0.5 if it is negative. I thought I would let you know just in case you wanted to get the nearest integer value.
Comments
It's built-in for C programming.
Discovery