fix bz987773, make max calculation use a floating point