comparing floating point numbers in section we saw that some numberslike are not represented exactly on computer mathematicallyafter the code below executesx should be but because of accumulated errorsit is actually for in range( ) + this means that the following if statement will turn out falseif == more reliable way to compare floating point numbers and is to check to see if the difference between the two numbers is sufficiently smalllike belowif abs( - )< - fractions there is module called fractions for working with fractions here is simple example of it in actionfrom fractions import fraction fraction( fraction( print( +sfraction( you can do basic arithmetic with fraction objectsas well as compare themtake their absolute valuesetc here are some further examplesr fraction( fraction( print(sprint(abs( * - )if >sprint' is larger 'fraction( , fraction( , is larger note that fraction automatically converts things to lowest terms the example below shows how to get the numerator and denominatorr fraction( , numerator denominator