Whole Number Ratios
Algorithms
2
Posts
2
Posters
5
Views
1
Watching
-
Does anyone know of a good algorithm for calculating minimum whole number ratios. For instance: 800x600 would be 4x3 300x110 would be 30x11 250x150 would be 5x3 thanks in advance
Simply divide by the greatest common divisor (gcd) 800x600 gcd(800,600)=200 so you get 4x3 etc You calculate gcd using Euclid's algorithm, Wikipedia article[^]
Peter "Until the invention of the computer, the machine gun was the device that enabled humans to make the most mistakes in the smallest amount of time."