Ruby Newbie homepage Ruby Newbie homepage

How to use

Quick guide

Official content
Returns the value as a rational.
1.to_r        #=> (1/1)
(1<<64).to_r  #=> (18446744073709551616/1)
 
               static VALUE
integer_to_r(VALUE self)
{
    return rb_rational_new1(self);
}
            

Was this page useful?