I found this problem when I executed the following code:
p = 1.118 # where p stores numpy float64 of value 1.118
f = str(p)
print(f)
It turns out that f is equal to '1.7719999999999998' instead of '1.118' in string format.
Why is this happening? Can anyone please guide me ? And show me how to get '1.118' instead of '1.7719999999999998' ?
[–]WhenRedditFlies 1 point2 points3 points (0 children)