Here you can find the source of rangeCheck(double value)
Parameter | Description |
---|---|
IllegalArgumentException | if range is wrong |
public static double rangeCheck(double value)
//package com.java2s; //License from project: Apache License public class Main { /**/*from ww w .j av a2s.c o m*/ * Checks 0..1 range * * @throws IllegalArgumentException if range is wrong */ public static double rangeCheck(double value) { if ((value < 0.0) || (value > 1.0)) { throw new IllegalArgumentException( "Humanity should been between 0.0 and 1.0!"); } else { return value; } } }