Java Float Number Clamp Clamp(float a, float min, float max)

Here you can find the source of Clamp(float a, float min, float max)

Description

Clamp

License

Open Source License

Declaration

public static float Clamp(float a, float min, float max) 

Method Source Code

//package com.java2s;

public class Main {
    public static float Clamp(float a, float min, float max) {
        if (a < min) {
            return min;
        } else if (a > max) {
            return max;
        } else {/*from  w w  w  . j  av a  2s .co  m*/
            return a;
        }
    }
}

Related

  1. clamp(final float v, final float min, final float max)
  2. clamp(final float val, final float min, final float max)
  3. clamp(final float value, final float min, final float max)
  4. clamp(final float x, final float a, final float b)
  5. clamp(float a, float min, float max)
  6. clamp(float f)
  7. clamp(float f, float min, float max)
  8. clamp(float f, float min, float max)
  9. clamp(float input, float min, float max)