Never never never...

… never forget that the result of the “integer” division 43 is equal to 1 instead of 1.333333333… in, I think, almost all programming languages. This is because it’s the division between two integers. Only in Python3 it will give what we expect. It’s a detail, and I usually remember it and I write 4./3 (4. is of type “float”), but this time I forget it, and I have obtained wrong results for a week. I didn’t understand why and I’ve searched any possible complex and deep explanation. But it was one of the most simple and stupid errors!:P

Moreover, always check every new result with the older ones. I didn’t do this, and I find strange results after two months of computing. Next time, remember to check EVERY new results!

Tags// ,
comments powered by Disqus