Hacker News new | ask | show | jobs
by ninja3925 816 days ago
It can be done for performance reason I assume. Numpy for instance does that:

https://numpy.org/doc/stable/user/basics.types.html

1 comments

yes, exactly. Access/modification of a directly addressable byte is much faster than some bit of it. If I'm not mistaken, on Win32 `BOOL` data type is defined even worse to a 32bit int (this C API was devised way before `bool` has made it's way into C), so 8bits isn't even the worst case scenario :D