Second floats are notorious for tiny little rounding errors.
Takes a float and an integer. Returns a float with the corners smoothed off. Instead of using the precision function above, you can just use printf's precision for floats. There are times when you don't want a number like .0002 to be truncated to .00 - where you'd like to actually have at least some number of significant digits, not just the decimal places. Here's a sample of how you might do that, although scientific notation might be better.