When taking large floating input(eg:2.99999999999999999999). Python converts it to 3.0
How do i avoid such conversion, so that i get 2.99999999... as the value stored.
When taking large floating input(eg:2.99999999999999999999). Python converts it to 3.0
How do i avoid such conversion, so that i get 2.99999999... as the value stored.
Floating point numbers in python are finite precision. If you really need arbitrary precision, libraries such as mpmath are available.
Look at the decimal module (class Decimal) for fixed point.
LambdaGrok. | #ubuntu-programming on FreeNode
There are string based libraries in C++ and java for handling arbitrarily large numbers, you should see if they exist for python.
Bookmarks