Java Double Number Clamp clamp_doubleback(double a, double x, double y)

Here you can find the source of clamp_doubleback(double a, double x, double y)

Description

Returns the given double clamped between the two values.

License

Open Source License

Declaration

public static double clamp_doubleback(double a, double x, double y) 

Method Source Code

//package com.java2s;

public class Main {
    /**/*from  w w w.  j a  v  a2 s  .c  om*/
     * Returns the given double clamped between the two values.
     */
    public static double clamp_doubleback(double a, double x, double y) {
        double newA = Math.abs(Math.IEEEremainder(a, 2 * (y - x)));
        if (newA > y)
            newA = 2 * y - newA;
        return newA;
    }
}

Related

  1. clamp01(double d)
  2. clamp01(double value)
  3. clamp255d(double d)
  4. clamp_double(double num, double min, double max)
  5. clamp_double(double p_151237_0_, double p_151237_2_, double p_151237_4_)
  6. clamp_latitude(double lat)
  7. clampAngle(double angle)
  8. clampedLerp(double lowerBnd, double upperBnd, double slide)
  9. clampFloat(double in)