Pricefield | Lemmy
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
@[email protected] to Programmer [email protected] • 1 month ago

Tell me the truth ...

piefed.jeena.net

message-square
167
fedilink
  • cross-posted to:
  • [email protected]
1.15K

Tell me the truth ...

piefed.jeena.net

@[email protected] to Programmer [email protected] • 1 month ago
message-square
167
fedilink
  • cross-posted to:
  • [email protected]
  • @[email protected]
    link
    fedilink
    130•1 month ago

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

    • palordrolap
      link
      fedilink
      10•1 month ago

      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.

    • OpenStars
      link
      fedilink
      English
      14•1 month ago

      TIL, 255 is the new 1.

      Aka -1 >> 1 : TRUE

      • @[email protected]
        link
        fedilink
        8•1 month ago

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

    • @[email protected]
      link
      fedilink
      93•
      edit-2
      1 month ago

      01111111 = true

      11111111 = negative true = false

      • @[email protected]
        link
        fedilink
        4•1 month ago

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

        • @[email protected]
          link
          fedilink
          3•1 month ago

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

          • @[email protected]
            link
            fedilink
            7•1 month ago

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

      • @[email protected]
        link
        fedilink
        2•1 month ago

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

      • @[email protected]
        link
        fedilink
        32•1 month ago

        What if it’s an unsigned boolean?

        • @[email protected]
          link
          fedilink
          English
          1•1 month ago

          Super true.

        • @[email protected]
          link
          fedilink
          21•1 month ago

          Cthulhu shows up.

        • @[email protected]
          link
          fedilink
          3•1 month ago

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

        • @[email protected]
          link
          fedilink
          16•1 month ago

      • @[email protected]
        link
        fedilink
        48•1 month ago

        00001111 = maybe

        • @[email protected]
          link
          fedilink
          29•1 month ago

          10101010 = I don’t know

          • assa123
            link
            fedilink
            2•1 month ago

            00000001 00000000 00001111 10101010

          • @[email protected]
            link
            fedilink
            22•1 month ago

            100001111 = maybe not

          • caseyweederman
            link
            fedilink
            4•1 month ago

            0011 1111 = could you repeat the question

        • @[email protected]
          link
          fedilink
          7•1 month ago

          Schrödingers Boolean

        • @[email protected]
          link
          fedilink
          1•1 month ago

          Is this quantum computing? 😜

      • @[email protected]
        link
        fedilink
        11•1 month ago

        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
        link
        fedilink
        English
        7•1 month ago

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

    • Consti
      link
      fedilink
      12•1 month ago

      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

Programmer [email protected]

[email protected]
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: [email protected]

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
  • 21 users / day
  • 403 users / week
  • 1.63K users / month
  • 4.29K users / 6 months
  • 3 subscribers
  • 1.54K Posts
  • 54.7K Comments
  • Modlog
  • mods:
  • Feyter
  • adr1an
  • @[email protected]
  • Pierre-Yves Lapersonne
  • UI: 0.18.4
  • BE: 0.18.2
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org