Double will work in the example, but there are several examples where double would fail too. The fact is, any kind of floating point representation is an approximation and can throw up bugs in the most unexpected places. Using an 'epsilon' style comparison is usually more reliable, and there are...