From owner-freebsd-bugs@FreeBSD.ORG Fri Jan 16 15:30:20 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4218516A4CE for ; Fri, 16 Jan 2004 15:30:20 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5E13843D39 for ; Fri, 16 Jan 2004 15:30:16 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i0GNUGFR020190 for ; Fri, 16 Jan 2004 15:30:16 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i0GNUGG0020187; Fri, 16 Jan 2004 15:30:16 -0800 (PST) (envelope-from gnats) Resent-Date: Fri, 16 Jan 2004 15:30:16 -0800 (PST) Resent-Message-Id: <200401162330.i0GNUGG0020187@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, Tony Monroe Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 27EFE16A4CE for ; Fri, 16 Jan 2004 15:26:56 -0800 (PST) Received: from bloodrose.nog.net (bloodrose.nog.net [208.177.138.239]) by mx1.FreeBSD.org (Postfix) with ESMTP id BCE5D43D53 for ; Fri, 16 Jan 2004 15:26:54 -0800 (PST) (envelope-from tony@bloodrose.nog.net) Received: from bloodrose.nog.net (localhost [127.0.0.1]) ESMTP id i0GNQpg2001826 for ; Fri, 16 Jan 2004 15:26:51 -0800 (PST) (envelope-from tony@bloodrose.nog.net) Received: (from tony@localhost) by bloodrose.nog.net (8.12.9p2/8.12.9/Submit) id i0GNQpYE001825; Fri, 16 Jan 2004 15:26:51 -0800 (PST) (envelope-from tony) Message-Id: <200401162326.i0GNQpYE001825@bloodrose.nog.net> Date: Fri, 16 Jan 2004 15:26:51 -0800 (PST) From: Tony Monroe To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: bin/61451: Error with "carat" and "metriccarat" units in /usr/src/usr.bin/units/units.lib X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Tony Monroe List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Jan 2004 23:30:20 -0000 >Number: 61451 >Category: bin >Synopsis: Error with "carat" and "metriccarat" units in /usr/src/usr.bin/units/units.lib >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Jan 16 15:30:15 PST 2004 >Closed-Date: >Last-Modified: >Originator: Tony Monroe >Release: FreeBSD 4.9-RELEASE i386 >Organization: self >Environment: System: FreeBSD bloodrose.nog.net 4.9-RELEASE FreeBSD 4.9-RELEASE #2: Mon Nov 3 14:23:16 PST 2003 root@bloodrose:/var/obj/usr/src/sys/BLOOD_FOUR i386 >Description: The database in /usr/share/misc/units.lib leads /usr/bin/units to believe that a carat is not a unit of mass, but of something else. This problem also affects the metric carat. (It is unfortunate that the units database is set up so that "mg" is interpreted as "m-" times "g", or 0.001 * 9.8 m / sec^2. This is not necessarily easily fixed, nor do I expect that it will be addressed as a result of this bug report.) This problem is present on 4.9-RELEASE as of 2003-11-03, and 5.1-RELEASE as of 2003-12-03. >How-To-Repeat: $ units carat milligram conformability error 2.0103633 m / sec^2 1e-06 kg $ units metriccarat milligram conformability error 1.96133 m / sec^2 1e-06 kg >Fix: perl -pi.bak -e 's/mg/milligram/ if /carat/' /usr/src/usr.bin/units/units.lib Using the new units.lib, we get: $ units -f units.lib carat milligram * 205 / 0.0048780488 $ units -f units.lib metriccarat milligram * 200 / 0.005 Which is the expected result, and exhibits no "conformability error." >Release-Note: >Audit-Trail: >Unformatted: