The reason behind that is likely not 'bugs in programming' at all, it is a well documented effect of floating point maths which has been asked about numerous times on this forum and elsewhere on the web.
Floating point numbers cannot be represented 100% accurately so small errors creep into maths involving them.