Java Float Number Clamp clamp1f(float f)

Here you can find the source of clamp1f(float f)

Description

clampf

License

BSD License

Declaration

public final static float clamp1f(float f) 

Method Source Code

//package com.java2s;
/**/*from  w  w w.  j ava2  s .c o m*/
 * This class is part of JCodec ( www.jcodec.org ) This software is distributed
 * under FreeBSD License
 * 
 * Downmixes PCM audio data into 16 bit stereo track
 * 
 * @author The JCodec project
 * 
 */

public class Main {
    public final static float clamp1f(float f) {
        if (f > 1f)
            return 1f;
        if (f < -1f)
            return -1f;
        return f;
    }
}

Related

  1. clamp(float value, float minimum, float maximum)
  2. clamp(float value, float minimum, float maximum)
  3. clamp(float x, float a, float b)
  4. clamp(float x, float y, float z)
  5. clamp180(float r1, float r2)
  6. clamp360(float dir)
  7. clamp_float(float p_76131_0_, float p_76131_1_, float p_76131_2_)
  8. clampAngle(float value, float min, float max)
  9. clampAngle(float var, float min, float max)