Commit Graph

79 Commits

Author SHA1 Message Date
jakllsch 79befb7182 Extend units.lib with prefixes from Resolution 3 of the 27th meeting of CGPM. 2022-11-20 14:53:14 +00:00
dholland f550f892a7 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.
2022-10-24 05:52:48 +00:00
dholland 44d9c27b68 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.
2022-10-24 05:04:50 +00:00
dholland e53b3c8eb0 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.
2022-10-24 04:55:19 +00:00
jakllsch bf04c5e74f Define becquerels in base units (like curies and rutherfords already are),
rather than in terms of curies.

Add symbol Bq for becquerel.
2022-02-15 16:21:35 +00:00
jakllsch c0b7f470de fix inconsistent whitespace in units.lib 2022-02-15 13:44:47 +00:00
kre 01d1f1dd0c 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...)
2020-04-23 09:38:17 +00:00
scole bdf8490536 Add troyounce 2020-04-22 16:57:57 +00:00
scole 26bd6e917a On second thought, don't include more than one spelling for thai units 2020-04-22 16:35:47 +00:00
scole 6985efe262 Add more Thai length, area and weight units 2020-04-22 16:21:37 +00:00
msaitoh c2f2b1bf58 s/ the the / the / 2019-03-08 08:12:39 +00:00
scole 1c8dc2cc2e Add most common thai length/area measurements of wah rai ngan 2017-03-21 01:21:59 +00:00
dholland 289d830c55 File watt in the right group, and accept W as well, as that's quite
standard.
2016-02-05 03:38:50 +00:00
dholland ac57bd7b30 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.
2016-02-05 03:32:49 +00:00
dholland 0561f14b04 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.
2016-02-05 03:30:08 +00:00
martin 48059d8422 Add tera- and peta-bytes. 2015-09-20 15:09:06 +00:00
riastradh 6cb10275d0 Merge riastradh-drm2 to HEAD. 2014-03-18 18:20:35 +00:00
joerg d9c7ee5b63 Annotate functions using format strings. 2014-01-07 02:07:08 +00:00
wiz a5684d07dd Use Mt for email addresses. 2013-07-20 21:39:55 +00:00
wiz 4bdac686eb Sort options in man page SYNOPSIS and sync usage with it.
Bump date.
2013-01-06 00:19:13 +00:00
apb e5b434bcf4 Really expand the name, not the definition, as the comment says. 2013-01-02 14:05:04 +00:00
apb 25dbb40a11 fix incomplete comment 2013-01-01 12:45:06 +00:00
apb c6933fca67 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).
2013-01-01 11:51:55 +00:00
apb 55f985ffa7 Correctly ignore duplicate definitions. "continue" applies only to the
innermost loop.
2013-01-01 11:44:00 +00:00
apb 1d8e06e4e4 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
2012-12-28 17:57:46 +00:00
apb fd02783e45 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".
2012-12-28 17:07:03 +00:00
apb dd9b8fe876 Fix references to undefined units:
* "southamericarand" should be "southafricarand";
* "sidereal day" should be "siderealday";
* "perusol" should be "perunewsol".
2012-12-28 13:45:53 +00:00
apb 5cd73ddec1 Improve the description of the [count] from-unit to-unit arguments. 2012-12-28 13:25:25 +00:00
matt d34c2845b8 Use C89 function definitions 2012-03-20 20:34:57 +00:00
joerg 1ed141bb41 ANSIfy, static + __dead 2011-09-06 18:35:41 +00:00
dholland efb9133f26 Expand user warning (adding examples) and move to CAVEATS as it's not fixable. 2011-04-03 19:44:15 +00:00
dholland ba1f9c173a remove stray extra word 2011-04-03 19:25:05 +00:00
fair 99c0cae956 Add dholland's comment about units not warning users about non-sensical
conversions to the BUGS section.
2011-03-28 16:09:10 +00:00
dholland 75f2c9abd2 fix typo 2011-03-28 00:14:51 +00:00
dholland 8cf15952a4 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.
2011-03-28 00:08:47 +00:00
lukem 95f5c18e58 Appease -Wcast-qual with a liberal sprinkling of const. 2009-04-14 05:55:12 +00:00
dogcow 60918448c9 dipotre -> dioptre.
(nobody's noticed this typo since the file was originally added in 1993...)
2007-02-15 22:37:27 +00:00
christos 4f0fad7e36 Coverity CID 814: Add extraneous checks to shut up Coverity. 2006-05-01 00:00:12 +00:00
wiz 013b8f4ef7 Use .Nm instead of the verbose program name. From YOMURA Masanori in private mail. 2005-09-11 23:28:55 +00:00
groo 83d3e13964 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
2005-02-01 01:08:10 +00:00
dsl df38245cee Add (unsigned char) cast to ctype functions 2004-11-04 07:38:43 +00:00
mycroft 8ee74ae180 Recognize reciprocal conversions and generate output like GNU units(1). 2003-12-05 22:26:43 +00:00
atatat 2025668369 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).
2003-08-23 04:15:33 +00:00
dogcow 9217e5df47 add the smoot 2003-08-12 19:03:32 +00:00
salo 0f5a0c156d netbsd.org->NetBSD.org 2003-07-26 20:34:11 +00:00
itojun 4005e1b9e9 use strl* 2003-05-17 21:05:10 +00:00
grant be8ae688ae New sentence, new line. 2002-09-30 11:08:56 +00:00
kristerw 29301c43b8 Remove bogus output of '\n' when using -q. 2002-08-31 07:26:17 +00:00
atatat d68a625e3d 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.
2002-04-02 18:08:28 +00:00
wiz 2246cc750f mdoc'ify. Sort sections. 2001-12-18 01:06:09 +00:00