question: public static Size reduce ( Size aspectRatio ) { BigInteger width = BigInteger . valueOf ( aspectRatio . width ( ) ) ; BigInteger height = BigInteger . valueOf ( aspectRatio . height ( ) ) ; BigInteger gcd = width . gcd ( height ) ; int numerator = Math . max ( width . intValue ( ) , height . intValue ( ) ) / gcd . intValue ( ) ; int denominator = Math . min ( width . intValue ( ) , height . intValue ( ) ) / gcd . intValue ( ) ; return new Size ( numerator , denominator ) ; }
target:  Reduce an aspect ratio to its lowest common denominator. The ratio of the input and output sizes is guaranteed to be the same.