• JakenVeina@lemm.ee
    link
    fedilink
    English
    arrow-up
    29
    ·
    3 days ago

    It’s far more often stored in a word, so 32-64 bytes, depending on the target architecture. At least in most languages.

    • timhh@programming.dev
      link
      fedilink
      arrow-up
      5
      ·
      edit-2
      3 days ago

      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.

      • Aux@feddit.uk
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 day ago

        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.