notice that this is different from floating-point-type mathwhich is constrained by the underlying limitations of floating-point hardware to comparehere are the same operations run with floating-point objectsand notes on their limited accuracy--they may display fewer digits in recent pythons than they used tobut they still aren' exact values in memorya only as accurate as floating-point hardware can lose precision over many calculations - this floating-point limitation is especially apparent for values that cannot be represented accurately given their limited number of bits in memory both fraction and decimal provide ways to get exact resultsalbeit at the cost of some speed and code verbosity for instancein the following example (repeated from the prior section)floating-point numbers do not accurately give the zero answer expectedbut both of the other types do - this should be zero (closebut not exactfrom fractions import fraction fraction( fraction( fraction( fraction( fraction( from decimal import decimal decimal(' 'decimal(' 'decimal(' 'decimal(' 'decimal(' 'moreoverfractions and decimals both allow more intuitive and accurate results than floating points sometimes canin different ways--by using rational representation and by limiting precision use in python for true "/fraction( fraction( numeric accuracytwo ways import decimal decimal getcontext(prec decimal( decimal( decimal(' 'other numeric types