Java Number Range Check inRange(double value, double lower, double upper)

Here you can find the source of inRange(double value, double lower, double upper)

Description

Check if a value is within a given range

License

Open Source License

Parameter

Parameter Description
value the value to check
lower the lower bound
upper the upper bound

Return

true if the value is in between the lower and upper bounds, else

Declaration

public static boolean inRange(double value, double lower, double upper) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    /**//from  w w  w .j a  v  a  2s  .  co m
     * Check if a value is within a given range
     * @param value the value to check
     * @param lower the lower bound
     * @param upper the upper bound
     * @return true if the value is in between the lower and upper bounds, else
     */
    public static boolean inRange(double value, double lower, double upper) {
        return value >= lower && value < upper;
    }
}

Related

  1. inRange(double lat, double lon)
  2. inRange(double query, double min, double max)
  3. inRange(double value, double min, double max)
  4. inRange(double value, double min, double max)
  5. inRange(double value, double target, double range)
  6. inRange(double x, double y, double z, double sx, double sy, double sz, double r)