Home | History | Annotate | only in /src/usr.bin/units
History log of /src/usr.bin/units
RevisionDateAuthorComments
 1.6 13-Feb-1999  lukem convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
 1.5 27-Sep-1998  lukem don't install in /usr/share if NOSHARE is defined
 1.4 24-Mar-1997  christos - Makefile cleanups
 1.3 18-Oct-1996  thorpej Use ${INSTALL}.
 1.2 06-Apr-1996  thorpej RCS Id police.
 1.1 27-Oct-1993  cgd add units command, written by Adrian Mariano (adrian@cam.cornell.edu or
mariano@geom.umn.edu), cleaned up, KNF'd, etc., by cgd
 1.2 06-Apr-1996  thorpej RCS Id police.
 1.1 27-Oct-1993  cgd add units command, written by Adrian Mariano (adrian@cam.cornell.edu or
mariano@geom.umn.edu), cleaned up, KNF'd, etc., by cgd
 1.6 26-Jul-2003  salo netbsd.org->NetBSD.org
 1.5 14-Jun-2000  cgd sweep of my licenses (userland files w/o only my copyright) for
consistency. (no functional changes)
 1.4 14-Jun-2000  cgd fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.3 06-Apr-1996  thorpej branches: 1.3.12;
RCS Id police.
 1.2 29-Jan-1994  jtc Fix spelling error in Copyright notice
 1.1 27-Oct-1993  cgd add units command, written by Adrian Mariano (adrian@cam.cornell.edu or
mariano@geom.umn.edu), cleaned up, KNF'd, etc., by cgd
 1.3.12.1 23-Jun-2000  minoura Sync w/ netbsd-1-5-base.
 1.23 08-Mar-2019  msaitoh s/ the the / the /
 1.22 18-Mar-2014  riastradh branches: 1.22.26;
Merge riastradh-drm2 to HEAD.
 1.21 20-Jul-2013  wiz Use Mt for email addresses.
 1.20 06-Jan-2013  wiz branches: 1.20.2;
Sort options in man page SYNOPSIS and sync usage with it.
Bump date.
 1.19 01-Jan-2013  apb Add -l and -L options to units(1). "-l" simply lists all unit
definitions, while "-L" alsoreduces them to depend only on a few
primitive units (such as m, kg, sec).
 1.18 28-Dec-2012  apb Improve the description of the [count] from-unit to-unit arguments.
 1.17 03-Apr-2011  dholland branches: 1.17.4; 1.17.10;
Expand user warning (adding examples) and move to CAVEATS as it's not fixable.
 1.16 03-Apr-2011  dholland remove stray extra word
 1.15 28-Mar-2011  fair Add dholland's comment about units not warning users about non-sensical
conversions to the BUGS section.
 1.14 28-Mar-2011  dholland fix typo
 1.13 11-Sep-2005  wiz Use .Nm instead of the verbose program name. From YOMURA Masanori in private mail.
 1.12 30-Sep-2002  grant New sentence, new line.
 1.11 02-Apr-2002  atatat Fix a spelling error in the usage, and while I'm here, make it a
