Here you can find the source of clampMin(double input, double min)
Parameter | Description |
---|---|
input | The number to clamp. |
min | The minimum value input is allowed to have. |
public static double clampMin(double input, double min)
//package com.java2s; /*/*from www . j a v a2 s. c om*/ * Copyright (c) 2014 mgamelabs * To see our full license terms, please visit https://github.com/mgamelabs/mengine/blob/master/LICENSE.md * All rights reserved. */ public class Main { /** * Ensures that a number is bigger than a given value. * * @param input The number to clamp. * @param min The minimum value {@code input} is allowed to have. * @return {@code input}, if it is bigger than {@code min}. Otherwise {@code min} is returned. */ public static double clampMin(double input, double min) { if (input < min) return min; else return input; } }