Currently, Round and Trunc functions ignore the state of $OVERFLOWCHECKS
compiler directive. The following code prints -2 -2:
{$MODE OBJFPC}{$OVERFLOWCHECKS ON}
var
a: Integer;
b: Double;
begin
b := MaxInt;
a := Round(2.0 * b);
Writeln(a);
a := Trunc(2.0 * b);
Writeln(a);
end.
This
Alexander Klenin schrieb:
Currently, Round and Trunc functions ignore the state of $OVERFLOWCHECKS
compiler directive. The following code prints -2 -2:
{$MODE OBJFPC}{$OVERFLOWCHECKS ON}
var
a: Integer;
b: Double;
begin
b := MaxInt;
a := Round(2.0 * b);
Writeln(a);
a :=
On 13 Jun 2009, at 13:31, Alexander Klenin wrote:
Currently, Round and Trunc functions ignore the state of
$OVERFLOWCHECKS
compiler directive. The following code prints -2 -2:
{$MODE OBJFPC}{$OVERFLOWCHECKS ON}
var
a: Integer;
b: Double;
begin
b := MaxInt;
a := Round(2.0 * b);
On Sat, Jun 13, 2009 at 22:47, Jonas Maebejonas.ma...@elis.ugent.be wrote:
On 13 Jun 2009, at 13:31, Alexander Klenin wrote:
Currently, Round and Trunc functions ignore the state of $OVERFLOWCHECKS
compiler directive. The following code prints -2 -2:
In Borland-speak, these are not overflow
On 13 Jun 2009, at 14:27, Alexander Klenin wrote:
On Sat, Jun 13, 2009 at 22:47, Jonas
Maebejonas.ma...@elis.ugent.be wrote:
The difference between range and overflow errors is as follows:
* range errors occur when an implicit type conversion occurs from
one type
to another (e.g., when