5 ms·
I've always thought that floats should be accompanied with a precision value specifying the number of significant digits. Ideally updated by hardware in the sam
by slededit 9y ago
I've always thought that floats should be accompanied with a precision value specifying the number of significant digits. Ideally updated by hardware in the same operation.
All floating point code has subtle bugs if you don't track error accumulation.
- zokier 9y agoWouldn't that be closer to interval arithmetic?
- deleted 9y ago[deleted]
- kraghen 9y agoThis sounds like unums, a proposed alternative to IEEE floats, where roughly speaking the significand can have variable size thus only boasting as much precision as the accuracy warrants.
- slededit 9y agoDoes it solve the equality issue? An epsilon tracker would allow you to say it's equal within the margin of error for the computation. If so that makes them much more interesting to me. Floating point bugs manifest themselves at non linear parts such as equality and comparison operators.
- kraghen 9y agoI haven't really seen the issue of equality dealt with explicitly, but it appears that you can extract the bounds of the interval implied by a given unum. Essentially, it seems like an alternative to interval arithmetic with potentially tighter bounds and faster computation.
- zmonx 9y agoYes, I think these are fair statements. John Gustafson's presentation also includes a few important points about interval arithmetic: http://www.johngustafson.net/presentations/Right-SizingPrecision1.pdf http://www.johngustafson.net/presentations/Right-SizingPreci...
- pklausler 9y agoIt's in a real scientific programming language, viz. Fortran, as SELECTED_REAL_KIND().
- slededit 9y agoThat is the precision of the type, but it does not track accumulated error which quickly gets into the representable range of the type. You need to know both the type, the precision of the data stored in the type and track the operations on it.
- deleted 9y ago[deleted]