Meme transcription:

Panel 1: Bilbo Baggins ponders, “After all… why should I care about the difference between int and String?

Panel 2: Bilbo Baggins is revealed to be an API developer. He continues, “JSON is always String, anyways…”

  • wischi@programming.dev
    link
    fedilink
    arrow-up
    1
    ·
    7 hours ago

    Floating point numbers and arithmetic is not inaccurate. They are actually very accurate but a lot of developers have inaccurate assumptions about them. They can’t exactly represent base 10 decimals. That’s the only inaccuracy. If you have two floating point numbers and you let’s say add or multiply them the result is always the closest floating point representation of the real result.

    The list of misconceptions wouldn’t reasonably fit in a comment, but if you are really interested and have a few minutes you could give that a read: https://zeta.one/floats-are-not-inaccurate/