Folgender Code,
Code: Alles auswählen
var
i: Integer;
x: single;
begin
x := 0.5;
for i:= 0 to 10 do begin
WriteLn('Input:', x: 10: 5, ' round: ', Round(x));
x := x + 1.0;
end;
WriteLn();
end;
Code: Alles auswählen
Input: 0.50000 round: 0
Input: 1.50000 round: 2
Input: 2.50000 round: 2
Input: 3.50000 round: 4
Input: 4.50000 round: 4
Input: 5.50000 round: 6
Input: 6.50000 round: 6
Input: 7.50000 round: 8
Input: 8.50000 round: 8
Input: 9.50000 round: 10
Input: 10.50000 round: 10
Wen ich anstelle von Single Double nehme, habe ich den gleichen Fehler.