Ruby Float rationalize() method with example
Float rationalize() is a float class method which return the simple rational form (p/q) of a float value. Syntax: float.rationalize() Parameter: float value as argument Return: Simple approximation value Example #1: Ruby # Ruby program for rationalize() method # Initialize value a = 0.767 b = 2999.0