HackerTrans
TopNewTrendsCommentsPastAskShowJobs

Kristine1975

no profile record

comments

Kristine1975
·vor 10 Jahren·discuss
The whole ONES... HASZERO shenanigans is somewhat explained here: https://graphics.stanford.edu/~seander/bithacks.html#ZeroInW... as well as the entry after it.

Edit: And most likely in the excellent book "Hacker's Delight" as well.
Kristine1975
·vor 10 Jahren·discuss
On MacOS Classic (no memory protection) you can happily write to address zero and replace whatever is stored there (I think Apple wisely left that memory address unused, though).
Kristine1975
·vor 10 Jahren·discuss
std::array is in C++11
Kristine1975
·vor 10 Jahren·discuss
Although char should not be used to store numbers, since its signedness is implementation-defined (gcc has the switch -funsigned-chars I think to make them unsigned instead of signed). signed char/unsigned char are ok.