Here you can find the source of minPos(int a, int b)
public static int minPos(int a, int b)
//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); } }