On 14 Jan 2013, at 16:44, Martin wrote:

This is casting a "set of bits" (neither signed, nor unsigned - a set is not a number at all) into a number. This only needs to have a definition, if it should cast to signed or unsigned type.

It has to be signed, because otherwise any negative number in the operation would trigger a range check error when it gets converted to a (larger) unsigned type. The nature of the operation that is used afterwards is irrelevant, range checking always operates in exactly the same way when performing a type conversion from one type to another. This is required to have predictable behaviour in a programming language.


Jonas
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to