this post was submitted on 24 Sep 2025
99 points (97.1% liked)

Programming

22872 readers
127 users here now

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person's post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you're posting long videos try to add in some form of tldr for those who don't want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[โ€“] TehPers@beehaw.org 3 points 2 days ago* (last edited 2 days ago) (1 children)

The article goes into depth about what you should be using. Floats and doubles are not designed for use with base 10 fractions. They're good at estimating them, but not accurate enough for real financial use.

There's also not much reason to reinvent the wheel for an already solved problem. Many languages have this data type already built into the language, and the rest usually have it available through a package.

[โ€“] DarkAri@lemmy.blahaj.zone 2 points 2 days ago

Oh nice I'm far from a professional programmer. Thxs for the explanation.