0
Is it possible in python, that for example 3.8-3 is 0.8000000000.... or with any other integer?
6 Answers
+ 2
Without writing your own class and overriding the operation magic methods (assumedly to do it in strings), there's "import mpmath"
http://mpmath.org
because...here's 0.8 natively in straight Python:
print("{:.52f}".format(0.8))
0.8000000000000000444089209850062616169442667236328125
0
Oh I meant float* not integer
0
I want that:
Input:
x=3.8
z=x-int (x)
Output: 0.8
0
print (z)***
- 1
what exactly u wantt
- 1
its floting point precision..
ans will be like that
0.799999999998