Here you can find the source of clip(final int value)
Parameter | Description |
---|---|
value | the value to clip |
public static final int clip(final int value)
//package com.java2s; //License from project: Open Source License public class Main { /**/*from w w w . jav a 2s .co m*/ * Clip a value for compare * * @param value the value to clip * @return the value in the range [-1, 1] */ public static final int clip(final int value) { if (value <= -1) { return -1; } if (value >= 1) { return 1; } return 0; } }