Lemmy - RazBot
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
cm0002@lemmy.world to Programmer Humor@programming.dev · 1 month ago

First exposure to floating-point arithmetic

peertube.mesnumeriques.fr

external-link
message-square
9
fedilink
  • cross-posted to:
  • [email protected]
56
external-link

First exposure to floating-point arithmetic

peertube.mesnumeriques.fr

cm0002@lemmy.world to Programmer Humor@programming.dev · 1 month ago
message-square
9
fedilink
  • cross-posted to:
  • [email protected]
Instance PeerTube généraliste, une bonne alternative à YouTube et autres plateformes de streaming contrôlées par des géants du WEB. General PeerTube instance, a good alternative to YouTube and other streaming platforms controlled by WEB giants.
alert-triangle
You must log in or register to comment.
  • call_me_xale@lemmy.zip
    link
    fedilink
    arrow-up
    10
    ·
    1 month ago

    More people need to learn to use Rational types. A pretty large majority of the numbers that people care about in real life can easily be represented by a ratio of integers, and they allow math with perfect precision.

    • boonhet@lemm.ee
      link
      fedilink
      arrow-up
      7
      ·
      1 month ago

      Or just BigDecimal or an equivalent if rational types aren’t easy to use in your language (e.g if you’d have to literally enter the denominator and numerator).

    • Quetzalcutlass@lemmy.world
      link
      fedilink
      English
      arrow-up
      3
      ·
      1 month ago

      Someone posted this article a while back that goes into more detail on some alternatives, as well as contains one of the best and most intuitive explanations of floating point that I’ve ever read.

  • Metostopholes@midwest.social
    link
    fedilink
    English
    arrow-up
    5
    ·
    1 month ago

    Reject modernity, return to COBOL.

  • zerofk@lemm.ee
    link
    fedilink
    arrow-up
    5
    arrow-down
    1
    ·
    1 month ago

    There is a paper titled “What Every Computer Scientist Should Know About Floating-Point Arithmetic” by David Goldberg. It’s a bit theoretical, but IMO it’s a must-read for any programmer doing more than the occasional floating point calculation. It goes beyond just limited precision and rounding errors.

    • Flipper@feddit.org
      link
      fedilink
      arrow-up
      3
      ·
      1 month ago

      Here the link for everyone.

  • jxk@sh.itjust.works
    link
    fedilink
    arrow-up
    3
    arrow-down
    1
    ·
    1 month ago

    Javascript: The result is “0.10.2”

  • Rikudou_Sage@lemmings.world
    link
    fedilink
    arrow-up
    2
    ·
    1 month ago

    PHP: 0.3*

    * with default precision

  • beejboytyson@lemmy.world
    link
    fedilink
    arrow-up
    1
    ·
    1 month ago

    Jemapelle

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: [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
Visibility: Public
globe

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

  • 1.64K users / day
  • 4.67K users / week
  • 9.3K users / month
  • 17.7K users / 6 months
  • 1 local subscriber
  • 23.1K subscribers
  • 1.37K Posts
  • 46.7K Comments
  • Modlog
  • mods:
  • Feyter@programming.dev
  • adr1an@programming.dev
  • BurningTurtle@programming.dev
  • Pierre-Yves Lapersonne@programming.dev
  • BE: 0.19.9
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org