Re: Bug in dc

John Cowan <[email protected]> Tue, 17 Jul 2018 16:23:00 -0400
Newsgroups gmane.comp.gnu.utils.bugs
Message-ID <CAD2gp_QTiCD0md0jtA9KQR3VJOi3LRRV2VBLubCKzP97HQJ3KQ@mail.gmail.com>
That's because bc uses base-10 arithmetic internally.  It is the equal and
opposite phenomenon to the loss of significance in other languages when
using standard base-2 floating point.

On Tue, Jul 17, 2018 at 3:28 PM, Russell Harper <[email protected]>
wrote:

> Literal real values in bases other than 10 lose precision, e.g.
>
> $ dc <<<'16 d i o F423F.FD p'
> F423F.FA
>
> Would expect the output to be F423F.FD
>
> It basically makes the calculator useless for non-decimal calculations.
>
> Regards,
>
> Russell
>