[fpc-devel] Overflow checks and Trunc/Round functions

2009-06-13 Thread Alexander Klenin
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

Re: [fpc-devel] Overflow checks and Trunc/Round functions

2009-06-13 Thread Florian Klaempfl
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 :=

Re: [fpc-devel] Overflow checks and Trunc/Round functions

2009-06-13 Thread Jonas Maebe
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);

Re: [fpc-devel] Overflow checks and Trunc/Round functions

2009-06-13 Thread Alexander Klenin
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

Re: [fpc-devel] Fix to colour filling in the Poly procedure (Graph unit)

2009-06-13 Thread borsa77
On 12 Jun 2009 at 16:56, Florian Klaempfl wrote: See the DirectPutpixel call in graph.inc line 848: { x1 mod 8 } if RevBitArray[x1 and 7] and TmpFillPattern 0 then DirectPutpixel(x1,y) else Imo

Re: [fpc-devel] Overflow checks and Trunc/Round functions

2009-06-13 Thread Jonas Maebe
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