Why this is happening?
I use the next codeline but some values are correct and others not, why it could be?
It's to do with how the values get stored in binary. There has been a rather protracted discussion about this on another thread yesterday.
For example, you might think you can store 0.1 exactly. Unfortunately, you can't.
The solution is to accept that many numbers don't have a finite representation in binary and just control the output when you want to display the number e.g.
LoL guys you have been very helpfull!
Thanks a lot.