dc(1) bugs
Christian Weisgerber
naddy at mips.inka.de
Wed Jan 13 19:20:08 UTC 2016
On 2016-01-13, "CK" <nibbana at gmx.us> wrote:
> These appear to be bugs to me, but please verify if possible:
Many of your examples are confusing because you stripped off leading
periods from the results.
Also, all your four cases seem to come down to the same problem,
so let's just pick one:
> #####
> THIRD
> #####
> $ dc -xe '50k16o16i.4 2^p'
> 0A
> $ dc -xe '50k16o16i.40 2^p'
> 1000
> $ dc -xe '50k16o16i.400 2^p'
> 10000
> $ dc -xe '50k16o16i.4000 2^p'
> 1000000
Simpler examples:
$ dc -e '50k 16i .1 p'
0.0
$ dc -e '50k 16i .10 p'
.06
$ dc -e '50k 16i .100 p'
.062
$ dc -e '50k 16i .1000 p'
.0625
I'll note that GNU dc(1) behaves the same way, so I think it is a
case of poorly documented or counter-intuitive behavior rather than
a bug.
--
Christian "naddy" Weisgerber naddy at mips.inka.de
More information about the freebsd-questions
mailing list