This is a Ruby tree! It shows every object from the Ruby Programming Language in a tree format.

rationalize

        # Float.rationalize

(from ruby core)
---
    flt.rationalize([eps])  ->  rational

---

Returns a simpler approximation of the value (flt-|eps| <= result <=
flt+|eps|).  If the optional argument `eps` is not given, it will be
chosen automatically.

    0.3.rationalize          #=> (3/10)
    1.333.rationalize        #=> (1333/1000)
    1.333.rationalize(0.01)  #=> (4/3)

See also Float#to_r.



      

This is MURDOC! A Ruby documentation browser inspired by Smalltalk-80. It allows you to learn about Ruby by browsing through its class hierarchies, and see any of its methods.