Lemmy Mengsk
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
cm0002@lemmy.world to Programmer Humor@programming.dev · 2か月前

Tell me the truth ...

piefed.jeena.net

message-square
168
fedilink
1.16K

Tell me the truth ...

piefed.jeena.net

cm0002@lemmy.world to Programmer Humor@programming.dev · 2か月前
message-square
168
fedilink
  • ricecake@sh.itjust.works
    link
    fedilink
    arrow-up
    135
    ·
    2か月前

    I set all 8 bits to 1 because I want it to be really true.

    • laranis@lemmy.zip
      link
      fedilink
      arrow-up
      95
      ·
      edit-2
      2か月前

      01111111 = true

      11111111 = negative true = false

      • StellarSt0rm@lemmy.world
        link
        fedilink
        arrow-up
        48
        ·
        2か月前

        00001111 = maybe

        • ThatGuy46475@lemmy.world
          link
          fedilink
          arrow-up
          29
          ·
          2か月前

          10101010 = I don’t know

          • foofiepie@lemmy.world
            link
            fedilink
            arrow-up
            22
            ·
            2か月前

            100001111 = maybe not

          • caseyweederman@lemmy.ca
            link
            fedilink
            arrow-up
            4
            ·
            2か月前

            0011 1111 = could you repeat the question

          • assa123@lemmy.world
            link
            fedilink
            arrow-up
            2
            ·
            2か月前

            00000001 00000000 00001111 10101010

        • tfm@europe.pub
          link
          fedilink
          arrow-up
          7
          ·
          2か月前

          Schrödingers Boolean

        • Venator@lemmy.nz
          link
          fedilink
          arrow-up
          1
          ·
          2か月前

          Is this quantum computing? 😜

      • VonReposti@feddit.dk
        link
        fedilink
        arrow-up
        34
        ·
        2か月前

        What if it’s an unsigned boolean?

        • ivanovsky@lemm.ee
          link
          fedilink
          arrow-up
          25
          ·
          2か月前

          Cthulhu shows up.

        • hakunawazo@lemmy.world
          link
          fedilink
          arrow-up
          17
          ·
          2か月前

        • laranis@lemmy.zip
          link
          fedilink
          arrow-up
          3
          ·
          2か月前

          Common misconception… Unsigned booleans (ubool) are always 16-bits.

        • CosmicTurtle0@lemmy.dbzer0.com
          link
          fedilink
          English
          arrow-up
          1
          ·
          2か月前

          Super true.

      • ricecake@sh.itjust.works
        link
        fedilink
        arrow-up
        13
        ·
        2か月前

        Could also store our bools as floats.

        00111111100000000000000000000000 is true and 10111111100000000000000000000000 is negative true.

        Has the fun twist that true & false is true and true | false is false .

      • OpenStars@piefed.social
        link
        fedilink
        English
        arrow-up
        7
        ·
        2か月前

        Why do alternative facts always gotta show up uninvited to the party? 🥳

      • pocker_machine@lemmy.world
        link
        fedilink
        arrow-up
        4
        ·
        2か月前

        So all this time true was actually false and false was actually true ?

        • laranis@lemmy.zip
          link
          fedilink
          arrow-up
          3
          ·
          2か月前

          Depends on if you are on a big endian or little endian architecture.

          • pocker_machine@lemmy.world
            link
            fedilink
            arrow-up
            7
            ·
            2か月前

            Come on man, I’m not gonna talk about my endian publicly

      • Jankatarch@lemmy.world
        link
        fedilink
        arrow-up
        2
        ·
        2か月前

        negative true = negative non-zero = non-zero = true.

    • OpenStars@piefed.social
      link
      fedilink
      English
      arrow-up
      15
      ·
      2か月前

      TIL, 255 is the new 1.

      Aka -1 >> 1 : TRUE

      • ricecake@sh.itjust.works
        link
        fedilink
        arrow-up
        8
        ·
        2か月前

        But only if you really mean it. If not, it’s a syntax error and the compiler will know.

    • Consti@lemmy.world
      link
      fedilink
      arrow-up
      12
      ·
      2か月前

      I was programming in assembly for ARM (some cortex chip) and I kid you not the C program we were integrating with required 255, with just 1 it read it as false

    • palordrolap@fedia.io
      link
      fedilink
      arrow-up
      10
      ·
      2か月前

      You jest, but on some older computers, all ones was the official truth value. Other values may also have been true in certain contexts, but that was the guaranteed one.

Programmer Humor@programming.dev

programmer_humor@programming.dev

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !programmer_humor@programming.dev

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

  • Keep content in english
  • No advertisements
  • Posts must be related to programming or programmer topics
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 1.49K users / day
  • 1.49K users / week
  • 3.24K users / month
  • 19.2K users / 6 months
  • 1 local subscriber
  • 25K subscribers
  • 1.21K Posts
  • 27K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.8
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org