Hacker News new | past | comments | ask | show | jobs | submit login

wouldn't most of the issues be solved with use of bcd/dcd? you get the speed (compared to arbitrary-precision), fixed-precision, and exact answers up to the precision limit?



Unfortunately, no.

BCD as "binary coded decimal" is, effectively, useless. Even arbitrary precision libraries tend to be faster than BCD.

"decimal floating point", which is what I think you meant, just changes what isn't representable. Instead of 1/5 causing a problem, 1/3 causes a problem.

The "classic" problem about this is matrix operations. Specifically, matrix inversion. You can use interval arithmetic on matrix inversion, and you find that the intervals blow up to almost infinity after just a couple of operations even though the center of the interval is actually pretty close to the solution. Of course, the reverse also holds: while most matricies invert relatively cleanly, there are always pathological cases that really do need humungous precision to invert.

PS: Don't know why you were getting downvoted as you asked a legitimate question.


Thank you the answer! It was very insightful. Also, no big deal about downvotes. Can't please everybody.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: