Java Number Min Value minNotMinus1(int i1, int i2)

Here you can find the source of minNotMinus1(int i1, int i2)

Description

Get min reject -1

License

Apache License

Parameter

Parameter Description
i1 a parameter
i2 a parameter

Return

min reject -1

Declaration

public static int minNotMinus1(int i1, int i2) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    /**//from   w w w .  j  a va 2 s  .c o  m
     * Get min reject -1
     * @param i1
     * @param i2
     * @return min reject -1
     */
    public static int minNotMinus1(int i1, int i2) {
        if (i1 == -1) {
            if (i2 > -1)
                return i2;
            else
                return -1;
        } else {
            if (i2 > -1 && i2 < i1)
                return i2;
            else
                return i1;
        }
    }
}

Related

  1. minMax(int value, int min, int max)
  2. minMax(long x, long y, boolean max)
  3. minMaxInt(Long i1, String s, boolean max)
  4. minMaxNormalize(double min, double max, double value)
  5. minNot0(double i1, double i2)
  6. minOfThree(final long a, final long b, final long c)
  7. minP(int a, long b)
  8. minPos(int a, int b)
  9. minPos(int a, int b)