Re: [fpc-devel] Division nodes

2023-05-17 Thread J. Gareth Moreton via fpc-devel
Logically yes, but using 16-bit as an example, min_int is -32,768, and signed 16-bit integers range from -32,768 to 32,767. So -32,768 ÷ -1 = 32,768, which is out of range.  This is where the problem lies. Internally, negation involves inverting all of the bits and then adding 1 (essentially

Re: [fpc-devel] Division nodes

2023-05-17 Thread Jean SUZINEAU via fpc-devel
Le 16/05/2023 à 01:47, Stefan Glienke via fpc-devel a écrit : min_int div -1 "min_int div -1"  should give  "- min_int" ? ___ fpc-devel maillist - fpc-devel@lists.freepascal.org https://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel