this post was submitted on 26 Feb 2024
750 points (95.7% liked)

Programmer Humor

19171 readers
1835 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
 
(page 2) 35 comments
sorted by: hot top controversial new old
[–] arc@lemm.ee 3 points 6 months ago* (last edited 6 months ago)

The problem is, that most languages have no native support other than 32 or 64 bit floats and some representations on the wire don't either. And most underlying processors don't have arbitrary precision support either.

So either you choose speed and sacrifice precision, or you choose precision and sacrifice speed. The architecture might not support arbitrary precision but most languages have a bignum/bigdecimal library that will do it more slowly. It might be necessary to marshal or store those values in databases or over the wire in whatever hacky way necessary (e.g. encapsulating values in a string).

[–] LinearArray@programming.dev 2 points 6 months ago* (last edited 6 months ago)

Stop using floats

load more comments
view more: ‹ prev next ›