Round, not truncate when converting float to int.
Added test for values equalling max or min.
Removed unused clang function warning.