this post was submitted on 02 Jan 2025
811 points (99.2% liked)

Programmer Humor

32710 readers
185 users here now

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

Rules:

founded 5 years ago
MODERATORS
 

~~Stolen~~ Cross-posted from here: https://fosstodon.org/@foo/113731569632505985

you are viewing a single comment's thread
view the rest of the comments
[โ€“] HStone32 30 points 5 days ago (23 children)

I've wondered why programming languages don't include accurate fractions as part of their standard utils. I don't mind calling dc, but I wish I didn't need to write a bash script to pipe the output of dc into my program.

[โ€“] [email protected] 10 points 5 days ago (2 children)

A lot of work has gone into making floating point numbers efficient and they cover 99% of use cases. In the rare case you really need perfect fractional accuracy, it's not that difficult to implement as a pair of integers.

load more comments (1 replies)
load more comments (21 replies)