Open Menu
AllLocalCommunitiesAbout
lotide
AllLocalCommunitiesAbout
Login

51% + 50% = ?

⁨13⁩ ⁨likes⁩

Submitted ⁨⁨8⁩ ⁨months⁩ ago⁩ by ⁨bachatero@lemmy.world⁩ to ⁨mildlyinfuriating@lemmy.world⁩

https://lemmy.world/pictrs/image/8930473e-f290-4a0f-bcb2-08f2b112bff3.png

source

Comments

Sort:hotnewtop
  • eager_eagle@lemmy.world ⁨8⁩ ⁨months⁩ ago

    rounding half up

    round(49.5) + round(50.5)
    50 + 51
    

    as opposed to banker’s rounding / rounding half to even:

    round(49.5) + round(50.5)
    50 + 50
    
    source
    • scrubbles@poptalk.scrubbles.tech ⁨8⁩ ⁨months⁩ ago

      Yeah fintech team rounded correctly and ui team rounded to the nearest int. No big deal, it’s not actual money here.

      source
  • vovo@lemmy.dbzer0.com ⁨8⁩ ⁨months⁩ ago

    49.5+50.5 rounded?

    source
  • Dudewitbow@lemmy.zip ⁨8⁩ ⁨months⁩ ago

    there are different methods of rounding, and this one is likely caused by the always round up method when at a .5 value. there are methods that evenly distribute rounding

    source