Here you can find the source of inRange(final float testNum, final float min, final float max)
testNum
in range?
Parameter | Description |
---|---|
testNum | Number to test. |
min | Left endpoint of range. |
max | Right endpoint of range. |
public static boolean inRange(final float testNum, final float min, final float max)
//package com.java2s; /*L// w ww.j a v a 2 s. c o m * Copyright RTI International * * Distributed under the OSI-approved BSD 3-Clause License. * See http://ncip.github.com/webgenome/LICENSE.txt for details. */ public class Main { /** * Is <code>testNum</code> in range? * @param testNum Number to test. * @param min Left endpoint of range. * @param max Right endpoint of range. * @return T/F. */ public static boolean inRange(final float testNum, final float min, final float max) { boolean in = false; if (!Float.isNaN(testNum)) { in = testNum >= min && testNum <= max; } return in; } }