@Test
public void clampDoubleDoubleDouble() {

	// NaN is lower than all the other floating-point values 
	
	double min = (getRandom().nextDouble() - getRandom().nextDouble()) * 1000.;
	double max = min + getRandom().nextDouble() * 1000.;
	
	assertEpsilonEquals(min, MathUtil.clamp(Double.NEGATIVE_INFINITY, min, max));
	assertEpsilonEquals(max, MathUtil.clamp(Double.POSITIVE_INFINITY, min, max));
	assertEpsilonEquals((min+max)/2.f, MathUtil.clamp((min+max)/2.f, min, max));
	assertEpsilonEquals(max, MathUtil.clamp(Math.abs(max)*2.f, min, max));
}