On 9 Oct 2017, at 12:06am, R Smith <rsm...@rsweb.co.za> wrote:
> The topic started as a request for an XOR operator. I've added a request for
> a NOT operator.
SQLite does not have a byte type.
SQLite does not have any fixed-length integer type.
Given those two statements, what should NOT 1100 be ?
Should it be 11 ? Or 11110011 ? Or 1111111111110011 ? If you want to argue
that the result should be 1 byte long, you will get the wrong result when you
OR two different XOR results together. Are you going to argue that it should
be 8 bytes long ? Why should a SQL programmer be expected to know details
about how SQL stores numbers internally ?
Having one operator gives you the other. For example,
a XOR b == ( a IOR b ) AND (NOT ( a AND b ))
If you have difficulty in deciding how long the result of NOT should be, you
have the same problem in deciding how long XOR should be. Again, deciding it
should be one byte long is apparently wrong, but deciding it should be eight
bytes long is arbitrary because it depends on an internal detail of SQLite not
normally exposed to users.
sqlite-users mailing list