Java tutorial
//package com.java2s; public class Main { public static boolean isAspectRatio16_9(int width, int height) { if (width < height) { int tmp = width; width = height; height = tmp; } double ratio = (double) width / height; if (Math.abs(ratio - 16.0 / 9.0) < 0.02) { return true; } return false; } }