News for hackers. Stuff that matters.
Re:If 1+x is 1, how much is 1-x? by madez on Tuesday April 21, 2015 @06:36PM (#9417608)
Yes, you are right.

However, it's possible using MPFR in a way without suffering this issues. One could increase precision every time there would be rounding.

Re:If 1+x is 1, how much is 1-x? by ori_b on Tuesday April 21, 2015 @08:11PM (#9417939)
The problem is that the second you multiply by pi or e, which is fairly common, your required precision for a perfect result becomes infinite.

Even if you don't, your required precision blows up very quickly, and your performance drops.

Re:If 1+x is 1, how much is 1-x? by madez on Tuesday April 21, 2015 @08:54PM (#9418071)
In finite precision arithmetic "multiplying by pi or e" makes no sense. And all arithmetic is finite precision. You could multiply by an approximation, and accordingly adjust the precision to avoid rounding.

In more general context, you could choose e as the base of your number system and then multiplying by e is a trivial shift. Then, however, multiplying by 2 would make arithmetically no sense. The natural question that arises is whether it's possible to represent all computable numbers non-lossy in one system. The answer is yes.

Besides that, I think you should re-evaluate your decision-making for votes.

Re:If 1+x is 1, how much is 1-x? by ori_b on Thursday April 23, 2015 @01:07AM (#9425106)
> In finite precision arithmetic "multiplying by pi or e" makes no sense. And all arithmetic is finite precision.

Yes. that's kind of my point: Either you have a finite precision cutoff and lose accuracy, or the memory used for your arbitrary precision representation blows up to incredibly large values (transcendentals will do this to you quickly), or a combination of the two.