Float rationalize() is a float class method which return the simple rational form (p/q) of a float value.
Parameter: float value as argument
Return: Simple approximation value
Rationalizing a : 767/1000 Rationalizing b : 2999011/1000
Rationalizing a : 10/13 Rationalizing b : 1634461/545 Rationalizing c : 2/1
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.