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]
int.integer? â true Instance Public methods Always returns true.
int.lcm(int2) â integer Instance Public methods Returns the least common multiple (always positive). 0.lcm(x) and x.lcm(0) return zero. 2.lcm(2) #=> 2 3.lcm(-7) #=> 21 ((1<<31)-1).lcm((1<<61)-1) #=> 4951760154835678088235319297
int.next â integer Instance Public methods Returns the Integer equal to int + 1. 1.next #=> 2 (-1).next #=> 0
int.numerator â self Instance Public methods Returns self.
int.odd? â true or false Instance Public methods Returns true if int is an odd number.
int.ord â self Instance Public methods Returns the int itself. ?a.ord #=> 97 This method is intended for compatibility to character constant in Ruby 1.9. For example, ?a.ord returns 97 both in 1.8 and 1.9.
int.pred â integer Instance Public methods Returns the Integer equal to int - 1. 1.pred #=> 0 (-1).pred #=> -2
prime?() Instance Public methods Returns true if self is a prime number, false for a composite.
prime_division(generator = Prime::Generator23.new) Instance Public methods Returns the factorization of self. See Prime#prime_division for more details.
Page 384 of 11844