Created
January 20, 2016 16:52
-
-
Save jcburns/b5264429062d2ba1a805 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var maxpixels = [5472, 3648]; | |
function reduce(numerator,denominator){ | |
var gcd = function gcd(a,b){ | |
return b ? gcd(b, a%b) : a; | |
}; | |
gcd = gcd(numerator,denominator); | |
return [numerator/gcd, denominator/gcd]; | |
} | |
reduce(maxpixels[0],maxpixels[1]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment