Java Double Number Clamp clamp(double value, double min, double max)

Here you can find the source of clamp(double value, double min, double max)

Description

clamp

License

Open Source License

Declaration

public static double clamp(double value, double min, double max) 

Method Source Code

//package com.java2s;

public class Main {
    public static float clamp(float value, float min, float max) {
        return (value < min ? min : (value > max ? max : value));
    }//w  w  w  .j a  va2  s. c o  m

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

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

Related

  1. clamp(double value)
  2. clamp(double value, double low, double high)
  3. clamp(double value, double low, double high)
  4. clamp(double value, double low, double high)
  5. clamp(double value, double min, double max)
  6. clamp(double value, double min, double max)
  7. clamp(double value, double min, double max)
  8. clamp(double value, final double min, final double max)
  9. clamp(double var1, double var2, double var3)