Improve floating-point number handling

This pull request enables warnings for suspicious implicit casts, and fixes all warnings generated by enabling those warnings.

This involved switching from the use of float or double-specific functions (for example, floor vs floorf) to using CGFloat as the floating-point type and <tgmath.h> for the function prototypes. This results in code that works correctly and with the native floating-point width on both 32-bit and 64-bit platforms, and is warning-free!
Good catch! I'll make a fixed pull request shortly.