Java Float Number Clip clip(float value, float bottom, float top)

Here you can find the source of clip(float value, float bottom, float top)

Description

clip

License

Open Source License

Declaration

public static float clip(float value, float bottom, float top) 

Method Source Code

//package com.java2s;

public class Main {
    public static float clip(float value, float bottom, float top) {
        return (value < bottom) ? bottom : (value > top) ? top : value;
    }/* w w w  .ja  v a2 s  . c o  m*/

    public static int clip(int value, int bottom, int top) {
        return (value < bottom) ? bottom : (value > top) ? top : value;
    }
}

Related

  1. clip(float f, float lo, float hi)
  2. clip(float x)
  3. clipf(float num, float mini, float maxi)
  4. clipFloat(float value, float min, float max)
  5. clipNormalized(final float a)