I've posted two examples below.
In the first example, I use the equal-to operator and the while process continues forever instead of breaking when it should.
In the second example, I use the greater-than-or-equal-to operator, and the process breaks when it should.
How is this even possible?
EXAMPLE 1:
Integer myVar1 = 42985;
Integer myVar2 = 1;
while (true)
{
if (myVar2 == myVar1)
{
break;
}
++ myVar2;
}
EXAMPLE 2:
Integer myVar1 = 42985;
Integer myVar2 = 1;
while (true)
{
if (myVar2 >= myVar1)
{
break;
}
++ myVar2;
}
EDIT: Thank you everyone for the great answers! I fully understand the problem now and this new information explained several strange behaviors that I've encountered in my apps. I wish I could choose more than one best answer.