what is the difference between the Fraction class constructor and from_float in Python
I am using the class constructor Fraction to create fractions. What is the difference between using the Fraction class constructor and from_float method when creating fractions from floating-point numbers? I tested it with different numbers and I got same answers. for instance: from fractions import Fraction f1 = Fraction(0.3) f2 = Fraction.from_float(0.3) print(f1) # Output:… Read More what is the difference between the Fraction class constructor and from_float in Python