[fpc-devel] -1 mod 3

Marco van de Voort marcov at stack.nl
Mon Oct 27 13:31:53 CET 2008


In our previous episode, Dmitry Lizorkin said:
> I was surprised to find out that the expression (-1 mod 3) yields -1 in Free 
> Pascal. On the other hand, Pascal ISO 7185:1990, section 6.7.2.2) explicitly 
> defines the `mod' operation "such that 0 <= i mod j < j".
> What do i miss here?

FPC is Delphi compatible and Delphi returns -1.



More information about the fpc-devel mailing list