SRL Archive - General

Scar doesnt perform operations to fractions?


Infantry001

2007-05-03 23:33:22

Try this:

TheTime := Round(1000 / (30 / 60));
Writeln(IntToStr(TheTime));

This causes a divide by zero error. But the result should be 2000.

If there is another way to go about this, let me know! And if this isnt meant to be in Scar, Freddy, can you implement it in?

rader720

2007-05-03 23:57:37

ok well this is anyoing me too actually : / for some reason it dosent like seeing multiple devisions going on during it but if u dont absolutley need for it to calculate 30/60 during runtime you can use:

program New;
var TheTime:Extended;
begin
TheTime:=(1000 / 0.5);
writeln(FloatToStr(TheTime));
end.
tht gets the desired results

Freddy1990

2007-05-04 01:32:37

  TheTime := Round(1000 / (30 / 60.0));
Writeln(IntToStr(TheTime));