Problems when dividing
For some reason, when dividing, it randomly doesn't work for me. I have done a fresh installation, so just want a couple of people to check they get the same result as I do.
Running this:
SCAR Code:
program New;
var
a: Extended;
begin
a:= 10/4;
{a:= 100/4;
a:= a/10;}
if(a=2.5)then Writeln('a is correct')
else if(a=2)then Writeln('a has been rounded down')
else if(a=3)then Writeln('a has been rounded down')
else Writeln('a doesn''t round and is incorrect');
end.
When I run that, I get 'a has been rounded in the debug'. When I comment out the first 'a:=' line and uncomment the other 2 'a:=' lines, it gives me 'a is correct'. So I'm just wondering, is this a scar error or am I just get something very wrong, as last time I checked, 10/4 = 2.5, yet when a:= 10/4, a=2, which makes no sense to me.
By reading this signature you agree that mixster is superior to you in each and every way except the bad ways but including the really bad ways.