[BACK]Return to units.1 CVS log [TXT][DIR] Up to [local] / src / usr.bin / units

Annotation of src/usr.bin/units/units.1, Revision 1.4

1.4     ! deraadt     1: .\" $OpenBSD: units.1,v 1.3 1996/06/26 05:42:15 deraadt Exp $
        !             2: .\" converted to new format by deraadt@openbsd.org
        !             3: .Dd July 14, 1993
        !             4: .Dt UNITS 1
        !             5: .Os
        !             6: .Sh NAME
        !             7: .Nm uniq
        !             8: .Nd conversion program
        !             9: .Sh SYNOPSIS
        !            10: .Nm
        !            11: .Op Fl f Ar filename
        !            12: .Op Fl q
        !            13: .Op Fl v
        !            14: .Ar from-unit
        !            15: .Ar to-unit
        !            16: .Sh ARGUMENTS
        !            17: .Bl -tag -width Ds
        !            18: .It Fl f Ar filename
1.1       deraadt    19: Specifies the name of the units data file to load.
1.4     ! deraadt    20: .It Fl q
1.1       deraadt    21: Suppresses prompting of the user for units and the display of statistics
                     22: about the number of units loaded.
1.4     ! deraadt    23: .It Fl v
1.1       deraadt    24: Prints the version number.
1.4     ! deraadt    25: .It Ar from-unit Ar to-unit
1.1       deraadt    26: Allows a single unit conversion to be done directly from the command
                     27: line.  No prompting will occur.  The units program will print out
                     28: only the result of this single conversion.
1.4     ! deraadt    29: .El
        !            30: .Sh DESCRIPTION
1.1       deraadt    31: The units program converts quantities expression in various scales to
                     32: their equivalents in other scales.  The units program can only
                     33: handle multiplicative scale changes.  It cannot convert Centigrade
                     34: to Fahrenheit, for example.  It works interactively by prompting
                     35: the user for input:
1.4     ! deraadt    36: .Pp
1.1       deraadt    37: .nf
                     38:     You have: meters
                     39:     You want: feet
                     40:             * 3.2808399
                     41:             / 0.3048
                     42:
                     43:     You have: cm^3
                     44:     You want: gallons
                     45:             * 0.00026417205
                     46:             / 3785.4118
                     47: .fi
1.4     ! deraadt    48: .Pp
1.1       deraadt    49: Powers of units can be specified using the '^' character as shown in
                     50: the example, or by simple concatenation: 'cm3' is equivalent to 'cm^3'.
                     51: Multiplication of units can be specified by using spaces, a dash or
                     52: an asterisk.  Division of units is indicated by the slash ('/').
                     53: Note that multiplication has a higher precedence than division,
                     54: so 'm/s/s' is the same as 'm/s^2' or 'm/s s'.
                     55: If the user enters incompatible unit types, the units program will
                     56: print a message indicating that the units are not conformable and
                     57: it will display the reduced form for each unit:
1.4     ! deraadt    58: .Pp
1.1       deraadt    59: .nf
                     60:     You have: ergs/hour
                     61:     You want: fathoms kg^2 / day
                     62:     conformability error
                     63:             2.7777778e-11 kg m^2 / sec^3
                     64:             2.1166667e-05 kg^2 m / sec
                     65: .fi
1.4     ! deraadt    66: .Pp
1.1       deraadt    67: The conversion information is read from a units data file.  The default
                     68: file includes definitions for most familiar units, abbreviations and
                     69: metric prefixes.  Some constants of nature included are:
1.4     ! deraadt    70: .Bl -tag -width mercury
        !            71: .It pi
        !            72: ratio of circumference to diameter
        !            73: .It c
        !            74: speed of light
        !            75: .It e
        !            76: charge on an electron
        !            77: .It g
        !            78: acceleration of gravity
        !            79: .It force
        !            80: same as g
        !            81: .It mole
        !            82: Avogadro's number
        !            83: .It water
        !            84: pressure per unit height of water
        !            85: .It mercury
        !            86: pressure per unit height of mercury
        !            87: .It au
        !            88: astronomical unit
        !            89: .El
        !            90: .Pp
1.1       deraadt    91: \'Pound' is a unit of mass.  Compound names are run together
                     92: so 'poundforce' is a unit of force.  British units that differ from their
                     93: US counterparts are prefixed with 'br', and currency is prefixed with
                     94: its country name: 'belgiumfranc', 'britainpound'.  When searching for
                     95: a unit, if the specified string does not appear exactly as a unit
                     96: name, then the units program will try to remove a trailing 's' or
                     97: a trailing 'es' and check again for a match.
1.4     ! deraadt    98: .Pp
1.1       deraadt    99: All of these definitions can be read in the standard units file, or you
                    100: can supply your own file.  A unit is specified on a single line by
                    101: giving its name and an equivalence.  One should be careful to define
                    102: new units in terms of old ones so that a reduction leads to the
                    103: primitive units which are marked with '!' characters.
                    104: The units program will not detect infinite loops that could be caused
                    105: by careless unit definitions.
1.4     ! deraadt   106: .Pp
1.1       deraadt   107: Prefixes are defined in the same was as standard units, but with
                    108: a trailing dash at the end of the prefix name.
1.4     ! deraadt   109: .Sh BUGS
1.1       deraadt   110: The effect of including a '/' in a prefix is surprising.
1.4     ! deraadt   111: .Pp
1.1       deraadt   112: Exponents entered by the user can be only one digit.
                    113: You can work around this by multiplying several terms.
1.4     ! deraadt   114: .Pp
1.1       deraadt   115: The user must use | to indicate division of numbers and / to
                    116: indicate division of symbols.  This distinction should not
                    117: be necessary.
1.4     ! deraadt   118: .Pp
1.1       deraadt   119: The program contains various arbitrary limits on the length
                    120: of the units converted and on the length of the data file.
1.4     ! deraadt   121: .Pp
1.1       deraadt   122: The program should use a hash table to store units so that
                    123: it doesn't take so long to load the units list and check
                    124: for duplication.
1.4     ! deraadt   125: .Sh FILES
1.1       deraadt   126: /usr/share/misc/units.lib - the standard units library
1.4     ! deraadt   127: .Sh AUTHOR
1.1       deraadt   128: Adrian Mariano (adrian@cam.cornell.edu or mariano@geom.umn.edu)