3 ms·
> Usually a ~ signifies a bitwise-OR operation. That sounded wrong to me, I recalled it being a NOT, and double checked. Turns out my recollection was correct
by Jtsummers 5y ago
> Usually a ~ signifies a bitwise-OR operation.
That sounded wrong to me, I recalled it being a NOT, and double checked. Turns out my recollection was correct (it's also not something I ever used much), it is the bitwise-NOT in C.
That actually makes it a bit more awkward, in my mind, as I initially parsed the example as "not string". However, ~ is also often used to mean "about" or "approximately". In a text exchange:
"How many people will be at dinner?"
"~5"
Meaning "about 5 people" or "approximately 5 people". So this also works in that sense, ~string can be read as "something in the neighborhood of a string" or "something like a string".
https://en.wikipedia.org/wiki/Bitwise_operations_in_C https://en.wikipedia.org/wiki/Bitwise_operations_in_C
- deleted 5y ago[deleted]