148
pretty small subtotal. (programming.dev)
submitted 1 week ago by [email protected] to c/[email protected]
you are viewing a single comment's thread
view the rest of the comments
[-] [email protected] 3 points 1 week ago

Yes you can. You're vastly underestimating the size of an f64. Give me a concrete example of a money operation that fails with f64 (for normal companies; assuming you aren't a stock exchange or Visa or whatever).

0.1f64 + 0.2f64 != 0.3f64

Why not?

Encoding in assumptions about a fixed amount of supported currencies in a system is broadly speaking not a good idea

[-] [email protected] 0 points 1 week ago

0.1f64 + 0.2f64 != 0.3f64

It does if you round it to the nearest penny.

Encoding in assumptions about a fixed amount of supported currencies in a system is broadly speaking not a good idea

Most sensible programming languages allow enums to be non-exhaustive.

this post was submitted on 26 Jul 2025
148 points (98.1% liked)

Software Gore

1181 readers
1 users here now

A community for posting software malfunctions

Deliberately bad software or bad design is not software gore, it must be something unintentional

Icon base by Delapouite under CC BY 3.0 with modifications to add a gradient and shear it



founded 2 years ago
MODERATORS