From owner-freebsd-questions@freebsd.org Wed Jan 13 19:20:08 2016 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 24FF4A80E94 for ; Wed, 13 Jan 2016 19:20:08 +0000 (UTC) (envelope-from news@mips.inka.de) Received: from mail.inka.de (quechua.inka.de [IPv6:2001:7c0:407:1001:217:a4ff:fe3b:e77c]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E6FD512CF for ; Wed, 13 Jan 2016 19:20:07 +0000 (UTC) (envelope-from news@mips.inka.de) Received: from mips.inka.de (news@[127.0.0.1]) by mail.inka.de with uucp (rmailwrap 0.5) id 1aJQxi-0003La-7e; Wed, 13 Jan 2016 20:20:06 +0100 Received: from lorvorc.mips.inka.de (localhost [127.0.0.1]) by lorvorc.mips.inka.de (8.15.2/8.15.2) with ESMTP id u0DJIal8014184 for ; Wed, 13 Jan 2016 20:18:36 +0100 (CET) (envelope-from news@lorvorc.mips.inka.de) Received: (from news@localhost) by lorvorc.mips.inka.de (8.15.2/8.15.2/Submit) id u0DJIap2014183 for freebsd-questions@freebsd.org; Wed, 13 Jan 2016 20:18:36 +0100 (CET) (envelope-from news) To: freebsd-questions@freebsd.org From: Christian Weisgerber Newsgroups: list.freebsd.questions Subject: Re: dc(1) bugs Date: Wed, 13 Jan 2016 19:18:36 +0000 (UTC) Message-ID: References: <0McVKy-1aajq60oIS-00Hgju@mail.gmx.com> User-Agent: slrn/1.0.2 (FreeBSD) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Jan 2016 19:20:08 -0000 On 2016-01-13, "CK" 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@mips.inka.de