Date: Fri, 16 Jan 2004 15:26:51 -0800 (PST) From: Tony Monroe <tmonroe+freebsd@nog.net> To: FreeBSD-gnats-submit@FreeBSD.org Subject: bin/61451: Error with "carat" and "metriccarat" units in /usr/src/usr.bin/units/units.lib Message-ID: <200401162326.i0GNQpYE001825@bloodrose.nog.net> Resent-Message-ID: <200401162330.i0GNUGG0020187@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200401162326.i0GNQpYE001825>