integer?

int.integer? â true Instance Public methods Always returns true.

gcdlcm

int.gcdlcm(int2) â array Instance Public methods Returns an array; [int.gcd(int2), int.lcm(int2)]. 2.gcdlcm(2) #=> [2, 2] 3.gcdlcm(-7) #=> [1, 21] ((1<<31)-1).gcdlcm((1<<61)-1) #=> [1, 4951760154835678088235319297]

gcd

int.gcd(int2) â integer Instance Public methods Returns the greatest common divisor (always positive). 0.gcd(x) and x.gcd(0) return abs(x). 2.gcd(2) #=> 2 3.gcd(-7) #=> 1 ((1<<31)-1).gcd((1<<61)-1) #=> 1

floor

int.floor â integer Instance Public methods As int is already an Integer, all these methods simply return the receiver.

even?

int.even? â true or false Instance Public methods Returns true if int is an even number.

each

each() Instance Public methods Alias for: times

downto

int.downto(limit) {|i| block } â selfint.downto(limit) â an_enumerator Instance Public methods Iterates block, passing decreasing values from int down to and including limit. If no block is given, an enumerator is returned instead. 5.downto(1) { |n| print n, ".. " } print " Liftoff!\n" produces: 5.. 4.. 3.. 2.. 1.. Liftoff!

denominator

int.denominator â 1 Instance Public methods Returns 1.

chr

int.chr([encoding]) â string Instance Public methods Returns a string containing the character represented by the receiver's value according to encoding. 65.chr #=> "A" 230.chr #=> "\346" 255.chr(Encoding::UTF_8) #=> "\303\277"

ceil

int.ceil â integer Instance Public methods As int is already an Integer, all these methods simply return the receiver.