Java Float Number Clamp clamp(float value)

Here you can find the source of clamp(float value)

Description

clamp

License

Open Source License

Declaration

public static final float clamp(float value) 

Method Source Code

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

public class Main {
    public static final float clamp(float value) {
        return clamp(value, 0f, 1f);
    }//from   w  w  w  .  ja  va 2  s . c  o  m

    public static final float clamp(float value, float min, float max) {
        return value > max ? max : value < min ? min : value;
    }
}

Related

  1. clamp(float val, float low, float high)
  2. clamp(float val, float max, float min)
  3. clamp(float val, float min, float max)
  4. clamp(float val, float min, float max)
  5. Clamp(float val, float minVal, float maxVal)
  6. Clamp(float value, float lowerLimit, float upperLimit)
  7. clamp(float value, float min, float max)
  8. clamp(float value, float min, float max)
  9. clamp(float value, float min, float max)