If you write double x = 0.1 + 0.2;, you might expect x == 0.3 to be true. It is often false because of tiny rounding errors in how 0.1 and 0.2 are stored. When you print x, it might show 0.30000000000000004.
This is not a bug - it is how floating-point math works in all programming languages. To check if two doubles are equal, write abs(x - 0.3) < 0.000001 instead of x == 0.3. This checks if they are close enough.