round

int.round([ndigits]) â integer or float Instance Public methods Rounds flt to a given precision in decimal digits (default 0 digits). Precision may be negative. Returns a floating point number when ndigits is positive, self for zero, and round down for negative. 1.round #=> 1 1.round(2) #=> 1.0 15.round(-1) #=> 20

rationalize

int.rationalize([eps]) â rational Instance Public methods Returns the value as a rational. The optional argument eps is always ignored.

prime_division

prime_division(generator = Prime::Generator23.new) Instance Public methods Returns the factorization of self. See Prime#prime_division for more details.

prime?

prime?() Instance Public methods Returns true if self is a prime number, false for a composite.

pred

int.pred â integer Instance Public methods Returns the Integer equal to int - 1. 1.pred #=> 0 (-1).pred #=> -2

ord

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.

odd?

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

numerator

int.numerator â self Instance Public methods Returns self.

next

int.next â integer Instance Public methods Returns the Integer equal to int + 1. 1.next #=> 2 (-1).next #=> 0

lcm

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