Very odd math mismatch when using IF...THEN

It seems to be a compiler issue.