You are managing the design of a temperature conversion for a temperature controller in software. One of the problems is that you get the temperature as a floating-point number (i.e 19.9892653), but the temperature controller only accepts a 16-bit integer that is 10 times the actual temperature (i.e. for 20.4 degrees, it wants 204).
The first time you try this with a simple cast:
int MyTemp = (int)(YourTemp * 10);
unfortunately you discover that this simply truncates the number, so if YourTemp comes in as 19.9892653,
MyTemp comes out as 199 instead of 200.
Perusing your C programming book, you realize that the math library has no proper rounding function, so you have to create one.
How do you do it?
Bear in mind that you also have to deal with temperatures below zero.