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

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

Method Source Code

//package com.java2s;

public class Main {
    private static int clamp(int x, int a, int b) {
        return (x < a) ? a : (x > b) ? b : x;
    }/*from  w ww.  j av a 2 s  . com*/
}

Related

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