Question : Displaying more digits in Decimal form of Fractions

It looks like python only provides 10 digits for precision for fractions. Is there any way to set  fractions to a desired number of digits?

Answer : Displaying more digits in Decimal form of Fractions

Consider using the decimal package for floating point if you like more precision. It is quite a different type, but it does not have the limitations of the floating point rounding problems: http://docs.python.org/library/decimal.html

On precision and on why you cannot get so many digits (after some point it starts to look uncannily weird) is explained here: http://docs.python.org/tutorial/floatingpoint.html

Random Solutions  
 
programming4us programming4us