Method: Blufin::Image.gcd
- Defined in:
- lib/core/image.rb
.gcd(a, b) ⇒ Object
Gets the greatest-common-denominator. Used to calculate screen aspect ratio. See: stackoverflow.com/questions/14731745/what-exactly-does-do-in-javascript
124 125 126 127 128 129 |
# File 'lib/core/image.rb', line 124 def self.gcd(a, b) a = a.to_i b = b.to_i return a if b == 0 gcd(b, a % b) end |