((section 2 "Outdated egg!" (p "This is an egg for CHICKEN 4, the unsupported old release.  You're almost certainly looking for " (int-link "/eggref/5/unitconv" "the CHICKEN 5 version of this egg") ", if it exists.") (p "If it does not exist, there may be equivalent functionality provided by another egg; have a look at the " (link "https://wiki.call-cc.org/chicken-projects/egg-index-5.html" "egg index") ". Otherwise, please consider porting this egg to the current version of CHICKEN.") (tags "egg")) (section 2 "unitconv" (p "Conversion of units of measurement.") (toc)) (section 2 "Usage" (p "(require-extension unitconv)")) (section 2 "Documentation" (p "The " (tt "unitconv") " library is an implementation of unit conversion routines based on the paper by Gordon S. Novak:") (pre "Conversion of Units of Measurement.\nIEEE Trans. on Software Engineering, vol. 21, no. 8 (Aug. 1995), pp. 651-661.") (p "(Available online at " (link "http://www.cs.utexas.edu/users/novak/units95.html") ").") (p "Correctness of unit conversion is established by the technique of dimensional analysis: the source and goal units must have the same dimensions. Following Novak, this extension defines a dimension as an 8-vector of integral powers of the following base quantities:") (highlight scheme " (define-base-quantity  Unity          0)\n (define-base-quantity  Length         dimvals[0])\n (define-base-quantity  Time           dimvals[1])\n (define-base-quantity  Temperature    dimvals[2])\n (define-base-quantity  Mass           dimvals[3])\n (define-base-quantity  Current        dimvals[4])\n (define-base-quantity  Luminosity     dimvals[5])\n (define-base-quantity  Substance      dimvals[6])\n (define-base-quantity  Currency       dimvals[7])\n (define-base-quantity  Information    dimvals[8])") (p "The unit conversion routine uses dimension integers to check that the requested unit conversion is legitimate. For example, the conversion from kilograms to meters illegal. Consequently, the dimensionality of each unit must be specified when the unit is declared.") (highlight scheme "\n ;; Syntax is (define-unit name quantity factor abbreviation ...)\n \n ;; define units of length\n (define-unit meter     Length 1.0       m meters)\n (define-unit inch      Length 0.0254    in inches)\n \n ;; define units of mass and time\n (define-unit kilogram  Mass   1.0       kg kilograms)\n (define-unit second    Time   1.0       s seconds)\n \n ;; define two new derived quantities: acceleration and force\n (define-quantity   Acceleration  (/ Length (** Time 2)))\n (define-quantity   Force         (* Mass Acceleration))\n \n ;; define a unit of force\n (define-unit newton       Force (/ (* kilogram meter) (* second second)) nt newtons)\n") (pre "") (p "Now only conversion between units of the same dimensionality is permitted:") (highlight scheme " (unit-convert meter inch 1) ->  39.3700787401575\n (unit-convert meter inch 2 3 4) ->  (78.740157480315 118.110236220472 157.48031496063)\n \n (unit-convert meter kilogram 1)\n Error: (unitconv) unit-convert : given units are of different dimensions: \n  source= #(unit meter (m meters) [Length] 1.0) ; \n  dest=  #(unit kilogram (kg kilograms) [Mass] 1.0)") (section 3 "Procedures and Macros" (def (sig (procedure "unit-convert:: SRC * DEST * [VAL1 ...] -> (FACTOR1 ... )" (id unit-convert))) (p "Converts the given numeric values expressed in unit " (tt "SRC") " to their equivalents in unit " (tt "DEST") ".") (p "Arguments " (tt "SRC, DEST") " are records of type " (tt "unit") ". See the definitions below for information about the units that are defined by this extension, as well as for information about creating new units.")) (def (sig (procedure "unit-equal?:: UNIT1 * UNIT2 -> BOOL" (id unit-equal?))) (p "Returns true if the two units have the same dimension and factor, false otherwise.")) (def (sig (syntax "(define-quantity name expr)" (id define-quantity))) (p "Defines a derivative quantity " (tt "NAME") ".") (p (tt "EXPR") " is an S-expression with the following syntax:") (pre "quantity-expr ::=  base-quantity\n                 | derived-quantity\n                 | (* quantity-expr quantity-expr)\n                 | (* quantity-expr integer)\n                 | (/ quantity-expr quantity-expr)\n                 | (/ quantity-expr integer)\n                 | (** quantity-expr integer)") (p "where") (dl (dt (tt "base-quantity")) (dd "one of the predefined base quantities") (dt (tt "derived-quantity")) (dd "a quantity created by " (tt "define-quantity")) (dt (tt "**")) (dd "exponentiation operator"))) (def (sig (syntax "(define-unit name dims factor . abbrevs)" (id define-unit))) (p "Defines a variable " (tt "NAME") " that holds a unit definition of a unit with the given dimension and factor.") (p (tt "DIMS") " can be either one of the base quantities (see next section)  or a derivative quantity created by " (tt "define-quantity") ".")) (def (sig (syntax "(define-prefix-unit unit prefix . abbrevs)" (id define-prefix-unit))) (p "Defines a variable whose name is the concatenated " (tt "PREFIX") " and " (tt "UNIT") " and that holds a unit definition of the given unit and prefix."))) (section 3 "Predefined Quantities" (section 4 "Base Quantities" (dl (dt (tt "Unity") "  (dimensionless)") (dt (tt "Length")) (dt (tt "Time")) (dt (tt "Temperature")) (dt (tt "Mass")) (dt (tt "Current")) (dt (tt "Luminosity")) (dt (tt "Substance")) (dt (tt "Currency")) (dt (tt "Information")))) (section 4 "Derived Quantities" (dl (dt (b "Geometry")) (dt (tt "Area")) (dd (tt "(** Length 2)")) (dt (tt "Volume")) (dd (tt "(** Length 3)")) (dt (b "Mechanics")) (dt (tt "Velocity")) (dd (tt "(/ Length Time)")) (dt (tt "Acceleration")) (dd (tt "(/ Length (** Time 2))")) (dt (tt "Force")) (dd (tt "(* Mass Acceleration)")) (dt (tt "Pressure")) (dd (tt "(/ Force Area)")) (dt (tt "Energy")) (dd (tt "(* Force Length)")) (dt (tt "Power")) (dd (tt "(/ Energy Time)")) (dt (b "Electricity")) (dt (tt "Charge")) (dd (tt "(* Current Time)")) (dt (tt "Potential")) (dd (tt "(/ Energy Charge)")) (dt (tt "Capacitance")) (dd (tt "(/ Charge Potential)")) (dt (tt "Resistance")) (dd (tt "(/ Potential Current)")) (dt (tt "Conductance")) (dd (tt "(/ Current Potential)")) (dt (tt "Inductance")) (dd (tt "(/ (* Potential Time) Current)")) (dt (b "Chemistry")) (dt (tt "Concentration")) (dd (tt "(/ Substance Volume)")) (dt (tt "Density")) (dd (tt "(/ Mass Volume)")) (dt (b "Optics")) (dt (tt "Luminance")) (dd (tt "(/ Luminosity Area)")) (dt (b "Other")) (dt (tt "Frequency")) (dd (tt "(/ Unity Time)")) (dt (tt "Rate")) (dd (tt "(/ Information Time)"))))) (section 3 "Predefined Units" (section 4 "SI Unit Prefixes" (table (@ (style "table { table-layout: fixed; }")) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) "\n" (tr (th "Name") (th "Quantity") (th "Factor") (th "Abbreviation(s)")) "\n" (tr (td (tt "yocto")) (td (tt "Unity")) (td (tt "1e-24")) (td)) "\n" (tr (td (tt "zepto")) (td (tt "Unity")) (td (tt "1e-21")) (td)) "\n" (tr (td (tt "atto")) (td (tt "Unity")) (td (tt "1e-18")) (td)) "\n" (tr (td (tt "femto")) (td (tt "Unity")) (td (tt "1e-15")) (td)) "\n" (tr (td (tt "pico")) (td (tt "Unity")) (td (tt "1e-12")) (td)) "\n" (tr (td (tt "nano")) (td (tt "Unity")) (td (tt "1e-09")) (td)) "\n" (tr (td (tt "micro")) (td (tt "Unity")) (td (tt "1e-06")) (td)) "\n" (tr (td (tt "milli")) (td (tt "Unity")) (td (tt "0.001")) (td)) "\n" (tr (td (tt "centi")) (td (tt "Unity")) (td (tt "0.01")) (td)) "\n" (tr (td (tt "deci")) (td (tt "Unity")) (td (tt "0.1")) (td)) "\n" (tr (td (tt "deca")) (td (tt "Unity")) (td (tt "10.0")) (td)) "\n" (tr (td (tt "hecto")) (td (tt "Unity")) (td (tt "100.0")) (td)) "\n" (tr (td (tt "kilo")) (td (tt "Unity")) (td (tt "1000.0")) (td)) "\n" (tr (td (tt "mega")) (td (tt "Unity")) (td (tt "1000000.0")) (td)) "\n" (tr (td (tt "giga")) (td (tt "Unity")) (td (tt "1000000000.0")) (td)) "\n" (tr (td (tt "tera")) (td (tt "Unity")) (td (tt "1000000000000.0")) (td)) "\n" (tr (td (tt "peta")) (td (tt "Unity")) (td (tt "1e+15")) (td)) "\n" (tr (td (tt "exa")) (td (tt "Unity")) (td (tt "1e+18")) (td)) "\n" (tr (td (tt "zetta")) (td (tt "Unity")) (td (tt "1e+21")) (td)) "\n" (tr (td (tt "yotta")) (td (tt "Unity")) (td (tt "1e+24")) (td)))) (section 4 "IEC Standard Prefixes" (table (@ (style "table { table-layout: fixed; }")) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) "\n" (tr (th "Name") (th "Quantity") (th "Factor") (th "Abbreviation(s)")) "\n" (tr (td (tt "kibi")) (td (tt "Unity")) (td (tt "1024")) (td)) "\n" (tr (td (tt "mebi")) (td (tt "Unity")) (td (tt "1048576")) (td)) "\n" (tr (td (tt "gibi")) (td (tt "Unity")) (td (tt "1073741824.0")) (td)) "\n" (tr (td (tt "tebi")) (td (tt "Unity")) (td (tt "1099511627776.0")) (td)) "\n" (tr (td (tt "pebi")) (td (tt "Unity")) (td (tt "1.12589990684262e+15")) (td)) "\n" (tr (td (tt "exbi")) (td (tt "Unity")) (td (tt "1.15292150460685e+18")) (td)) "\n" (tr (td (tt "zebi")) (td (tt "Unity")) (td (tt "1.18059162071741e+21")) (td)) "\n" (tr (td (tt "yobi")) (td (tt "Unity")) (td (tt "1.20892581961463e+24")) (td)))) (section 4 "Time Multiples" (table (@ (style "table { table-layout: fixed; }")) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) "\n" (tr (th "Name") (th "Quantity") (th "Factor") (th "Abbreviation(s)")) "\n" (tr (td (tt "twelve")) (td (tt "Unity")) (td (tt "12")) (td)) "\n" (tr (td (tt "sixty")) (td (tt "Unity")) (td (tt "60")) (td)))) (section 4 "Angles" (table (@ (style "table { table-layout: fixed; }")) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) "\n" (tr (th "Name") (th "Quantity") (th "Factor") (th "Abbreviation(s)")) "\n" (tr (th "Name") (th "Quantity") (th "Factor") (th "Abbreviation(s)")) "\n" (tr (td (tt "radian")) (td (tt "Unity")) (td (tt "1.0")) (td (tt "(rad radians)"))) "\n" (tr (td (tt "degree")) (td (tt "Unity")) (td (tt "(/ pi 180)")) (td (tt "(deg degrees)"))))) (section 4 "Units of Length" (table (@ (style "table { table-layout: fixed; }")) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) "\n" (tr (th "Name") (th "Quantity") (th "Factor") (th "Abbreviation(s)")) "\n" (tr (td (tt "meter")) (td (tt "Length")) (td (tt "1.0")) (td (tt "(m meters)"))) "\n" (tr (td (tt "inch")) (td (tt "Length")) (td (tt "0.0254")) (td (tt "(in inches)"))) "\n" (tr (td (tt "foot")) (td (tt "Length")) (td (tt "0.3048")) (td (tt "(ft feet)"))) "\n" (tr (td (tt "angstrom")) (td (tt "Length")) (td (tt "1e-10")) (td (tt "(ang angstroms)"))) "\n" (tr (td (tt "parsec")) (td (tt "Length")) (td (tt "3.083e+16")) (td (tt "(parsecs)"))))) (section 4 "Units of Area and Volume" (table (@ (style "table { table-layout: fixed; }")) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) "\n" (tr (th "Name") (th "Quantity") (th "Factor") (th "Abbreviation(s)")) "\n" (tr (td (tt "square-meter")) (td (tt "Area")) (td (tt "(* meter meter)")) (td (tt "(m^2 m2 meter-squared meters-squared square-meters)"))) "\n" (tr (td (tt "square-inch")) (td (tt "Area")) (td (tt "(* inch inch)")) (td (tt "(in^2 inch-squared inches-squared square-inches)"))) "\n" (tr (td (tt "square-micron")) (td (tt "Area")) (td (tt "(* micrometer micrometer)")) (td (tt "(um^2 micrometer-squared micrometers-squared micron-squared microns-squared square-microns)"))) "\n" (tr (td (tt "square-millimeter")) (td (tt "Area")) (td (tt "(* millimeter millimeter)")) (td (tt "(mm^2 millimeter-squared millimeters-squared square-millimeters)"))) "\n" (tr (td (tt "cubic-meter")) (td (tt "Volume")) (td (tt "(* meter (* meter meter))")) (td (tt "(m^3 meter-cubed meters-cubed cubic-meters)"))) "\n" (tr (td (tt "liter")) (td (tt "Volume")) (td (tt "(* 0.001 cubic-meter)")) (td (tt "(L litre liters)"))))) (section 4 "Units of Mass" (table (@ (style "table { table-layout: fixed; }")) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) "\n" (tr (th "Name") (th "Quantity") (th "Factor") (th "Abbreviation(s)")) "\n" (tr (td (tt "kilogram")) (td (tt "Mass")) (td (tt "1.0")) (td (tt "(kg kilograms)"))) "\n" (tr (td (tt "gram")) (td (tt "Mass")) (td (tt "0.001")) (td (tt "(g grams)"))) "\n" (tr (td (tt "pound")) (td (tt "Mass")) (td (tt "(* gram 453.59237)")) (td (tt "(lb pounds)"))) "\n" (tr (td (tt "slug")) (td (tt "Mass")) (td (tt "(* pound 32.17405)")) (td (tt "(slugs)"))) "\n" (tr (td (tt "atomic-mass-unit")) (td (tt "Mass")) (td (tt "1.6605402e-27")) (td (tt "(amu atomic-mass-units)"))))) (section 4 "Units of Time" (table (@ (style "table { table-layout: fixed; }")) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) "\n" (tr (th "Name") (th "Quantity") (th "Factor") (th "Abbreviation(s)")) "\n" (tr (td (tt "second")) (td (tt "Time")) (td (tt "1.0")) (td (tt "(s seconds)"))) "\n" (tr (td (tt "hour")) (td (tt "Time")) (td (tt "(* sixty (* sixty second))")) (td (tt "(h hrs hours)"))))) (section 4 "Units of Acceleration" (table (@ (style "table { table-layout: fixed; }")) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) "\n" (tr (th "Name") (th "Quantity") (th "Factor") (th "Abbreviation(s)")) "\n" (tr (td (tt "meters-per-second-squared")) (td (tt "Acceleration")) (td (tt "(/ meter (* second second))")) (td (tt "(m/s2 m/s^2 m/sec2 m/sec^2)"))))) (section 4 "Units of Frequency" (table (@ (style "table { table-layout: fixed; }")) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) "\n" (tr (th "Name") (th "Quantity") (th "Factor") (th "Abbreviation(s)")) "\n" (tr (td (tt "hertz")) (td (tt "Frequency")) (td (tt "1.0")) (td (tt "(hz)"))))) (section 4 "Units of Force" (table (@ (style "table { table-layout: fixed; }")) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) "\n" (tr (th "Name") (th "Quantity") (th "Factor") (th "Abbreviation(s)")) "\n" (tr (td (tt "newton")) (td (tt "Force")) (td (tt "(/ (* kilogram meter) (* second second))")) (td (tt "(nt newtons)"))) "\n" (tr (td (tt "pound-force")) (td (tt "Force")) (td (tt "(/ (* slug foot) (* second second))")) (td (tt "(lbf)"))))) (section 4 "Units of Power" (table (@ (style "table { table-layout: fixed; }")) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) "\n" (tr (th "Name") (th "Quantity") (th "Factor") (th "Abbreviation(s)")) "\n" (tr (td (tt "watt")) (td (tt "Power")) (td (tt "(/ (* kilogram meter meter) (* second second second))")) (td (tt "(W watts)"))) "\n" (tr (td (tt "horsepower")) (td (tt "Power")) (td (tt "(* 550 (/ (* foot pound-force) second))")) (td (tt "(hp)"))))) (section 4 "Units of Energy" (table (@ (style "table { table-layout: fixed; }")) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) "\n" (tr (th "Name") (th "Quantity") (th "Factor") (th "Abbreviation(s)")) "\n" (tr (td (tt "joule")) (td (tt "Energy")) (td (tt "(* newton meter)")) (td (tt "(J joules)"))) "\n" (tr (td (tt "electron-volt")) (td (tt "Energy")) (td (tt "(* 1.60217733e-19 joule)")) (td (tt "(ev electron-volts)"))) "\n" (tr (td (tt "kilowatt-hour")) (td (tt "Energy")) (td (tt "(* kilo (* watt hour))")) (td (tt "(kwh kilowatt-hours)"))) "\n" (tr (td (tt "calorie")) (td (tt "Energy")) (td (tt "(* 4.184 joule)")) (td (tt "(cal calories)"))) "\n" (tr (td (tt "erg")) (td (tt "Energy")) (td (tt "(* 1e-07 joule)")) (td (tt "(ergs)"))) "\n" (tr (td (tt "british-thermal-unit")) (td (tt "Energy")) (td (tt "(* 1055.056 joule)")) (td (tt "(btu btus)"))))) (section 4 "Units of Current" (table (@ (style "table { table-layout: fixed; }")) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) "\n" (tr (th "Name") (th "Quantity") (th "Factor") (th "Abbreviation(s)")) "\n" (tr (td (tt "ampere")) (td (tt "Current")) (td (tt "1.0")) (td (tt "(A amp amps amperes)"))))) (section 4 "Units of Electric Charge" (table (@ (style "table { table-layout: fixed; }")) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) "\n" (tr (th "Name") (th "Quantity") (th "Factor") (th "Abbreviation(s)")) "\n" (tr (td (tt "coulomb")) (td (tt "Charge")) (td (tt "(* ampere second)")) (td (tt "(C coulombs)"))))) (section 4 "Units of Electric Potential" (table (@ (style "table { table-layout: fixed; }")) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) "\n" (tr (th "Name") (th "Quantity") (th "Factor") (th "Abbreviation(s)")) "\n" (tr (td (tt "volt")) (td (tt "Potential")) (td (tt "(/ (* kilogram meter meter) (* ampere second second second))")) (td (tt "(V volts)"))))) (section 4 "Units of Resistance" (table (@ (style "table { table-layout: fixed; }")) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) "\n" (tr (th "Name") (th "Quantity") (th "Factor") (th "Abbreviation(s)")) "\n" (tr (td (tt "ohm")) (td (tt "Resistance")) (td (tt "(/ volt ampere)")) (td (tt "(ohms)"))))) (section 4 "Units of Capacitance" (table (@ (style "table { table-layout: fixed; }")) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) "\n" (tr (th "Name") (th "Quantity") (th "Factor") (th "Abbreviation(s)")) "\n" (tr (td (tt "farad")) (td (tt "Capacitance")) (td (tt "(/ coulomb volt)")) (td (tt "(F farads)"))))) (section 4 "Units of Conductance" (table (@ (style "table { table-layout: fixed; }")) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) "\n" (tr (th "Name") (th "Quantity") (th "Factor") (th "Abbreviation(s)")) "\n" (tr (td (tt "siemens")) (td (tt "Conductance")) (td (tt "(/ ampere volt)")) (td (tt "(S mho)"))))) (section 4 "Units of Inductance" (table (@ (style "table { table-layout: fixed; }")) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) "\n" (tr (th "Name") (th "Quantity") (th "Factor") (th "Abbreviation(s)")) "\n" (tr (td (tt "henry")) (td (tt "Inductance")) (td (tt "(/ (* meter meter kilogram) (* ampere ampere second second))")) (td (tt "(H)"))))) (section 4 "Units of Substance" (table (@ (style "table { table-layout: fixed; }")) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) "\n" (tr (th "Name") (th "Quantity") (th "Factor") (th "Abbreviation(s)")) "\n" (tr (td (tt "mole")) (td (tt "Substance")) (td (tt "1.0")) (td (tt "(mol moles)"))))) (section 4 "Units of density" (table (@ (style "table { table-layout: fixed; }")) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) "\n" (tr (th "Name") (th "Quantity") (th "Factor") (th "Abbreviation(s)")) "\n" (tr (td (tt "rho")) (td (tt "Density")) (td (tt "(/ kilogram cubic-meter)")) (td)))) (section 4 "Units of concentration" (table (@ (style "table { table-layout: fixed; }")) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) "\n" (tr (th "Name") (th "Quantity") (th "Factor") (th "Abbreviation(s)")) "\n" (tr (td (tt "molarity")) (td (tt "Concentration")) (td (tt "(/ mole liter)")) (td (tt "(M mol/L)"))) "\n" (tr (td (tt "parts-per-million")) (td (tt "Concentration")) (td (tt "(/ milligram kilogram)")) (td (tt "(ppm)"))))) (section 4 "Units of temperature" (table (@ (style "table { table-layout: fixed; }")) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) "\n" (tr (th "Name") (th "Quantity") (th "Factor") (th "Abbreviation(s)")) "\n" (tr (td (tt "degK")) (td (tt "Temperature")) (td (tt "1.0")) (td (tt "(K)"))))) (section 4 "Units of information" (table (@ (style "table { table-layout: fixed; }")) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) "\n" (tr (th "Name") (th "Quantity") (th "Factor") (th "Abbreviation(s)")) "\n" (tr (td (tt "bit")) (td (tt "Information")) (td (tt "1")) (td (tt "(b bits shannon shannons Sh)"))) "\n" (tr (td (tt "byte")) (td (tt "Information")) (td (tt "8")) (td (tt "(B bytes)"))) "\n" (tr (td (tt "nat")) (td (tt "Information")) (td (tt "1.44269504088896")) (td (tt "(nats nit nits nepit nepits)"))) "\n" (tr (td (tt "ban")) (td (tt "Information")) (td (tt "3.32192809488736")) (td (tt "(bans hartley hartleys Hart Harts dit dits)"))))) (section 4 "Units of information rate" (table (@ (style "table { table-layout: fixed; }")) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) (col (@ (width "25%"))) "\n" (tr (th "Name") (th "Quantity") (th "Factor") (th "Abbreviation(s)")) "\n" (tr (td (tt "bits-per-second")) (td (tt "Rate")) (td (tt "(/ bit second)")) (td (tt "(bps)"))) "\n" (tr (td (tt "bytes-per-second")) (td (tt "Rate")) (td (tt "(/ byte second)")) (td (tt "(Bps)")))))) (section 3 "Arithmetic Operations with Units" (p "The " (tt "with-units") " library contains procedures for arithmetic operations on quantities with units. A quantity with unit information is created by procedure " (tt "val-with-units") ":") (pre "(use unitconv with-units)\n(val-with-units 10 m) ->  #(10 #(unit meter (m meters) [Length] 1.0))") (p "The following operations are available for operations on quantities with units:") (dl (dt (tt "u:value")) (dd "Returns the value of the given quantity.") (dt (tt "u:units")) (dd "Returns the unit of the given quantity.") (dt (tt "u:equal?")) (dd "Returns true if the units of the given quantities are equal, false otherwise.") (dt (tt "u:zero?")) (dt (tt "u:=")) (dt (tt "u:negate")) (dt (tt "u:invert")) (dt (tt "u:+ u:- u:* u:/ ")) (dt (tt "u:sqrt")) (dt (tt "u:sin")) (dt (tt "u:cos")) (dt (tt "u:expt") " ")))) (section 2 "About this egg" (section 3 "Author" (p (int-link "/users/ivan-raikov" "Ivan Raikov"))) (section 3 "Version history" (dl (dt "2.6") (dd "Bugfixes in unit* and unit/") (dt "2.3") (dd "Added definitions for centimeter and centimeter-squared") (dt "2.2") (dd "Removed redundant definition of define-unit (reported by felix)") (dt "2.1") (dd "Documentation converted to wiki format") (dt "2.0") (dd "Added unit arithmetic (with-units)") (dt "1.8") (dd "Exporting all prefixed units; added info on information units [Joshua Griffith]") (dt "1.7") (dd "Exporting the Rate quantity") (dt "1.6") (dd "Exporting the IEC standard prefixes") (dt "1.5") (dd "Ported to Chicken 4") (dt "1.4") (dd "The predefined quantities have been put into unit-definitions.scm") (dt "1.3") (dd "Bug fix in unit-convert") (dt "1.2") (dd "Changed unit-convert to return a single numeric value given a single conversion argument") (dt "1.1") (dd "Added information units [patch by Joshua Griffith]") (dt "1.0") (dd "Initial release"))) (section 3 "License" (pre "Copyright 2007-2015 Ivan Raikov and the University of California, Irvine.\n\nThis program is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or (at\nyour option) any later version.\n\nThis program is distributed in the hope that it will be useful, but\nWITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\nGeneral Public License for more details.\n\nA full copy of the GPL license can be found at\n<http://www.gnu.org/licenses/>."))))