little more intelligent about the arguments. A count of the
"from-unit" can now be passed more easily on the command line.
 1.10 18-Dec-2001  wiz mdoc'ify. Sort sections.
 1.9 01-Dec-2001  wiz Whitespace cleanup.
 1.8 09-Mar-1999  ross Fix warning.
 1.7 09-Jan-1997  tls RCS ID police
 1.6 06-Apr-1996  thorpej RCS Id police.
 1.5 16-Jul-1994  jtc Fix manpage typo (Bug #328)
 1.4 01-Apr-1994  cgd use full path when naming units lib. this file should be converted to
mandoc...
 1.3 11-Jan-1994  jtc Fix spelling errors.
 1.2 14-Nov-1993  cgd from Thomas Eberhardt <thomas@mathematik.uni-Bremen.de>:
fix RCS id's comment
 1.1 27-Oct-1993  cgd add units command, written by Adrian Mariano (adrian@cam.cornell.edu or
mariano@geom.umn.edu), cleaned up, KNF'd, etc., by cgd
 1.17.10.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.17.10.1 25-Feb-2013  tls resync with head
 1.17.4.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.17.4.1 23-Jan-2013  yamt sync with head
 1.20.2.1 23-Jul-2013  riastradh sync with HEAD
 1.22.26.1 10-Jun-2019  christos Sync with HEAD
 1.27 05-Feb-2016  dholland Improve previous slightly; while we accept e.g. "meter2" to mean "meter^2",
don't allow "meter-2" to be interpreted as "meter^-2" as that's very
confusing.
 1.26 05-Feb-2016  dholland Improve the parser. Now we understand negative exponents; fixes PR 50768.

Also handle negative numbers better in general (don't randomly drop
the sign in a number of cases) and don't choke on exponents > 9.

This commit alters the meaning of a few previously valid but marginal
inputs (e.g. "3 foot-5 pound" is now treated as "3*-5 foot-pound"
rather than "3*5 foot-pound"; if you want the latter insert another
space) but corrects obviously wrong handling of many more.
 1.25 07-Jan-2014  joerg branches: 1.25.4;
Annotate functions using format strings.
 1.24 06-Jan-2013  wiz Sort options in man page SYNOPSIS and sync usage with it.
Bump date.
 1.23 02-Jan-2013  apb Really expand the name, not the definition, as the comment says.
 1.22 01-Jan-2013  apb fix incomplete comment
 1.21 01-Jan-2013  apb Add -l and -L options to units(1). "-l" simply lists all unit
definitions, while "-L" alsoreduces them to depend only on a few
primitive units (such as m, kg, sec).
 1.20 01-Jan-2013  apb Correctly ignore duplicate definitions. "continue" applies only to the
innermost loop.
 1.19 28-Dec-2012  apb Allow a number and a unit to be juxtaposed without an intervening space.
Now "litres/100km" works as desired, instead of silently being
treated as "litres/100".
 1.18 20-Mar-2012  matt branches: 1.18.2;
Use C89 function definitions
 1.17 06-Sep-2011  joerg branches: 1.17.2;
ANSIfy, static + __dead
 1.16 14-Apr-2009  lukem Appease -Wcast-qual with a liberal sprinkling of const.
 1.15 01-May-2006  christos branches: 1.15.30;
Coverity CID 814: Add extraneous checks to shut up Coverity.
 1.14 04-Nov-2004  dsl Add (unsigned char) cast to ctype functions
 1.13 05-Dec-2003  mycroft Recognize reciprocal conversions and generate output like GNU units(1).
 1.12 17-May-2003  itojun use strl*
 1.11 31-Aug-2002  kristerw Remove bogus output of '\n' when using -q.
 1.10 02-Apr-2002  atatat Fix a spelling error in the usage, and while I'm here, make it a
little more intelligent about the arguments. A count of the
"from-unit" can now be passed more easily on the command line.
 1.9 14-Apr-2000  simonb Don't declare 'extern opt*' getopt variables.
 1.8 03-Feb-1998  perry change includes to fix compiler warning
 1.7 20-Oct-1997  lukem WARNSify, fix .Nm usage, deprecate register, use <err.h>
 1.6 06-Apr-1996  thorpej RCS Id police.
 1.5 01-Apr-1996  mark Use an integer instead of a char to store the getopt() return value in
order to match the function prototype and to work with compilers that
default to unsigned chars.
Compare the getopt() return value with -1 instead of EOF.
 1.4 21-Mar-1996  jtc Be pedantic, main() returns int in C.
 1.3 21-Dec-1994  jtc misc cleanup by jimj.
 1.2 29-Jan-1994  jtc Fix spelling error in Copyright notice
 1.1 27-Oct-1993  cgd add units command, written by Adrian Mariano (adrian@cam.cornell.edu or
mariano@geom.umn.edu), cleaned up, KNF'd, etc., by cgd
 1.15.30.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.17.2.3 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.17.2.2 23-Jan-2013  yamt sync with head
 1.17.2.1 17-Apr-2012  yamt sync with head
 1.18.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.18.2.1 25-Feb-2013  tls resync with head
 1.25.4.1 15-Jul-2018  martin Pull up following revision(s) (requested by dholland in ticket #1620):

usr.bin/units/units.c: revision 1.26,1.27

Improve the parser. Now we understand negative exponents; fixes PR 50768.

Also handle negative numbers better in general (don't randomly drop
the sign in a number of cases) and don't choke on exponents > 9.

This commit alters the meaning of a few previously valid but marginal
inputs (e.g. "3 foot-5 pound" is now treated as "3*-5 foot-pound"
rather than "3*5 foot-pound"; if you want the latter insert another
space) but corrects obviously wrong handling of many more.

-

Improve previous slightly; while we accept e.g. "meter2" to mean "meter^2",
don't allow "meter-2" to be interpreted as "meter^-2" as that's very
confusing.
 1.30 20-Nov-2022  jakllsch Extend units.lib with prefixes from Resolution 3 of the 27th meeting of CGPM.
 1.29 24-Oct-2022  dholland Some more corrections/additions in units.lib:

1. cables; US cables are 720 ft, but international cables are 1/10
nautical mile and UK Admiralty cables are 1/10 of 1853.2 meters
instead of 1852 meters. Make "cable" refer to the international
definition, and add "uscable" and "admiraltycable".

2. rods and chains. US rods and chains and furlongs are defined in
terms of US survey feet, not international feet. Since the US is
apparently working on retiring survey feet, it seems like the best way
forward on this is to define two sets of these units, one prefixed
with "us". Also since this file was inconsistent about using "survey"
vs. "surveyors", fill in more duplicates.

Furthermore, Gunter's rods and chains and links are as best I can tell
the same as the international ones, so since we already have
"gunterschain" add "guntersrod" and "gunterslink".

3. If we're going to make pf a special abbreviation for picofarad,
it's reasonable to make uf a special abbreviation for microfarad, and
if we're going to define "meg" for "megabyte" we should also have
"gig".

4. A "franklin" _is_ a statcoulomb, not an approximation of one.

5. "jewel" has two Es.
 1.28 24-Oct-2022  dholland units.lib: fix "surveyfoot" and kill off "british".

The US survey foot is defined as 1200/3937 of a meter, whereas the
ordinary international foot is 0.3048 meter. These are almost, but
not quite the same.

Define the survey foot this way instead of defining an adjective unit
for the conversion, which is much less confusing even if the adjective
unit had a reasonable name. For the time being the fact that it was
called "british" remains thoroughly obscure.
 1.27 24-Oct-2022  dholland Reorganize units.lib.

It's all very well to file miscellaneous old units under "trivia" but
it's more useful to sort first by type and then by creakiness.

No functional change intended.
 1.26 15-Feb-2022  jakllsch Define becquerels in base units (like curies and rutherfords already are),
rather than in terms of curies.

Add symbol Bq for becquerel.
 1.25 15-Feb-2022  jakllsch fix inconsistent whitespace in units.lib
 1.24 23-Apr-2020  kre If we're having Thai units, make them correct. A tarangwah is a square wah,
which is ~4m^2 but not exactly (just as a wah is not exactly 2m, but close).
(wah apparently comes from the width of a person with hands outstretched...)
 1.23 22-Apr-2020  scole Add troyounce
 1.22 22-Apr-2020  scole On second thought, don't include more than one spelling for thai units
 1.21 22-Apr-2020  scole Add more Thai length, area and weight units
 1.20 21-Mar-2017  scole Add most common thai length/area measurements of wah rai ngan
 1.19 05-Feb-2016  dholland branches: 1.19.2; 1.19.4;
File watt in the right group, and accept W as well, as that's quite
standard.
 1.18 20-Sep-2015  martin Add tera- and peta-bytes.
 1.17 28-Dec-2012  apb Rename "tappit-hen" to "tappithen" because unit names cannot contain
hyphens. Also change the definition from "3 imperial" (a dimensionless
quantity) to "3 bottle" (2.25 litres). Wikipedia and several other web
sites say 3 bottles or 2.25 litres, but
<http://www.christies.com/lotfinder/wine/chateau-lafite-rothschild-vintage-1811-1-tappit-hen-per-4992576-details.aspx>
says:

There seems to be no firm definition of the bottle size referred to
as "tappit-hen". Believed to be of Scottish origin, a tappit-hen
can vary, according to which definition one follows, from 1 1/2
bottles to a tregnum or 3-bottle bottle. It is safest to say that it
approximates to a magnum.

and ends with:

1 Tappit-Hen (2.25 liters) per lot
 1.16 28-Dec-2012  apb Fix references to undefined units:
* "southamericarand" should be "southafricarand";
* "sidereal day" should be "siderealday";
* "perusol" should be "perunewsol".
 1.15 28-Mar-2011  dholland branches: 1.15.4; 1.15.10;
Update radioactivity-related units from http://physics.nist.gov/cuu/Units/.
The prior definition of sievert was, as far as I can tell, entirely wrong.

Caution: while "gray" and "sievert" have the same dimensionality,
they're not interchangeable -- you need to multiply by a fudge factor
that varies depending on the type of radiation and the tissue it's
affecting. (Dimensional analysis is often not a substitute for knowing
what you're doing.)

It would be nice if units had a way to warn users when they're trying
to do something that doesn't make sense, since there are lots of ways
to do so, but it doesn't, and it wouldn't be easy to arrange in the
general case.
 1.14 15-Feb-2007  dogcow dipotre -> dioptre.
(nobody's noticed this typo since the file was originally added in 1993...)
 1.13 01-Feb-2005  groo A hogshead is defined in the U.S. to be 63 gallons, and otherwise refers
to a volume unit of varying capacity (betwen 63 and 140(!)) gallons.

Since the U.S. is the only place it is defined, and I can find little
evidence to support the "barrel" definition, make it 63 gallons.

Like everything, this was prompted by the Simpsons.

"The metric system is a tool of the devil! My car gets 40 rods to the
hogshead, and that's the way I likes it!"

-- Abe Simpson
 1.12 23-Aug-2003  atatat Remove jeroboam, magnum, and rehoboam from the "trivia" section and
put them in another section with all the other bottles (the new aptly
named "bottles" section).

Also, add shed (1e-24 barn).
 1.11 12-Aug-2003  dogcow add the smoot
 1.10 04-Nov-2001  groo Add ``score'' (20) to trivia section.
 1.9 16-Oct-2001  bjh21 While I'm here, for those currencies that have a fixed exchange rate against
the Euro (BEF, DEM, ESP, FRF, IEP, ITL, LUF, NLG, ATS, PTE, FIM, GRD), use
that exchange rate.
 1.8 16-Oct-2001  bjh21 Add "rackunit" (alias "RU" or "U").
 1.7 30-Jan-2001  wiz Add 's' to netherlandguilder. Fixes bin/12082 by Benjamin Wong.
 1.6 30-Jan-2001  mjl Tyop: millennium, not millenium (FreeBSD PR/24369)
 1.5 15-Mar-1999  hubertf Add euro, per PR 6898 by Anders Magnusson <ragge@ludd.luth.se>
Value taken from www.deutsche-bank.de.
 1.4 09-Jan-1997  tls RCS ID police
 1.3 06-Apr-1996  thorpej RCS Id police.
 1.2 13-Aug-1995  cgd fix bugs (missing spaces) in definitions of nmile an Xunit, as pointed
out by John F. Woods <jfw@jfwhome.funhouse.com>.
 1.1 27-Oct-1993  cgd add units command, written by Adrian Mariano (adrian@cam.cornell.edu or
mariano@geom.umn.edu), cleaned up, KNF'd, etc., by cgd
 1.15.10.1 25-Feb-2013  tls resync with head
 1.15.4.1 23-Jan-2013  yamt sync with head
 1.19.4.1 21-Apr-2017  bouyer Sync with HEAD
 1.19.2.1 26-Apr-2017  pgoyette Sync with HEAD

RSS XML Feed