¡@

Home 

javascript Programming Glossary: gcd

Whats the algorithm to calculate aspect ratio? I need an output like: 4:3, 16:9

http://stackoverflow.com/questions/1186414/whats-the-algorithm-to-calculate-aspect-ratio-i-need-an-output-like-43-169

you get 4x3 or 4 3. A recursive GCD algorithm function gcd a b if b 0 return a return gcd b a mod b In C static int gcd.. GCD algorithm function gcd a b if b 0 return a return gcd b a mod b In C static int gcd int a int b return b 0 a gcd b.. a b if b 0 return a return gcd b a mod b In C static int gcd int a int b return b 0 a gcd b a b int main void printf gcd..

Is there a javascript function that reduces a fraction

http://stackoverflow.com/questions/4652468/is-there-a-javascript-function-that-reduces-a-fraction

dividing by it. function reduce numerator denominator var gcd function gcd a b return b gcd b a b a gcd gcd numerator denominator.. it. function reduce numerator denominator var gcd function gcd a b return b gcd b a b a gcd gcd numerator denominator return.. numerator denominator var gcd function gcd a b return b gcd b a b a gcd gcd numerator denominator return numerator gcd denominator..