List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:October 17 1999 6:53pm
Subject:bit functions, or lack thereof...
View as plain text  
>>>>> "Anthony" == Anthony R J Ball <ant@stripped> writes:

Anthony>   Looking through the docs all I find for bit functions are & | <<
> >>,
Anthony> now I may be wrong, but shouldn't there be a way to flip the bits? like the
Anthony> ~ operator?

Anthony>   so to set flags (an unsigned int) you would do set flags = flags | 0x02
Anthony> and to unset flags you'd do set flags = flags & ~0x02
Anthony> ?

Anthony> Or am I simply forgetting some of my bit logic?

Anthony> Or is this just not implemented?

From MySQL 3.23.5:

mysql> select ~0x1;
+------+
| ~0x1 |
+------+
|   -2 |
+------+
1 row in set (0.00 sec)

mysql> select 5 & ~1;
+--------+
| 5 & ~1 |
+--------+
|      4 |
+--------+

Regards,
Monty
Thread
bit functions, or lack thereof...Mr. Anthony R.J. Ball14 Oct
  • bit functions, or lack thereof...Michael Widenius17 Oct
  • bit functions, or lack thereof...Michael Widenius17 Oct