Fix float/double conversion warnings by using fmaxf and fminf instead of
fmax and fmin.