Method: Integer#to_r

Defined in:
rational.c

#to_rObject

Returns the value as a rational.

1.to_r        #=> (1/1)
(1<<64).to_r  #=> (18446744073709551616/1)


2152
2153
2154
2155
2156
# File 'rational.c', line 2152

static VALUE
integer_to_r(VALUE self)
{
    return rb_rational_new1(self);
}