question: public static double trimToRange ( double untrimmedValue , double min , double max ) { return Math . max ( min , Math . min ( max , untrimmedValue ) ) ; }
target:  Trim the given value so that it is in the closed interval [min, max].