ceil on min, floor on max