←back to thread

Uncertain<T>

(nshipster.com)
444 points samtheprogram | 1 comments | | HN request time: 0.228s | source
Show context
layer8 ◴[] No.45055943[source]
Arguably Uncertain should be the default, and you should have to annotate a type as certain T when you are really certain. ;)
replies(2): >>45056272 #>>45056582 #
nine_k ◴[] No.45056582[source]
Only for physical measurements. For things like money, you should be pretty certain, often down to exact fractional cents.

It appears that a similar approach is implemented in some modern Fortran libraries.

replies(4): >>45057007 #>>45057078 #>>45057151 #>>45060359 #
1. XorNot ◴[] No.45057007[source]
Money has the problem that no matter how clever you are someone will punch all the values into Excel and then complain they don't match.

Or specify they're paying X per day, but want hourly itemized billing...but it should definitely come out to X per day (this was one employer which meant I invoiced them with like 8 digits of precision due to how it divided, and they refused to accept a line item for mathematical uncertainty aggregates).