Es gibt 2 Arten zu Teilen:
1. div = ganzahlige Division => 10 div 3 = 3
2. / = Division => 10 / 3 = 3,33333333333...
Jetzt kommt es auf den Typ der
Ergebnisvariable an. Bei Ganzahl-Variablen (Integer, Cardinal, Byte) musst du
div benutzen.
Bei Fließkomma-Variablen (real, single, double, extended) musst du
/ benutzen.
Beispiel:
Quelltext
1: 2: 3:
| a, b, c: Integer; c := a div b //funktioniert einwandfrei c := a / b //ergibt deinen Fehler |
There are only 10 types of people: those who understand binary and those who don't.