Android examples for java.lang:Integer
Find out greatest common divisor
//package com.java2s; public class Main { public static int gcd(int a, int b) { int min = a; int max = b; if (a > b) { min = b;/*from w w w . j av a 2 s . c o m*/ max = a; } if (min == 0) return max; else return gcd(min, max - min); } }