News for hackers. Stuff that matters.
Re:What Every Computer Scientist Should Know About Floating-... by bjourne on Tuesday June 30, 2020 @05:15AM (#23688203)
1) Hard for me to say since I don't know the formula of the scoring system you're talking about. But in general, if the problem goes away when doing the calculation on paper it would also go away when using symbolic math since the methods are identical.

An expression is a tree. A tree can grow arbitrarily large and therefore an expression can grow arbitrarily large. It's a problem in theory but not in practice. You can try for yourself in SymPy. It is very hard to come up with an expressions so complicated that they become difficult for the system to handle.

2) No. Assuming you are using tf-idf for scoring, your calculation involves numbers with infinite decimal expansions that cannot be expressed as rationals. However, you get arbitrarily precise by using very large integers in the numerator and denominator.

That is in contrast with floats whose precision is fixed at either 32 or 64 bit.

There are no comments on this comment yet.