Java Double Number Clamp clamp01(double d)

Here you can find the source of clamp01(double d)

Description

clamp

License

Open Source License

Declaration

public static double clamp01(double d) 

Method Source Code

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

public class Main {
    public static double clamp01(double d) {
        if (d < 0)
            d = 0;//from   w ww .j  a  v  a  2  s .c  o  m
        else if (d > 1)
            d = 1;
        return d;
    }
}

Related

  1. clamp(double x, double min, double max)
  2. clamp(double x, double min, double max)
  3. clamp(double x, double xMin, double xMax)
  4. clamp(final double value, final double min, final double max)
  5. clamp(final double value, final double min, final double max)
  6. clamp01(double value)
  7. clamp255d(double d)
  8. clamp_double(double num, double min, double max)
  9. clamp_double(double p_151237_0_, double p_151237_2_, double p_151237_4_)