@[email protected] to Programmer [email protected] • 3 days agoTell me the truth ...piefed.jeena.netimagemessage-square144fedilinkarrow-up11.13Kcross-posted to: [email protected]
arrow-up11.13KimageTell me the truth ...piefed.jeena.net@[email protected] to Programmer [email protected] • 3 days agomessage-square144fedilinkcross-posted to: [email protected]
minus-square@[email protected]linkfedilinkEnglish28•2 days agoIt’s far more often stored in a word, so 32-64 bytes, depending on the target architecture. At least in most languages.
minus-square@[email protected]linkfedilink5•edit-22 days agoNo it isn’t. All statically typed languages I know of use a byte. Which languages store it in an entire 32 bits? That would be unnecessarily wasteful.
minus-square@[email protected]linkfedilinkEnglish1•12 hours agoIt’s not wasteful, it’s faster. You can’t read one byte, you can only read one word. Every decent compiler will turn booleans into words.
It’s far more often stored in a word, so 32-64 bytes, depending on the target architecture. At least in most languages.
No it isn’t. All statically typed languages I know of use a byte. Which languages store it in an entire 32 bits? That would be unnecessarily wasteful.
It’s not wasteful, it’s faster. You can’t read one byte, you can only read one word. Every decent compiler will turn booleans into words.