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