Android Int Clamp clamp(int x, int a, int b)

Here you can find the source of clamp(int x, int a, int b)

Description

clamp

Declaration

public static int clamp(int x, int a, int b) 

Method Source Code

//package com.java2s;

public class Main {
    public static int clamp(int x, int a, int b) {
        return (x < a) ? a : (x > b) ? b : x;
    }/*from w ww  .  ja v  a2  s.c  o m*/
}

Related

  1. clamp(int x, int a, int b)
  2. clamp(int x, int min, int max)