Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Bug in dc

1 view
Skip to first unread message

Russell Harper

unread,
Jul 17, 2018, 4:13:09 PM7/17/18
to bug...@gnu.org, bug-gn...@gnu.org, bug-gn...@prep.ai.mit.edu
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

John Cowan

unread,
Jul 17, 2018, 4:23:27 PM7/17/18
to Russell Harper, bug...@gnu.org, bug-gnu-utils, bug-gn...@prep.ai.mit.edu
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....@gmail.com>
wrote:
0 new messages