JAL-3032 use Math.min/max not Float.min/max