SRL Archive - General

Bug in SCAR


Gu3st...

2008-01-22 12:47:19

program L337Calculator;

const
Question = 664*2+4/2+2*7/3+2.9+0.099999999999;

begin
ClearDeBug;
if Question = 1337 then
begin
Writeln('LEET Calculator Made by ZYTEX');
Writeln(FloatToStr(Question));
end else
Writeln(FloatToStr(Question));
end.

As you can see: The program will print out 'LEET Calculator Made by ZYTEX' if the answer is 1337, but now it only prints out 1337.. :p

EDIT: Add 1 more '9' to the Question and then it will print 'LEET Calculator Made by ZYTEX'

EDIT2: Make the Question this: 664*2+4/2+2.0*7/3+2.9+0.099999999999; I only added '.0' It prints out '1337,66666666667'…

mastaraymond

2008-01-22 12:52:37

Not the right spot to post bugs.
This is :
http://www.freddy1990.com/forums/index.php?board=15.0

Anyway try this.

program L337Calculator;

const
Question = 664*2+4/2+2*7/3+2.9+0.099999999999;

begin
ClearDeBug;
if Round(Question) = 1337 then
begin
Writeln('LEET Calculator Made by ZYTEX');
Writeln(FloatToStr(Question));
end else
Writeln(FloatToStr(Question));
end.

Gu3st...

2008-01-22 12:55:55

what does that does?

EDIT: I mean the Round()

mastaraymond

2008-01-22 12:58:58

From: zytex
what does that does?

EDIT: I mean the Round()

Converts an integer to an extended.


program Hoi;
begin
Writeln(inttostr(Round(5.5)));
Writeln(inttostr(Round(5.9)));
Writeln(inttostr(Round(5.4)));
Writeln(inttostr(Round(5.4999999999999)));
end.