bin/155886: bc sometimes mangles hexidecimal numbers

Dan Strick mla_strick at att.net
Wed Mar 23 11:10:02 UTC 2011


>Number:         155886
>Category:       bin
>Synopsis:       bc sometimes mangles hexidecimal numbers
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Mar 23 11:10:01 UTC 2011
>Closed-Date:
>Last-Modified:
>Originator:     Dan Strick
>Release:        FreeBSD 8.1-RELEASE i386
>Organization:
none
>Environment:
System: FreeBSD mist 8.1-RELEASE FreeBSD 8.1-RELEASE #0: Sat Aug 14 09:15:14 PDT 2010 root at mist:/usr/src/sys/i386/compile/MIST i386
>Description:
	The bc program sometimes mangles hexidecimal numbers.
	I don't really understand what it is doing, but it seems to be
	incorrect and when it does this it is worse than useless.
	See below for a reasonably simple example.
>How-To-Repeat:
	Enter the following, beginning at a shell prompt:
		% /usr/bin/bc
		obase=16
		ibase=16
		.1F9A6B50B0F27C00

	The bc program responds:
		bc 1.06
		Copyright 1991-1994, 1997, 1998, 2000 Free Software Foundation, Inc.
		This is free software with ABSOLUTELY NO WARRANTY.
		For details type `warranty'. 
		.1F9A6B50B0F27B

	In other words, I enter the number:
		.1F9A6B50B0F27C00
	and it responds:
		.1F9A6B50B0F27B

	I did a little more experimentation.  If I set ibase to a
	value greater than decimal 10 and enter:
		.1
	the bc program responds:
		0

	The value of obase does not seem to matter.

>Fix:
	unknown
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list