Java Integer Clamp clamp(int value, int min, int max)

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

Description

clamp

License

Open Source License

Declaration

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

Method Source Code

//package com.java2s;

public class Main {
    public static float clamp(float value, float min, float max) {
        float clamped = min > value ? min : value;
        return max < clamped ? max : clamped;
    }//from  w ww .  j a  va  2 s .  co  m

    public static int clamp(int value, int min, int max) {
        int clamped = min > value ? min : value;
        return max < clamped ? max : clamped;
    }
}

Related

  1. clamp(int value, int low, int high)
  2. clamp(int value, int low, int high)
  3. clamp(int value, int min, int max)
  4. clamp(int value, int min, int max)
  5. clamp(int value, int min, int max)
  6. clamp(int value, int min, int max)
  7. clamp(int value, int min, int max)
  8. clamp(int value, int min, int max)
  9. clamp(int value, int min, int max)