• @sfgifz@lemmy.world
    link
    fedilink
    English
    357 months ago

    2+2=5

    Don’t take my word for it research about it yourself there are lots of good videos on YouTube the government and science liars don’t want you to know the truth /s

      • @cynar@lemmy.world
        link
        fedilink
        English
        167 months ago

        For those confused

        2.25+2.25=4.5 rounds to 2+2=5

        2.5+2.5=5 truncates to 2+2=5

        Both can crop up in programming, depending on the situation.

        • Echo Dot
          link
          fedilink
          English
          37 months ago

          2.25 + 2.25 = 4.5

          If you add two floats together then the output is a float, if you add an int and a float together the output is a float. Computers will always perform the calculation as is, unless you explicitly tell them to perform a rounding operation.

          • @cynar@lemmy.world
            link
            fedilink
            English
            67 months ago

            However, if you stuff them into an int at the last minute, you can get that effect.

            Under the hood, it’s floats. On the output, it’s ints.

            It’s obvious and silly with small examples. The problem can creep in when you are using larger libraries or frameworks.

    • @tabris@lemmy.world
      link
      fedilink
      English
      87 months ago

      Remember when Terrance Howard tried to explain how 1x1=2 because bird people from Atlantis tricked us? Good times.