Java Float Number Clamp clampLevel(float level)

Here you can find the source of clampLevel(float level)

Description

clamp Level

License

Open Source License

Declaration

public static float clampLevel(float level) 

Method Source Code

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

public class Main {
    public static float clampLevel(float level) {
        if (level <= 0.1f)
            return 0.1f;
        if (level >= 0.9f)
            return 1.0f;
        return level;
    }//  w ww  .  j  a  v a 2s.  c  o  m
}

Related

  1. clampAngle(float var, float min, float max)
  2. clampBounds(float[] target, float[] clamp)
  3. clampColour(float value)
  4. clampDegree0To360(float degree)
  5. clampFloat(float value, float minimum, float maximum)
  6. clampLevel(float level)
  7. clampNumberFromTime(long ms, float seconds)
  8. clampPercentage(float value)
  9. clampRoundByte(float in)