Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 01 Dec 2017 21:04:50 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 206230] dc(1) bugs
Message-ID:  <bug-206230-8-Ldgb7UFdOy@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-206230-8@https.bugs.freebsd.org/bugzilla/>
References:  <bug-206230-8@https.bugs.freebsd.org/bugzilla/>

index | next in thread | previous in thread | raw e-mail

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=206230

Alan Somers <asomers@FreeBSD.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |asomers@FreeBSD.org

--- Comment #1 from Alan Somers <asomers@FreeBSD.org> ---
The problem is simpler than you suggest.  It looks like fractional input
doesn't work correctly when the input base is 16.  Try this:

$ dc -xe 16i0.1p
0.0
$ dc -xe 16i0.8p
.5
$ dc -xe 16i0.4p
.2

The first and third results are wrong, and the second result is correct.  I get
the same results with both the FreeBSD and the GNU versions of both bc(1) and
dc(1).  I suspect the problem is that some number is being treated as an
integer in units of base^n for n < 0 _before_ conversion to a bignum.  That
would explain these three results, for n=-1.

-- 
You are receiving this mail because:
You are the assignee for the bug.

help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-206230-8-Ldgb7UFdOy>