Java Number Min Value minPos(int a, int b)

Here you can find the source of minPos(int a, int b)

Description

min Pos

License

Open Source License

Declaration

public static int minPos(int a, int b) 

Method Source Code

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

public class Main {
    public static int minPos(int a, int b) {
        if (a < 0) {
            return b;
        }//from   www . ja va2 s .c  o  m
        if (b < 0) {
            return a;
        }
        return Math.min(a, b);
    }

    public static double minPos(double a, double b) {
        if (a < 0) {
            return b;
        }
        if (b < 0) {
            return a;
        }
        return Math.min(a, b);
    }
}

Related

  1. minMaxNormalize(double min, double max, double value)
  2. minNot0(double i1, double i2)
  3. minNotMinus1(int i1, int i2)
  4. minOfThree(final long a, final long b, final long c)
  5. minP(int a, long b)
  6. minPos(int a, int b)
  7. minPositive(int a, int b)
  8. minPower2(int n)
  9. minRunLength(int n)