Java Float Number Clamp clamp(float min, float max, float value)

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

Description

clamp

License

Open Source License

Declaration

public static float clamp(float min, float max, float value) 

Method Source Code

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

public class Main {
    public static double clamp(double min, double max, double value) {
        if (min > value)
            return min;
        if (max < value)
            return max;
        return value;
    }// w ww  .  j av a 2 s  .  co  m

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

Related

  1. clamp(float f)
  2. clamp(float f, float min, float max)
  3. clamp(float f, float min, float max)
  4. clamp(float input, float min, float max)
  5. clamp(float min, float max, float val)
  6. clamp(float min, float x, float max)
  7. clamp(float n, float minValue, float maxValue)
  8. clamp(float num, float min, float max)
  9. clamp(float v)