On 8/28/2022 8:23 AM, James Richters via fpc-pascal wrote:
Running "i:\booltostr.exe "

-1

0

Why true is -1 instead of 1 is beyond me, but anyway, I would consider this BoolToInt, not BoolToStr,I want the Strings ‘TRUE’ or ‘FALSE’ as indicated in the documentation

Very logical in fact. 0 is NO bit set in any given size of boolean data type, -1 means ALL bits set on that same size boolean data type. And a check on TRUE or FALSE, can easily be done with checking the sign flag of a processor rather than doing actually any bit fiddling (at least on those CPUs that I am familiar with).

Ralf

_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to