256

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…”

you are viewing a single comment's thread
view the rest of the comments
[-] wischi@programming.dev 1 points 3 weeks 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/

this post was submitted on 30 Jun 2024
256 points (97.1% liked)

Programmer Humor

32707 readers
35 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS