L E F L I
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
nifty@lemmy.world to Programmer Humor@programming.dev · 2 years ago

Stop using floats

lemmy.world

message-square
92
link
fedilink
762

Stop using floats

lemmy.world

nifty@lemmy.world to Programmer Humor@programming.dev · 2 years ago
message-square
92
link
fedilink
  • Psythik@lemmy.world
    link
    fedilink
    arrow-up
    15
    ·
    2 years ago

    While we’re at it, what the hell is -0 and how does it differ from 0?

    • Reddfugee42@lemmy.world
      link
      fedilink
      arrow-up
      8
      ·
      2 years ago

      It’s the negative version

      • ShepherdPie@midwest.social
        link
        fedilink
        arrow-up
        5
        ·
        2 years ago

        So it’s just like 0 but with an evil goatee?

        • Knock_Knock_Lemmy_In@lemmy.world
          link
          fedilink
          arrow-up
          8
          ·
          2 years ago

          Look at the graph of y=tan(x)+ⲡ/2

          -0 and +0 are completely different.

    • computerscientistI@lemm.eeBanned
      link
      fedilink
      arrow-up
      2
      ·
      2 years ago

      For integers it really doesn’t exist. An algorithm for multiplying an integer with -1 is: Invert all bits and add 1 to the right-most bit. You can do that for 0 of course, it won’t hurt.

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.33K users / day
  • 3.56K users / week
  • 9.43K users / month
  • 20.3K users / 6 months
  • 1 local subscriber
  • 26.1K subscribers
  • 1.53K Posts
  • 50K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.12
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org