Martin Frb via fpc-devel <fpc-devel@lists.freepascal.org> schrieb am Fr.,
29. Dez. 2023, 20:38:

> fpc 3.2.3
> The below prog prints 3 times: 11, -1   (signed values)
>
> https://www.freepascal.org/docs-html/current/ref/refsu4.html#x26-250003.1.1
>
> Free Pascal also supports the ByteBool, WordBool, LongBool and QWordBool 
> types.
> These are of type Byte, Word, Longint or Int64,
>
>
> Besides the fact that a "QWordBool" should be "Int64", they all seem to be
> treated as signed.
>

The prefix refers to the width, not whether they are signed or not.


> Yet at least the first two of them are documented as unsigned.
>

Internally they are handled as signed, but in the end it doesn't matter,
because the only thing that counts for them is whether they're "0" aka
"False" or "not 0" aka "True" (though that doesn't mean that all bits need
to set, just that any bit needs to be 1).

Regards,
Sven
_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel

Reply via email to