the best way to calculate the equation is simplified. That is, find the maximum divisor between two numbers and divide:
ex.
1920:1080 maximum common divisor 120 = 16:9
1024:768 maximum common divisor 256 = 4:3
1280:768 maximum common divisor 256 = 5:3
may happen also some approaches