From owner-freebsd-bugs@FreeBSD.ORG Wed Mar 23 11:10:02 2011 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 395691065670 for ; Wed, 23 Mar 2011 11:10:02 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id E440C8FC1A for ; Wed, 23 Mar 2011 11:10:01 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id p2NBA1Za090596 for ; Wed, 23 Mar 2011 11:10:01 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id p2NBA1YB090595; Wed, 23 Mar 2011 11:10:01 GMT (envelope-from gnats) Resent-Date: Wed, 23 Mar 2011 11:10:01 GMT Resent-Message-Id: <201103231110.p2NBA1YB090595@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Dan Strick Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B8AE106564A for ; Wed, 23 Mar 2011 11:01:41 +0000 (UTC) (envelope-from mla_strick@att.net) Received: from nm4.bullet.mail.bf1.yahoo.com (nm4.bullet.mail.bf1.yahoo.com [98.139.212.163]) by mx1.freebsd.org (Postfix) with SMTP id A46948FC0A for ; Wed, 23 Mar 2011 11:01:40 +0000 (UTC) Received: from [98.139.212.146] by nm4.bullet.mail.bf1.yahoo.com with NNFMP; 23 Mar 2011 10:48:55 -0000 Received: from [98.139.212.230] by tm3.bullet.mail.bf1.yahoo.com with NNFMP; 23 Mar 2011 10:48:55 -0000 Received: from [127.0.0.1] by omp1039.mail.bf1.yahoo.com with NNFMP; 23 Mar 2011 10:48:55 -0000 Received: (qmail 86110 invoked from network); 23 Mar 2011 10:48:54 -0000 Received: from mist.nodomain (mla_strick@69.228.90.112 with login) by smtp110.sbc.mail.mud.yahoo.com with SMTP; 23 Mar 2011 03:48:54 -0700 PDT Received: from mist.nodomain (localhost [127.0.0.1]) by mist.nodomain (8.14.4/8.14.4) with ESMTP id p2NAmqmG004450; Wed, 23 Mar 2011 03:48:52 -0700 (PDT) (envelope-from mla@mist.nodomain) Received: (from dan@localhost) by mist.nodomain (8.14.4/8.14.4/Submit) id p2NAmqMY004449; Wed, 23 Mar 2011 03:48:52 -0700 (PDT) (envelope-from mla) Message-Id: <201103231048.p2NAmqMY004449@mist.nodomain> Date: Wed, 23 Mar 2011 03:48:52 -0700 (PDT) From: Dan Strick To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Cc: dan@mist.nodomain Subject: bin/155886: bc sometimes mangles hexidecimal numbers X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Dan Strick List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 23 Mar 2011 11:10:02 -0000 >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@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: