Java Float Number Clamp clamp(final float min, final float x, final float max)

Here you can find the source of clamp(final float min, final float x, final float max)

Description

Clamps the input x between min and max

License

Open Source License

Declaration

public static float clamp(final float min, final float x, final float max) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /** Clamps the input x between min and max */
    public static float clamp(final float min, final float x, final float max) {
        return Math.max(min, Math.min(x, max));
    }/*  w ww .j  a  v a 2 s .c  om*/
}

Related

  1. clamp(final float num, final float bound1, final float bound2)
  2. clamp(final float v, final float min, final float max)
  3. clamp(final float val, final float min, final float max)
  4. clamp(final float value, final float min, final float max)