Variable below zero but if statement doesn't grab?

SimonN via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sun Dec 27 09:37:55 PST 2015


On Sunday, 27 December 2015 at 16:52:39 UTC, TheDGuy wrote:
> I don't understand why my program goes into the if statement if 
> the debugger shows, that the variable "discriminant" is below 
> zero even though:
>
> "if(discriminant > 0)"?

I have a hard time believing this. Does the problem persist if 
you swap out the entire control flow, beginning with that line, 
with the following?

         if (discriminant > 0)
                 writeln("bigger than zero");
         else
                 writeln("not entering the 'if'");


More information about the Digitalmars-d-learn mailing list