[fpc-pascal] LongWord

Bernd Mueller mueller.b at gmx.net
Mon May 7 15:14:45 CEST 2007


Jonas,

> On 7 mei 2007, at 14:15, Carsten Bager wrote:
> 
>> I have written a small demo program that gives a runetime error when it
>> runs.
>> Is it the compiler or is it me?
> 
> See http://www.freepascal.org/mantis/view.php?id=8321 for a long 
> discussion on this topic.
> 
I think I have hit a similar case with the following code:

{$mode objfpc}{$H+}
program test; { FPC 2.0.4}
var
    w: Word;
begin
    w:= 5555;
    if lo(w) <> lo(w + (5 - 5)) then
       writeln('This is a little bit unexpected');
end.

What would you suggest as a "workaround"? Using the mod operator?

Regards, Bernd.



More information about the fpc-pascal mailing list