Java Float Number Clamp clamp(float input, float min, float max)

Here you can find the source of clamp(float input, float min, float max)

Description

clamp

License

Open Source License

Declaration

public static float clamp(float input, float min, float max) 

Method Source Code

//package com.java2s;

public class Main {
    public static float clamp(float input, float min, float max) {
        return (input < min) ? min : (input > max) ? max : input;
    }/* ww  w.j  a va  2 s  .c om*/

    public static double clamp(double input, double min, double max) {
        return (input < min) ? min : (input > max) ? max : input;
    }
}

Related

  1. clamp(float a, float min, float max)
  2. Clamp(float a, float min, float max)
  3. clamp(float f)
  4. clamp(float f, float min, float max)
  5. clamp(float f, float min, float max)
  6. clamp(float min, float max, float val)
  7. clamp(float min, float max, float value)
  8. clamp(float min, float x, float max)
  9. clamp(float n, float minValue, float maxValue)