Groups | Search | Server Info | Keyboard shortcuts | Login | Register


Groups > gnu.utils.bug > #2246

Re: Bug in dc

From John Cowan <cowan@ccil.org>
Newsgroups gnu.utils.bug
Subject Re: Bug in dc
Date 2018-07-17 16:23 -0400
Message-ID <mailman.3730.1531859005.1292.bug-gnu-utils@gnu.org> (permalink)
References <CAHv5L_3E4qZ0oXsHpeFrW2ZCGfO6x7SrBWMkd5viobwqd+JZBw@mail.gmail.com>

Show all headers | View raw


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 <russell.s.harper@gmail.com>
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
>

Back to gnu.utils.bug | Previous | Next | Find similar


Thread

Re: Bug in dc John Cowan <cowan@ccil.org> - 2018-07-17 16:23 -0400

csiph-web