bin/155886: bc(1) sometimes mangles hexidecimal numbers
mla_strick at att.net
Tue Apr 12 08:30:14 UTC 2011
The following reply was made to PR bin/155886; it has been noted by GNATS.
From: Dan Strick <mla_strick at att.net>
To: bug-followup at freebsd.org, coloncolonone at googlemail.com, mla_strick at att.net
Subject: Re: bin/155886: bc(1) sometimes mangles hexidecimal numbers
Date: Tue, 12 Apr 2011 01:11:57 -0700 (PDT)
> This seems to be somewhat similar to Debian Bug 84995 where one can find
> some explanations: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=84995
I took a look at the Debian bug report. The author of the bc program
> This is a result of having the number stored in base 10 and then
> using other bases in the fractional values. I can't quote the
> posix document, but I'm sure this is legal behavior.
The behavior may be "legal" (i.e. consistent with POSIX.2?), but it is
sufficiently counterintuitive as to require specific mention on the bc
man page. In other words, this behavior is either a program bug or a
documentation bug. It cannot be neither.
More information about the freebsd-bugs