pax_global_header00006660000000000000000000000064145021307770014520gustar00rootroot0000000000000052 comment=2d41b0e0cdd0eac87a6569338c503dc708861ca7 postgresql-unit-7.8/000077500000000000000000000000001450213077700145565ustar00rootroot00000000000000postgresql-unit-7.8/.github/000077500000000000000000000000001450213077700161165ustar00rootroot00000000000000postgresql-unit-7.8/.github/workflows/000077500000000000000000000000001450213077700201535ustar00rootroot00000000000000postgresql-unit-7.8/.github/workflows/regression.yml000066400000000000000000000015241450213077700230600ustar00rootroot00000000000000name: Build on: [push, pull_request] jobs: build: runs-on: ubuntu-latest defaults: run: shell: sh strategy: matrix: pgversion: - 16 - 15 - 14 - 13 - 12 - 11 - 10 - 9.6 - 9.5 env: PGVERSION: ${{ matrix.pgversion }} steps: - name: checkout uses: actions/checkout@v3 - name: install pg run: | sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -v $PGVERSION -p -i sudo -u postgres createuser -s "$USER" - name: build run: | make PROFILE="-Werror" sudo -E make install - name: test run: | make installcheck - name: show regression diffs if: ${{ failure() }} run: | cat regression.diffs postgresql-unit-7.8/.gitignore000066400000000000000000000002671450213077700165530ustar00rootroot00000000000000powers regression.diffs regression.out results/ tags unit--*.sql unit.o unitparse.tab.c unitparse.tab.h unitparse.tab.o unitparse.yy.c unitparse.yy.o unit.so unittest unittest.o *.bc postgresql-unit-7.8/.vimrc000066400000000000000000000000161450213077700156740ustar00rootroot00000000000000set ts=4 sw=4 postgresql-unit-7.8/Makefile000066400000000000000000000032251450213077700162200ustar00rootroot00000000000000MODULE_big = unit OBJS = unit.o unitparse.yy.o unitparse.tab.o EXTENSION = unit DATA = unit_prefixes.data unit_units.data \ unit--1.sql unit--1--2.sql \ unit--2.sql DATA_built = unit--2--3.sql unit--3.sql \ unit--3--4.sql unit--4.sql \ unit--4--5.sql unit--5.sql \ unit--5--6.sql unit--6.sql \ unit--6--7.sql unit--7.sql REGRESS = extension tables unit binary unicode prefix units time temperature functions language_functions round derived compare aggregate iec custom # Jessie's and trusty's bison (3.0.2) is buggy, ship pregenerated .tab files EXTRA_CLEAN = unitparse.yy.* powers powers.o unit-*.dump # unitparse.tab.* # avoid add/mult contraction so '-459.67 °F' is really '0 K' # problem visible on ppc64el Ubuntu trusty..zesty (Debian unaffected) PG_CPPFLAGS += -ffp-contract=off PG_CONFIG = pg_config PGXS := $(shell $(PG_CONFIG) --pgxs) include $(PGXS) HAS_CROSSTAB = $(shell [ $(VERSION_NUM) -ge 90600 ] && echo yes) ifeq ($(HAS_CROSSTAB),yes) REGRESS += crosstab convert endif # upgrade testing, not enabled by default (needs extension actually installed) #REGRESS += upgrade unit.o: unit.c unit.h defined_units.h float8out_unit.h unitparse.yy.c: unitparse.l flex -o $@ $< unitparse.yy.o: unit.h defined_units.h unitparse.tab.c # actually unitparse.tab.h unitparse.tab.c unitparse.tab.h: unitparse.y bison -d $< unitparse.tab.o: unit.h defined_units.h %.sql: %.sql.in sed -e "s!@MODULEDIR@!$(datadir)/$(datamoduledir)!g" $< > $@ # unit definitions from GNU units definitions.units.patched: definitions.units definitions.units.patch cp $< $@ patch $@ definitions.units.patch # powers-of-10 template powers: powers.c gcc -o $@ $^ -lm postgresql-unit-7.8/NEWS.md000066400000000000000000000056061450213077700156630ustar00rootroot000000000000007.7: Jan 06, 2023 ----------------- * Fix printing of values around 1e33 on i386. 7.6: Jan 04, 2023 ----------------- * Import definitions.units September 2022 Version 3.15. * Add R ronna, Q quetta, r ronto, Q quecto, Ri robi, Qi quebi prefixes. 7.4: May 20, 2021 - World Metrology Day --------------------------------------- * Fix hash table creation on PostgreSQL 14. 7.3: Oct 19, 2020 ----------------- * Packaging updates. 7.2: May 20, 2019 - World Metrology Day --------------------------------------- * Rewire PostgreSQL 12's new extra_float_digits=1 default internally to 0 to keep nice, short decimal representations. 7.1: Dec 3, 2018 ---------------- * Import definitions.unit 2.44 from units 2.18 with 36 new units. When upgrading from a previous install, use `SELECT unit_load();` to import. * Adjust powers.h to round "1" down by one ULP. 7.0: Sep 28, 2018 ----------------- * Format time using commonyears + days + hh:mm:ss.sss s. * Avoid using Gs for Gigaseconds, that's actually gauss. * Modify @(unit, text) operator to return text instead of cstring. * Import definitions.units from GNU units 2.17 with 13 new units. * Add π to known units. * Remove bison 2 compat mode, but keep pregenerated files for jessie and trusty. * Support send/receive via the binary protocol. * Support Infinity and NaN. * Add strict comparison operators that error out when dimensions of arguments do not match: << <<= == <<>> >>= >>. * Add range type over units: unitrange. 6.0: Mar 7, 2018 ---------------- * Add @@ operator: similar to @, but returns the value of the resulting unit as double precision number. * Fix parsing of addition/subtraction in unit values. * Grant SELECT on unit prefixes and units table to public. * Add unit_load() function to load/update the data tables. 5.0: Jan 10, 2018 ----------------- * Add rounding function. * Import definitions.units from GNU units 2.16 with 70 new units. 4.0: Jul 7, 2017 ---------------- * Support exponents written using Unicode superscript characters. * Report 22P02/invalid_text_representation on invalid unit input. * Fix crash when unit_reset() runs into an OOM error. Patch by Andreas Seltenreich, thanks! * Change @ operator signature to (unit, text). 3.0: Mar 22, 2017 ----------------- * Support defining new units at runtime. * Import unit definitions from GNU units. * Add sqrt() and cbrt() functions. * Extension is not relocatable after installation anymore. * Bump extension version to 3. * Bump minimum supported PostgreSQL version to 9.5 so we can use hash_create(HASH_BLOBS). * Bump license to GPL-3+ to match GNU units' license. 2.0: Jan 9, 2017 ---------------- * Support IEC binary prefixes for byte. * Support United States customary units: in, ft, yd, mi, oz, lb. * Add variance and stddev aggregates 1.1: Oct 31, 2016 ----------------- * Use float8out_internal to format floats on output. v1.0: Sep 22, 2016 ------------------ * Initial release postgresql-unit-7.8/README.md000066400000000000000000000471301450213077700160420ustar00rootroot00000000000000SI Units for PostgreSQL ======================= Christoph Berg **postgresql-unit** implements a *PostgreSQL datatype for [SI units](https://en.wikipedia.org/wiki/International_System_of_Units), plus byte*. The eight base units can be combined to arbitrarily complex derived units using operators defined in the PostgreSQL type system. SI and [IEC binary](https://en.wikipedia.org/wiki/Binary_prefix) prefixes are used for input and output, and quantities can be converted to arbitrary scale. Unit and prefix definitions are retrieved from database tables, and new definitions can be added at run time. The extension comes with over 2500 units and over 100 prefixes found in the [definitions.units file](definitions.units) in [*GNU Units*](https://www.gnu.org/software/units/). Requires PostgreSQL 9.5 or later (uses *HASH_BLOBS*), flex, and bison 3 (the pre-built grammar files are used if only bison 2 is available). [Changelog](NEWS.md) Features -------- * Base types: *meter (m), kilogram (kg), second (s), ampere (A), kelvin (K), mole (mol), candela (cd), byte (B)* * derived units coherent with SI: *radian (rad), steradian (sr), hertz (Hz), newton (N), pascal (Pa), joule (J), watt (W), coulomb (C), volt (V), farad (F), ohm (Ω), siemens (S), weber (Wb), tesla (T), henry (H), degree Celsius (°C, support limited), lumen (lm), lux (lx), becquerel (Bq), gray (Gy), sievert (Sv), katal (kat)* * non-coherent units: *minute (min), hour(h), day(d), hectare (ha), litre (l), tonne (t), bar, astronomical unit (au)* * United States customary units: *inch (in), foot (ft), yard (yd), mile (mi), ounce (oz), pound (lb)* * about 2400 other units imported from GNU Units (including some humorous ones) * prefix multiples: *da, h, k, M, G, T, P, E, Z, Y, R, Q* * prefix fractions: *d, c, m, μ, n, p, f, a, z, y, r, q* * IEC binary prefix multiples: *Ki, Mi, Gi, Ti, Pi, Ei, Zi, Yi, Ri, Qi* * other prefixes imported from GNU Units * operators: **+, -, *, /, ^**, conversion to arbitrary scale (**@, @@**) * aggregate functions * range type Examples -------- ``` # CREATE extension unit; CREATE EXTENSION # SELECT '800 m'::unit + '500 m' AS length; length -------- 1.3 km # SELECT '120 km/h'::unit AS speed; speed ---------------------- 33.3333333333333 m/s # SELECT '9.81 N'::unit / 'kg' AS gravity; gravity ------------ 9.81 m/s^2 # SELECT '1 kilosecond'::unit AS time; time ------------ 00:16:40 s # SELECT '2 MB/min'::unit @ 'GB/d' AS traffic; traffic ----------- 2.88 GB/d # SELECT '1 hl'::unit @ '0.5 l' AS bottles_of_beer; bottles_of_beer ----------------- 200 * 0.5 l # SET unit.byte_output_iec = on; # SELECT '4 TB'::unit AS disk_sold_as_4tb; disk_sold_as_4tb ---------------------- 3.63797880709171 TiB # SELECT '500 mi'::unit AS walk_500_miles; walk_500_miles ---------------- 804.672 km # SELECT unitrange('earthradius_polar', 'earthradius_equatorial') AS earthradius; earthradius ----------------------------------------- ["6.35675174834046 Mm","6.37813649 Mm") # SET extra_float_digits = -12; # SELECT 'earthmass'::unit as earth; earth ───────── 5.97 Rg ``` Installation ------------ * Homepage: https://github.com/df7cb/postgresql-unit * Debian package: https://tracker.debian.org/pkg/postgresql-unit * Arch package: https://aur.archlinux.org/packages/postgresql-unit/ To compile from source, install the PostgreSQL server headers, `flex`, and `bison`. Example on Debian: ``` sudo apt-get install build-essential postgresql-server-dev-10 flex bison make PG_CONFIG=/usr/lib/postgresql/10/bin/pg_config sudo make install PG_CONFIG=/usr/lib/postgresql/10/bin/pg_config ``` Config ------ * `unit.byte_output_iec`: Set to `on` to format byte quantities using IEC binary prefixes (Ki, Mi, ...) on output by default. (Default: off) * `unit.output_base_units`: Set to `on` to format values using only base types without prefixes. (Default: off) * `unit.output_superscript`: Set to `on` to output unit exponents using Unicode superscripts. (Default: off) * `unit.time_output_custom`: Set to on to output time unit values greater or equal to 60 s using minutes, hours, days, and julianyears instead of seconds with SI prefixes. (Default: on) Internal Representation ----------------------- Internally, `unit` datums are a 16-byte struct consisting of a double precision floating point number for the unit value, and an array of 8 signed character values to store the exponents of the base units for the unit dimension. ``` typedef struct Unit { double value; signed char units[N_UNITS]; } Unit; ``` All operators and functions operate with that base-units-only format. Conversion from and to other unit representations is done on input, output, and using the `@` operator only. This is also the format used in binary mode in the PostgreSQL wire protocol. Prefixes and Units Lookup Tables -------------------------------- Prefixes are defined in the table `unit_prefixes`: ``` CREATE TABLE unit_prefixes ( prefix varchar(32) PRIMARY KEY, factor double precision NOT NULL, definition text, -- original definition, informational dump boolean DEFAULT true ); ``` Units are defined in the table `unit_units`: ``` CREATE TABLE unit_units ( name varchar(32) PRIMARY KEY, unit unit NOT NULL, shift double precision, -- NULL means 0.0 here definition text, -- original definition, informational dump boolean DEFAULT true ); ``` Whenever the unit input lexer encounters a unit name, it queries the `unit_units` table to see if the definition is found. If no match is found, the `unit_prefixes` and `unit_units` tables are cross-joined to see if the concatenation of prefix and unit name matches. At this point, an error is thrown if the prefix-unit combination is ambiguous, e.g. for "dat" which is either a dekatonne (da-t) or a deciatmosphere (d-at). If no match is found, and the unit name is ending with 's' (e.g. "kilometers" or "lbs"), the two lookup steps are repeated with the trailing 's' removed. If the unit definition could be resolved, the result is stored in a backend-local hash table to speed up the next lookup. (The function `unit_is_hashed()` reports if a given unit name is already cached. The function `unit_reset()` clears the hash table. Use it if unit definitions are changed.) The `definition` column is only provided for information on how the unit was originally defined. GNU Units --------- On installation, the prefixes and units definitions tables are populated with data imported from the `definitions.units` file found in the GNU Units tool. Notable omissions are currency units (we don't have a base type for them, and exchange rates aren't static anyway), and non-linear units such as dBm based on dB and other conversions based on functions and lookup tables. The [definitions.units](definitions.units) file is an interesting read on its own due to extensive comments explaining the history and origin of the units covered. The `unit_load()` function can be used to reload the `unit_prefixes.data` and `unit_units.data` files from disk. Extension upgrades use it to load newly added or changed definitions, but it is also user-callable. User-defined entries are preserved. User-Defined Prefixes and Units ------------------------------- To create custom prefixes and units, insert new rows into the tables: ``` # SELECT '1 foobar'::unit; ERROR: unit "foobar" is not known # INSERT INTO unit_prefixes VALUES ('foo', 42); INSERT 0 1 # SELECT '1 foobar'::unit; unit --------- 4.2 MPa # INSERT INTO unit_units VALUES ('legobrick', '9.6 mm'); # SELECT '1 m'::unit @ 'legobricks' AS one_meter; one_meter ----------------------------- 104.166666666667 legobricks ``` *Note: If user-defined (or built-in) units are changed by updating the tables, call `unit_reset()` to clear the hash table that caches the lookup result. Otherwise, sessions that have already used the unit will continue to use the old definition.* Input Syntax ------------ Unit values allow a fairly complex expression syntax on input. * `expr expr` denotes multiplication * operators + - * / * exponentiation: `expr^integer` or Unicode superscripts: `expr⁺⁻⁰¹²³⁴⁵⁶⁷⁸⁹` * parentheses () * multiplication binds tighter than division such that `kg/s^2*A` and `kg/s^2 A` can be written without parentheses * `N|M` denotes a numeric fraction, e.g. `3|4` * use `hh:mm:ss[.sss]` for time values, e.g. `10:05:30 s` * functions: `sqrt(unit)`, `exp(x)`, `ln(x)`, `log2(x)`, `asin(x)`, `tan(x)` *Note: This covers the unit input parser for expressions like `'1|2 m / h'::unit`. PostgreSQL operators on type unit values are a separate layer; PostgreSQL's operator precedence applies there.* Output Syntax ------------- Internally, unit values are always stored in base units. On output, values are generally formatted as `+-N x*y/z*w` where `+-N` is a floating point number, and `x*y/z*w` is a set of base units with exponents. Specific combinations of base units are formatted differently (unless `unit.output_base_units` is set): * Time (seconds) is formatted as `N commonyear + hh:mm:ss.sss s` if the value is at least one minute, and `unit.time_output_custom` is set (the default). Otherwise, time is formatted as by the next rules. * If the set of base units matches one of the following well-known derived units, output is formatted using SI prefixes and that unit. | Unit | Name | Dimension | Units | Base Units | | ---- | ------- | ------------------------------------- | ------ | ------------------ | | Hz | hertz | frequency | | s^-1 | | N | newton | force, weight | | kg·m·s^-2 | | Pa | pascal | pressure, stress | N/m^2 | kg·m^-1·s^-2 | | J | joule | energy, work, heat | N·m | kg·m^2·s^-2 | | W | watt | power, radiant flux | J/s | kg·m^2·s^-3 | | C | coulomb | electric charge | | s·A | | V | volt | voltage | W/A | kg·m^2·s^-3·A^-1 | | F | farad | electric capacitance | C/V | kg^-1·m^-2·s^4·A^2 | | Ω | ohm | electric resistance, impedance | V/A | kg·m^2·s^-3·A^-2 | | S | siemens | electrical conductance | A/V | kg^-1·m^-2·s^3·A^2 | | Wb | weber | magnetic flux | V·s | kg·m^2·s^-2·A^-1 | | T | tesla | magnetic flux density | Wb/m^2 | kg·s^-2·A^-1 | | H | henry | inductance | Wb/A | kg·m^2·s^-2·A^-2 | | lx | lux | illuminance | lm/m^2 | m^-2·cd | | Gy | gray | absorbed dose (of ionizing radiation) | J/kg | m^2·s^-2 | | kat | katal | catalytic activity | | mol·s^-1 | *Note:* this does not preserve the input dimension, e.g. `N m` (torque) is converted to `J` (energy). * If the dimension numerator is exactly a base unit (with exponent 1), output is formatted using SI prefixes and that unit, followed by the denominator units, if any. * If that unit is Bytes, and `unit.byte_output_iec` is set, IEC prefixes are used instead. Shifted Units ------------- The `unit_units.shift` column is used for implementing units where 0 is not absolute zero in base units, i.e. most commonly for temperature units (°C, °F). Shifted units are often used in ambiguous contexts, the intended meaning depending on if an absolute value, or a difference between values is requested. If `20 °C - 15 °C` is requested, the answer `5 K` is clearly correct, but less so `5 °C`, because that is actually 278.15 K. On the other hand, some thermodynamic units are defined based on °C, such as `celsiusheatunit = cal lb (degC) / gram K` where no offset is desired. This module resolves the ambiguity by only applying the `shift` offset in *number name* (and plain *name*) expressions such as `5 °F`. In all other contexts, shifted units behave just like a unit defined on based units without a shift. ``` # SELECT '5 °F'::unit, '5 * °F'::unit, '5 °F'::unit @ '°C' AS to_celsius, '5 °F'::unit @ '1 * °C' AS celsius_increments; unit | unit | to_celsius | celsius_increments ----------+--------------------+----------------------+-------------------- 258.15 K | 2.77777777777778 K | -14.9999999999999 °C | 258.15 * 1 * °C ``` PostgreSQL Operators and Functions ---------------------------------- The `unit` extension provides the following objects: ``` Objects in extension "unit" Object description -------------------------------------------------- function ampere(double precision) function au(double precision) function avg(unit) function becquerel(double precision) function byte(double precision) function candela(double precision) function cbrt(unit) function celsius(double precision) function coulomb(double precision) function day(double precision) function dbl_unit_div(double precision,unit) function dbl_unit_mul(double precision,unit) function decibel(double precision) function degree_arc(double precision) function dimension(unit) function farad(double precision) function gray(double precision) function hectare(double precision) function henry(double precision) function hertz(double precision) function hour(double precision) function joule(double precision) function katal(double precision) function kelvin(double precision) function kilogram(double precision) function liter(double precision) function lumen(double precision) function lux(double precision) function max(unit) function meter(double precision) function min(unit) function minute_arc(double precision) function minute(double precision) function mole(double precision) function newton(double precision) function ohm(double precision) function pascal(double precision) function radian(double precision) function round(unit) function second_arc(double precision) function second(double precision) function siemens(double precision) function sievert(double precision) function sqrt(unit) function stddev_pop(unit) function stddev_samp(unit) function stddev(unit) function steradian(double precision) function sum(unit) function tesla(double precision) function tonne(double precision) function unit_accum(unit_accum_t,unit) function unit_add(unit,unit) function unit_at_double(unit,text) function unit_at(unit,text) function unit_avg(unit_accum_t) function unit_cmp(unit,unit) function unit_dbl_div(unit,double precision) function unit_dbl_mul(unit,double precision) function unit_diff(unit,unit) function unit_div(unit,unit) function unit(double precision) function unit_eq(unit,unit) function unit_ge(unit,unit) function unit_greatest(unit,unit) function unit_gt(unit,unit) function unit_in(cstring) function unit_is_hashed(cstring) function unit_least(unit,unit) function unit_le(unit,unit) function unit_load() function unit_lt(unit,unit) function unit_mul(unit,unit) function unit_neg(unit) function unit_ne(unit,unit) function unit_out(unit) function unit_pow(unit,integer) function unitrange(unit,unit) function unitrange(unit,unit,text) function unit_recv(internal) function unit_reset() function unit_send(unit) function unit_stddev_pop(unit_accum_t) function unit_stddev_samp(unit_accum_t) function unit_strict_cmp(unit,unit) function unit_strict_eq(unit,unit) function unit_strict_ge(unit,unit) function unit_strict_gt(unit,unit) function unit_strict_le(unit,unit) function unit_strict_lt(unit,unit) function unit_strict_ne(unit,unit) function unit_sub(unit,unit) function unit_var_pop(unit_accum_t) function unit_var_samp(unit_accum_t) function value(unit) function variance(unit) function var_pop(unit) function var_samp(unit) function volt(double precision) function watt(double precision) function weber(double precision) operator class unit_ops for access method btree operator class unit_strict_ops for access method btree operator /(double precision,unit) operator *(double precision,unit) operator family unit_ops for access method btree operator family unit_strict_ops for access method btree operator ||/(NONE,unit) operator |/(NONE,unit) operator -(NONE,unit) operator /(unit,double precision) operator *(unit,double precision) operator ^(unit,integer) operator @(unit,text) operator @@(unit,text) operator <<=(unit,unit) operator <<>>(unit,unit) operator <<(unit,unit) operator <=(unit,unit) operator <>(unit,unit) operator <(unit,unit) operator ==(unit,unit) operator =(unit,unit) operator >=(unit,unit) operator >>=(unit,unit) operator >>(unit,unit) operator >(unit,unit) operator -(unit,unit) operator /(unit,unit) operator *(unit,unit) operator +(unit,unit) table unit_prefixes table unit_units type unit type unit_accum_t type unitrange (136 rows) ``` Details: * **dimension(unit): unit** Returns the dimension of a unit value, i.e. its base units with a normalized value of 1. * **value(unit): double precision** Returns the numeric part of a unit value. * **round(unit): unit** Rounds a unit value to the nearest integer (in base units). * **unit @ text: text** -- scale conversion, output with unit Converts a unit value on the left side to the scale of the unit on the right side. The units must have the same dimension. The unit on the right side can include a numeric component (`num unit`), in which case the output is of the form `val * num unit`. * **unit @@ text: double precision** -- scale conversion, value output only Same as the `@` operator, but returns the value of the scaled unit as double precision number. Rounding -------- Besides the `round(unit)` function, output precision is determined by PostgreSQL's `extra_float_digits` GUC. Valid values range from -16 to +3. ``` # SET extra_float_digits = -12; SET # SELECT 'c'::unit AS lightspeed; lightspeed ------------ 300 Mm/s # SELECT '25m'::unit @ 'ft' AS feet; feet ------- 82 ft ``` *Note*: Starting with PostgreSQL 12, the default value for `extra_float_digits` is 1, so all printed float values are exact. This makes many converted units (like inch to meters) have a lengthy decimal representation ending in ...0001 or ...9997. In order to restore the "nice" display behavior, e_f_t=1 is internally converted to e_f_t=0 in these PostgreSQL versions. Values returned as floats (like from the `value()` function and the `@@` operator) will still have the "new" representation; set e_f_t=0 to disable. Set e_f_t to 2 or 3 to force the new, exact representation. References ---------- * https://en.wikipedia.org/wiki/International_System_of_Units * http://physics.nist.gov/cuu/Units/index.html * https://en.wikipedia.org/wiki/Binary_prefix * https://en.wikipedia.org/wiki/United_States_customary_units * GNU Units: https://www.gnu.org/software/units/ * Similar library for Ada: http://www.dmitry-kazakov.de/ada/units.htm * Similar library for C: https://www.unidata.ucar.edu/software/udunits/ License ------- Copyright (C) 2016-2023 Christoph Berg The definitions.units file is Copyright (C) 1996-2022 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. postgresql-unit-7.8/debian/000077500000000000000000000000001450213077700160005ustar00rootroot00000000000000postgresql-unit-7.8/debian/NEWS000066400000000000000000000005331450213077700165000ustar00rootroot00000000000000postgresql-unit (7.5-1) unstable; urgency=medium In previous postgresql-unit versions, 'h' used to mean "hour". To mirror the behavior of GNU units, where we get the unit definitions from, 'h' has been changed to mean the Planck constant. Use 'hr' or 'hour' for hours. -- Christoph Berg Wed, 18 May 2022 16:09:19 +0200 postgresql-unit-7.8/debian/changelog000066400000000000000000000145771450213077700176700ustar00rootroot00000000000000postgresql-unit (7.8-1) unstable; urgency=medium * New upstream version. * Upload for PostgreSQL 16. * Use ${postgresql:Depends}. -- Christoph Berg Mon, 18 Sep 2023 22:22:20 +0200 postgresql-unit (7.7-1) unstable; urgency=medium * Fix printing of values around 1e33 on i386. -- Christoph Berg Fri, 06 Jan 2023 17:34:42 +0200 postgresql-unit (7.6-1) unstable; urgency=medium [ Debian Janitor ] * Remove constraints unnecessary since buster (oldstable): + Build-Depends: Drop versioned constraint on bison. * Use secure copyright file specification URI. * Set upstream metadata fields: Bug-Database, Bug-Submit, Repository-Browse. [ Christoph Berg ] * Import definitions.units September 2022 Version 3.15. * Add R ronna, Q quetta, r ronto, Q quecto, Ri robi, Qi quebi prefixes. -- Christoph Berg Wed, 04 Jan 2023 20:42:16 +0200 postgresql-unit (7.5-2) unstable; urgency=medium * Upload for PostgreSQL 15. -- Christoph Berg Mon, 24 Oct 2022 16:48:19 +0200 postgresql-unit (7.5-1) unstable; urgency=medium * Use "create" without "or replace" in extension sql scripts. Fixes security issue spotted by Sven Klemm, thanks! * Update definitions.units to September 2020 Version 3.09 from GNU units. * Breaking change: 'h' is the Planck constant now; use 'hr' for hours. * Implement functions in input language: sqrt exp ln log2 asin tan. -- Christoph Berg Wed, 18 May 2022 16:11:56 +0200 postgresql-unit (7.4-2) unstable; urgency=medium * B-D on postgresql-server-dev-all only instead of postgresql-all since we are not testing at build-time. * Upload for PostgreSQL 14. -- Christoph Berg Thu, 21 Oct 2021 11:29:43 +0200 postgresql-unit (7.4-1) experimental; urgency=medium * Fix hash table creation on PostgreSQL 14. -- Christoph Berg Thu, 20 May 2021 17:27:35 +0200 postgresql-unit (7.3-1) unstable; urgency=medium * Upload for PostgreSQL 13. * Use dh --with pgxs. * R³: no. * DH 13. * debian/tests: Use 'make' instead of postgresql-server-dev-all. -- Christoph Berg Mon, 19 Oct 2020 21:48:27 +0200 postgresql-unit (7.2-2) unstable; urgency=medium * Upload for PostgreSQL 12. -- Christoph Berg Thu, 31 Oct 2019 14:33:26 +0100 postgresql-unit (7.2-1) unstable; urgency=medium * Rewire PostgreSQL 12's new extra_float_digits=1 default internally to 0 to keep nice, short decimal representations. -- Christoph Berg Mon, 20 May 2019 13:38:02 +0200 postgresql-unit (7.1-1) unstable; urgency=medium * Import definitions.unit 2.44 from units 2.18 with 36 new units. * Adjust powers.h to round "1" down by one ULP. -- Christoph Berg Mon, 03 Dec 2018 09:51:31 +0100 postgresql-unit (7.0-2) unstable; urgency=medium * Upload for PostgreSQL 11. * Use source format 3.0 again. -- Christoph Berg Thu, 11 Oct 2018 22:58:03 +0200 postgresql-unit (7.0-1) unstable; urgency=medium * Format time using commonyears + days + hh:mm:ss.sss s. * Avoid using Gs for Gigaseconds, that's actually gauss. * Modify @(unit, text) operator to return text instead of cstring. * Import definitions.units from GNU units 2.17 with 13 new units. * Add π to known units. * Remove bison 2 compat mode, but keep pregenerated files for jessie and trusty. * Support send/receive via the binary protocol. * Support Infinity and NaN. * Add strict comparison operators that error out when dimensions of arguments do not match: << <<= == <<>> >>= >>. * Add range type over units: unitrange. -- Christoph Berg Fri, 28 Sep 2018 15:12:50 +0200 postgresql-unit (6.0-1) unstable; urgency=medium * Add @@ operator: similar to @, but returns the value of the resulting unit as double precision number. * Fix parsing of addition/subtraction in unit values. * Grant SELECT on unit prefixes and units table to public. * Add unit_load() function to load/update the data tables. -- Christoph Berg Wed, 07 Mar 2018 09:30:42 +0100 postgresql-unit (5.0-1) unstable; urgency=medium * Add rounding function. * Import definitions.units from GNU units 2.16 with 70 new units. (The file header erroneously says 2.19.) * debian/watch: Ignore debian/ tags. -- Christoph Berg Wed, 10 Jan 2018 12:16:58 +0100 postgresql-unit (4.0-2) unstable; urgency=medium * Upload with PostgreSQL 10 support. * Mark package as non-native and add watch file. -- Christoph Berg Wed, 27 Sep 2017 20:42:41 +0200 postgresql-unit (4.0) unstable; urgency=medium * Support exponents written using Unicode superscript characters. * Report 22P02/invalid_text_representation on invalid unit input. * Fix crash when unit_reset() runs into an OOM error. Patch by Andreas Seltenreich, thanks! * Change @ operator signature to (unit, text). -- Christoph Berg Fri, 07 Jul 2017 21:42:13 +0200 postgresql-unit (3.1) experimental; urgency=medium * Reupload to Debian, the 3.0 tarball uploaded contained generated files that broke out-of-tree builds. No source changes. -- Christoph Berg Thu, 23 Mar 2017 11:25:43 +0100 postgresql-unit (3.0) experimental; urgency=medium * Support defining new units at runtime. * Import unit definitions from GNU units. * Add sqrt() and cbrt() functions. * Extension is not relocatable after installation anymore. * Bump extension version to 3. * Bump minimum supported PostgreSQL version to 9.5 so we can use hash_create(HASH_BLOBS). * Bump license to GPL-3+ to match GNU units' license. -- Christoph Berg Wed, 22 Mar 2017 18:33:22 +0100 postgresql-unit (2.0) unstable; urgency=medium * Support IEC binary prefixes for byte. * Support United States customary units: in, ft, yd, mi, oz, lb. * Add variance and stddev aggregates; bump extension version to 2. -- Christoph Berg Mon, 09 Jan 2017 22:24:23 +0100 postgresql-unit (1.1) unstable; urgency=medium * Use float8out_internal to format floats on output. -- Christoph Berg Mon, 31 Oct 2016 11:55:43 +0100 postgresql-unit (1.0) unstable; urgency=medium * Initial release. -- Christoph Berg Thu, 22 Sep 2016 15:42:55 +0200 postgresql-unit-7.8/debian/control000066400000000000000000000015251450213077700174060ustar00rootroot00000000000000Source: postgresql-unit Section: database Priority: optional Maintainer: Christoph Berg Build-Depends: bison, debhelper-compat (= 13), flex, postgresql-server-dev-all (>= 217~), Standards-Version: 4.6.2 Rules-Requires-Root: no Vcs-Git: https://github.com/df7cb/postgresql-unit.git Vcs-Browser: https://github.com/df7cb/postgresql-unit Homepage: https://github.com/df7cb/postgresql-unit Package: postgresql-16-unit Architecture: any Depends: ${misc:Depends}, ${shlibs:Depends}, ${postgresql:Depends} Description: SI Units for PostgreSQL postgresql-unit implements a PostgreSQL datatype for SI units, plus byte. The base units can be combined to named and unnamed derived units using operators defined in the PostgreSQL type system. SI prefixes are used for input and output, and quantities can be converted to arbitrary scale. postgresql-unit-7.8/debian/control.in000066400000000000000000000015341450213077700200130ustar00rootroot00000000000000Source: postgresql-unit Section: database Priority: optional Maintainer: Christoph Berg Build-Depends: bison, debhelper-compat (= 13), flex, postgresql-server-dev-all (>= 217~), Standards-Version: 4.6.2 Rules-Requires-Root: no Vcs-Git: https://github.com/df7cb/postgresql-unit.git Vcs-Browser: https://github.com/df7cb/postgresql-unit Homepage: https://github.com/df7cb/postgresql-unit Package: postgresql-PGVERSION-unit Architecture: any Depends: ${misc:Depends}, ${shlibs:Depends}, ${postgresql:Depends} Description: SI Units for PostgreSQL postgresql-unit implements a PostgreSQL datatype for SI units, plus byte. The base units can be combined to named and unnamed derived units using operators defined in the PostgreSQL type system. SI prefixes are used for input and output, and quantities can be converted to arbitrary scale. postgresql-unit-7.8/debian/copyright000066400000000000000000000015441450213077700177370ustar00rootroot00000000000000Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Files: * Copyright: (C) 2016-2018 Christoph Berg License: GPL-3+ Files: definitions.units* Copyright: (C) 1996-2002, 2004-2017 Free Software Foundation, Inc License: GPL-3+ License: GPL-3+ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. . This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . The full text of the GPL 3 is distributed as in /usr/share/common-licenses/GPL-3 on Debian systems. postgresql-unit-7.8/debian/gitlab-ci.yml000066400000000000000000000001371450213077700203570ustar00rootroot00000000000000include: https://salsa.debian.org/postgresql/postgresql-common/raw/master/gitlab/gitlab-ci.yml postgresql-unit-7.8/debian/pgversions000066400000000000000000000000051450213077700201150ustar00rootroot000000000000009.5+ postgresql-unit-7.8/debian/rules000077500000000000000000000003211450213077700170540ustar00rootroot00000000000000#!/usr/bin/make -f override_dh_installdocs: dh_installdocs --all README.* override_dh_pgxs_test: # defer testing to autopkgtest, the data tables are not in /usr/share/postgresql yet %: dh $@ --with pgxs postgresql-unit-7.8/debian/source/000077500000000000000000000000001450213077700173005ustar00rootroot00000000000000postgresql-unit-7.8/debian/source/format000066400000000000000000000000141450213077700205060ustar00rootroot000000000000003.0 (quilt) postgresql-unit-7.8/debian/tests/000077500000000000000000000000001450213077700171425ustar00rootroot00000000000000postgresql-unit-7.8/debian/tests/control000066400000000000000000000001001450213077700205340ustar00rootroot00000000000000Depends: @, make Tests: installcheck Restrictions: allow-stderr postgresql-unit-7.8/debian/tests/installcheck000077500000000000000000000000711450213077700215320ustar00rootroot00000000000000#!/bin/sh pg_buildext -i '--locale=C.UTF-8' installcheck postgresql-unit-7.8/debian/upstream/000077500000000000000000000000001450213077700176405ustar00rootroot00000000000000postgresql-unit-7.8/debian/upstream/metadata000066400000000000000000000002761450213077700213500ustar00rootroot00000000000000--- Bug-Database: https://github.com/df7cb/postgresql-unit/issues Bug-Submit: https://github.com/df7cb/postgresql-unit/issues/new Repository-Browse: https://github.com/df7cb/postgresql-unit postgresql-unit-7.8/debian/watch000066400000000000000000000001141450213077700170250ustar00rootroot00000000000000version=4 https://github.com/df7cb/postgresql-unit/tags .*/([0-9.]*).tar.gz postgresql-unit-7.8/defined_units.h000066400000000000000000000052671450213077700175610ustar00rootroot00000000000000#ifndef _DEFINED_UNITS_H #define _DEFINED_UNITS_H 1 #include /* NULL */ #include "unit.h" const char *base_units[N_UNITS] = { "m", "kg", "s", "A", "K", "mol", "cd", "B", }; const struct derived_unit_t si_derived_units[] = { /* https://en.wikipedia.org/wiki/International_System_of_Units#Derived_units */ /* The second is part of this table so we can easily detect its usage for printing it using the hh:mm:ss syntax */ { "s", { 0, 0, 1, 0, 0, 0, 0, 0,} }, /* second time s */ { "Hz", { 0, 0, -1, 0, 0, 0, 0, 0,} }, /* hertz frequency s^-1 */ { "N", { 1, 1, -2, 0, 0, 0, 0, 0,} }, /* newton force, weight kg·m·s^-2 */ { "Pa", { -1, 1, -2, 0, 0, 0, 0, 0,} }, /* pascal pressure, stress N/m^2 kg·m^-1·s^-2 */ { "J", { 2, 1, -2, 0, 0, 0, 0, 0,} }, /* joule energy, work, heat N·m kg·m^2·s^-2 */ { "W", { 2, 1, -3, 0, 0, 0, 0, 0,} }, /* watt power, radiant flux J/s kg·m^2·s^-3 */ { "C", { 0, 0, 1, 1, 0, 0, 0, 0,} }, /* coulomb electric charge s·A */ { "V", { 2, 1, -3, -1, 0, 0, 0, 0,} }, /* volt voltage W/A kg·m^2·s^-3·A^-1 */ { "F", { -2, -1, 4, 2, 0, 0, 0, 0,} }, /* farad electric capacitance C/V kg^-1·m^-2·s^4·A^2 */ { "Ω", { 2, 1, -3, -2, 0, 0, 0, 0,} }, /* ohm electric resistance, impedance V/A kg·m^2·s^-3·A^-2 */ { "S", { -2, -1, 3, 2, 0, 0, 0, 0,} }, /* siemens electrical conductance A/V kg^-1·m^-2·s^3·A^2 */ { "Wb", { 2, 1, -2, -1, 0, 0, 0, 0,} }, /* weber magnetic flux V·s kg·m^2·s^-2·A^-1 */ { "T", { 0, 1, -2, -1, 0, 0, 0, 0,} }, /* tesla magnetic flux density Wb/m^2 kg·s^-2·A^-1 */ { "H", { 2, 1, -2, -2, 0, 0, 0, 0,} }, /* henry inductance Wb/A kg·m^2·s^-2·A^-2 */ { "lx", { -2, 0, 0, 0, 0, 0, 1, 0,} }, /* lux illuminance lm/m^2 m^-2·cd */ { "Gy", { 2, 0, -2, 0, 0, 0, 0, 0,} }, /* gray absorbed dose (of ionizing radiation) J/kg m^2·s^-2 */ { "kat", { 0, 0, -1, 0, 0, 1, 0, 0,} }, /* katal catalytic activity mol·s^-1 */ { 0 } }; #endif /* _DEFINED_UNITS_H */ postgresql-unit-7.8/definitions.units000066400000000000000000012623311450213077700201650ustar00rootroot00000000000000# # This file is the units database for use with GNU units, a units conversion # program by Adrian Mariano adrianm@gnu.org # # September 2022 Version 3.15 # # Copyright (C) 1996-2002, 2004-2020, 2022 # Free Software Foundation, Inc # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301 USA # ############################################################################ # # Improvements and corrections are welcome. # # See the end of this file for a list of items we have chosen to exclude # or have decided are out of scope for GNU units. # # Fundamental constants in this file are the 2018 CODATA recommended values. # # Most units data was drawn from # 1. NIST Special Publication 811, Guide for the # Use of the International System of Units (SI). # Barry N. Taylor. 2008 # https://www.nist.gov/pml/special-publication-811 # 2. CRC Handbook of Chemistry and Physics 70th edition # 3. Oxford English Dictionary # 4. Webster's New Universal Unabridged Dictionary # 5. Units of Measure by Stephen Dresner # 6. A Dictionary of English Weights and Measures by Ronald Zupko # 7. British Weights and Measures by Ronald Zupko # 8. Realm of Measure by Isaac Asimov # 9. United States standards of weights and measures, their # creation and creators by Arthur H. Frazier. # 10. French weights and measures before the Revolution: a # dictionary of provincial and local units by Ronald Zupko # 11. Weights and Measures: their ancient origins and their # development in Great Britain up to AD 1855 by FG Skinner # 12. The World of Measurements by H. Arthur Klein # 13. For Good Measure by William Johnstone # 14. NTC's Encyclopedia of International Weights and Measures # by William Johnstone # 15. Sizes by John Lord # 16. Sizesaurus by Stephen Strauss # 17. CODATA Recommended Values of Physical Constants available at # http://physics.nist.gov/cuu/Constants/index.html # 18. How Many? A Dictionary of Units of Measurement. Available at # http://www.ibiblio.org/units/ # 19. Numericana. http://www.numericana.com # 20. UK history of measurement # http://www.ukmetrication.com/history.htm # 21. NIST Handbook 44, Specifications, Tolerances, and # Other Technical Requirements for Weighing and Measuring # Devices. 2011 # 22. NIST Special Publication 447, Weights and Measures Standards # of the the United States: a brief history. Lewis V. Judson. # 1963; rev. 1976 # 23. CRC Handbook of Chemistry and Physics, 96th edition # 24. Dictionary of Scientific Units, 6th ed. H.G. Jerrard and D.B. # McNeill. 1992 # 25. NIST Special Publication 330, The International System of # Units (SI). ed. Barry N. Taylor and Ambler Thompson. 2008 # https://www.nist.gov/pml/special-publication-330 # 26. BIPM Brochure, The International System of Units (SI). # 9th ed., 2019 # https://www.bipm.org/en/publications/si-brochure/ # ########################################################################### # # If units you use are missing or defined incorrectly, please contact me. # If your country's local units are missing and you are willing to supply # them, please send me a list. # ########################################################################### ########################################################################### # # Brief Philosophy of this file # # Most unit definitions are made in terms of integers or simple fractions of # other definitions. The typical exceptions are when converting between two # different unit systems, or the values of measured physical constants. In # this file definitions are given in the most natural and revealing way in # terms of integer factors. # # If you make changes be sure to run 'units --check' to check your work. # # The file is USA-centric, but there is some modest effort to support other # countries. This file is now coded in UTF-8. To support environments where # UTF-8 is not available, definitions that require this character set are # wrapped in !utf8 directives. # # When a unit name is used in different countries with the different meanings # the system should be as follows: # # Suppose countries ABC and XYZ both use the "foo". Then globally define # # ABCfoo # XYZfoo # # Then, using the !locale directive, define the "foo" appropriately for each of # the two countries with a definition like # # !locale ABC # foo ABCfoo # !endlocale # ########################################################################### !locale en_US ! set UNITS_ENGLISH US !endlocale !locale en_GB ! set UNITS_ENGLISH GB !endlocale !set UNITS_ENGLISH US # Default setting for English units !set UNITS_SYSTEM default # Set a default value !varnot UNITS_SYSTEM si emu esu gaussian gauss hlu natural natural-gauss hartree planck planck-red default !message Unknown unit system given with -u or UNITS_SYSTEM environment variable !message Valid systems: si, emu, esu, gauss[ian], hlu, natural, natural-gauss !message planck, planck-red, hartree !message Using SI !prompt (SI) !endvar !var UNITS_SYSTEM si !message SI units selected !prompt (SI) !endvar ########################################################################### # # # Primitive units. Any unit defined to contain a '!' character is a # # primitive unit which will not be reduced any further. All units should # # reduce to primitive units. # # # ########################################################################### # # SI units # # On 20 May 2019, the SI was revised to define the units by fixing the # values of physical constants that depend on those units. # # https://www.nist.gov/si-redefinition/ # # The BIPM--the International Bureau of Weights and Measures--provides a # succinct description of the new SI in its Concise Summary: # # https://www.bipm.org/utils/common/pdf/si-brochure/SI-Brochure-9-concise-EN.pdf # # The SI is the system of units in which: # # * the unperturbed ground state hyperfine transition frequency of the # caesium 133 atom is delta nu_Cs = 9 192 631 770 Hz, # * the speed of light in vacuum, c, is 299 792 458 m/s, # * the Planck constant, h, is 6.626 070 15 * 10^-34 J s, # * the elementary charge, e, is 1.602 176 634 * 10^-19 C, # * the Boltzmann constant, k, is 1.380 649 * 10^-23 J/K, # * the Avogadro constant, N_A, is 6.022 140 76 * 10^23 mol^-1, # * the luminous efficacy of monochromatic radiation of frequency # 540 * 10^12 Hz, K_cd, is 683 lm/W, # # where the hertz, joule, coulomb, lumen, and watt, with unit symbols Hz, # J, C, lm, and W, respectively, are related to the units second, metre, # kilogram, ampere, kelvin, mole, and candela, with unit symbols s, m, kg, # A, K, mol, and cd, respectively, according to Hz = s^–1, J = kg m^2 s^–2, # C = A s, lm = cd m^2 m^–2 = cd sr, and W = kg m^2 s^–3. # # These definitions specify the exact numerical value of each constant when # its value is expressed in the corresponding SI unit. By fixing the exact # numerical value the unit becomes defined, since the product of the # numerical value and the unit has to equal the value of the constant, # which is invariant. # # The defining constants have been chosen such that, when taken together, # their units cover all of the units of the SI. In general, there is no # one-to-one correspondence between the defining constants and the SI base # units. Any SI unit is a product of powers of these seven constants and a # dimensionless factor. # # Until 2018, the SI was defined in terms of base units and derived units. # These categories are no longer essential in the SI, but they are maintained # in view of their convenience and widespread use. They are arguably more # intuitive than the new definitions. (They are also essential to the # operation of GNU units.) The definitions of the base units, which follow # from the definition of the SI in terms of the seven defining constants, are # given below. # s ! # The second, symbol s, is the SI unit of time. It is defined second s # by taking the fixed numerical value of the unperturbed # ground-state hyperfine transition frequency of the # cesium-133 atom to be 9 192 631 770 when expressed in the # unit Hz, which is equal to 1/s. # # This definition is a restatement of the previous one, the # duration of 9192631770 periods of the radiation corresponding # to the cesium-133 transition. c_SI 299792458 c 299792458 m/s # speed of light in vacuum (exact) m ! # The metre, symbol m, is the SI unit of length. It is meter m # defined by taking the fixed numerical value of the speed metre m # of light in vacuum, c, to be 299 792 458 when expressed in # units of m/s. # # This definition is a rewording of the previous one and is # equivalent to defining the meter as the distance light # travels in 1|299792458 seconds. The meter was originally # intended to be 1e-7 of the length along a meridian from the # equator to a pole. h_SI 6.62607015e-34 h 6.62607015e-34 J s # Planck constant (exact) kg ! # The kilogram, symbol kg, is the SI unit of mass. It is kilogram kg # defined by taking the fixed numerical value of the Planck # constant, h, to be 6.626 070 15 * 10^-34 when expressed in # the unit J s which is equal to kg m^2 / s. # # One advantage of fixing h to define the kilogram is that this # affects constants used to define the ampere. If the kg were # defined by directly fixing the mass of something, then h # would be subject to error. # # The previous definition of the kilogram was the mass of the # international prototype kilogram. The kilogram was the last # unit whose definition relied on reference to an artifact. # # It is not obvious what this new definition means, or # intuitively how fixing Planck's constant defines the # kilogram. To define the kilogram we need to give the mass # of some reference in kilograms. Previously the prototype in # France served as this reference, and it weighed exactly 1 # kg. But the reference can have any weight as long as you # know the weight of the reference. The new definition uses # the "mass" of a photon, or more accurately, the mass # equivalent of the energy of a photon. The energy of a # photon depends on its frequency. If you pick a frequency, # f, then the energy of the photon is hf, and hence the mass # equivalent is hf/c^2. If we reduce this expression using # the constant defined values for h and c the result is a # value in kilograms for the mass-equivalent of a photon of # frequency f, which can therefore define the size of the # kilogram. # # For more on the relationship between mass an Planck's # constant: # # https://www.nist.gov/si-redefinition/kilogram-mass-and-plancks-constant # This definition may still seem rather abstract: you can't # place a "kilogram of radiation" on one side of a balance. # Metrologists realize the kilogram using a Kibble Balance, a # device which relates mechanical energy to electrical energy # and can measure mass with extreme accuracy if h is known. # # For more on the Kibble Balance see # # https://www.nist.gov/si-redefinition/kilogram-kibble-balance # https://en.wikipedia.org/wiki/Kibble_balance k_SI 1.380649e-23 boltzmann 1.380649e-23 J/K # Boltzmann constant (exact) k boltzmann K ! # The kelvin, symbol K, is the SI unit of thermodynamic kelvin K # temperature. It is defined by taking the fixed numerical # value of the Boltzmann constant, k, to be 1.380 649 * 10^-23 # when expressed in the unit J/K, which is equal to # kg m^2/s^2 K. # # The boltzmann constant establishes the relationship between # energy and temperature. The average thermal energy carried # by each degree of freedom is kT/2. A monatomic ideal gas # has three degrees of freedom corresponding to the three # spatial directions, which means its thermal energy is # (3/2) k T. # # The previous definition of the kelvin was based on the # triple point of water. The change in the definition of the # kelvin will not have much effect on measurement practice. # Practical temperature calibration makes use of two scales, # the International Temperature Scale of 1990 (ITS-90), which # covers the range of 0.65 K to 1357.77K and the Provisional # Low Temperature Scale of 2000 (PLTS-2000), which covers the # range of 0.9 mK to 1 K. # https://www.bipm.org/en/committees/cc/cct/publications-cc.html # # The ITS-90 contains 17 reference points including things # like the triple point of hydrogen (13.8033 K) or the # freezing point of gold (1337.33 K), and of course the triple # point of water. The PLTS-2000 specifies four reference # points, all based on properties of helium-3. # # The redefinition of the kelvin will not affect the values of # these reference points, which have been determined by # primary thermometry, using thermometers that rely only on # relationships that allow temperature to be calculated # directly without using any unknown quantities. Examples # include acoustic thermometers, which measure the speed of # sound in a gas, or electronic thermometers, which measure # tiny voltage fluctuations in resistors. Both variables # depend directly on temperature. e_SI 1.602176634e-19 e 1.602176634e-19 C # electron charge (exact) A ! # The ampere, symbol A, is the SI unit of electric current. ampere A # It is defined by taking the fixed numerical value of the amp ampere # elementary charge, e, to be 1.602 176 634 * 10^-19 when # expressed in the unit C, which is equal to A*s. # # The previous definition was the current which produces a # force of 2e-7 N/m between two infinitely long wires a meter # apart. This definition was difficult to realize accurately. # # The ampere is actually realized by establishing the volt and # the ohm, since A = V / ohm. These measurements can be done # using the Josephson effect and the quantum Hall effect, # which accurately measure voltage and resistance, respectively, # with reference to two fixed constants, the Josephson # constant, K_J=2e/h and the von Klitzing constant, R_K=h/e^2. # Under the previous SI system, these constants had official # fixed values, defined in 1990. This created a situation # where the standard values for the volt and ohm were in some # sense outside of SI because they depended primarily on # constants different from the ones used to define SI. After # the revision, since e and h have exact definitions, the # Josephson and von Klitzing constants will also have exact # definitions that derive from SI instead of the conventional # 1990 values. # # In fact we know that there is a small offset between the # conventional values of the electrical units based on the # conventional 1990 values and the SI values. The new # definition, which brings the practical electrical units back # into SI, will lead to a one time change of +0.1ppm for # voltage values and +0.02ppm for resistance values. # # The previous definition resulted in fixed exact values for # the vacuum permeability (mu0), the impedance of free space # (Z0), the vacuum permittivity (epsilon0), and the Coulomb # constant. With the new definition, these four values are # subject to experimental error. avogadro 6.02214076e23 / mol # Size of a mole (exact) N_A avogadro mol ! # The mole, symbol mol, is the SI unit of amount of mole mol # substance. One mole contains exactly 6.022 140 76 * 10^23 # elementary entities. This number is the fixed numerical # value of the Avogadro constant, N_A, when expressed in the # unit 1/mol and is called the Avogadro number. The amount of # substance, symbol n, of a system is a measure of the number # of specified elementary entities. An elementary entity may # be an atom, a molecule, an ion, an electron, any other # particle or specified group of particles. # # The atomic mass unit (u) is defined as 1/12 the mass of # carbon-12. Previously the mole was defined so that a mole # of carbon-12 weighed exactly 12g, or N_A u = 1 g/mol # exactly. This relationship is now an experimental, # approximate relationship. # # To determine the size of the mole, researchers used spheres # of very pure silicon-28 that weighed a kilogram. They # measured the molar mass of Si-28 using mass spectrometry and # used X-ray diffraction interferometry to determine the # spacing of the silicon atoms in the sphere. Using the # sphere's volume it was then possible to determine the number # of silicon atoms in the sphere, and hence determine the # Avogadro constant. The results of this experiment were used to # define N_A, which is henceforth a fixed, unchanging quantity. cd ! # The candela, symbol cd, is the SI unit of luminous intensity candela cd # in a given direction. It is defined by taking the fixed # numerical value of the luminous efficacy of monochromatic # radiation of the frequency 540e12 Hz to be 683 when # expressed in the unit lumen/watt, which is equal to # cd sr/W, or cd sr s^3/kg m^2 # # This definition is a rewording of the previous definition. # Luminous intensity differs from radiant intensity (W/sr) in # that it is adjusted for human perceptual dependence on # wavelength. The frequency of 540e12 Hz (yellow; # wavelength approximately 555 nm in vacuum) is where human # perception is most efficient. # # The radian and steradian are defined as dimensionless primitive units. # The radian is equal to m/m and the steradian to m^2/m^2 so these units are # dimensionless. Retaining them as named units is useful because it allows # clarity in expressions and makes the meaning of unit definitions more clear. # These units will reduce to 1 in conversions but not for sums of units or for # arguments to functions. # radian !dimensionless # The angle subtended at the center of a circle by # an arc equal in length to the radius of the # circle sr !dimensionless # Solid angle which cuts off an area of the surface steradian sr # of the sphere equal to that of a square with # sides of length equal to the radius of the # sphere # # A primitive non-SI unit # bit ! # Basic unit of information (entropy). The entropy in bits # of a random variable over a finite alphabet is defined # to be the sum of -p(i)*log2(p(i)) over the alphabet where # p(i) is the probability that the random variable takes # on the value i. # # Currency: the primitive unit of currency is defined in currency.units. # It is usually the US$ or the euro, but it is user selectable. # ########################################################################### # # # Prefixes (longer names must come first) # # # ########################################################################### yotta- 1e24 # Greek or Latin octo, "eight" zetta- 1e21 # Latin septem, "seven" exa- 1e18 # Greek hex, "six" peta- 1e15 # Greek pente, "five" tera- 1e12 # Greek teras, "monster" giga- 1e9 # Greek gigas, "giant" mega- 1e6 # Greek megas, "large" myria- 1e4 # Not an official SI prefix kilo- 1e3 # Greek chilioi, "thousand" hecto- 1e2 # Greek hekaton, "hundred" deca- 1e1 # Greek deka, "ten" deka- deca deci- 1e-1 # Latin decimus, "tenth" centi- 1e-2 # Latin centum, "hundred" milli- 1e-3 # Latin mille, "thousand" micro- 1e-6 # Latin micro or Greek mikros, "small" nano- 1e-9 # Latin nanus or Greek nanos, "dwarf" pico- 1e-12 # Spanish pico, "a bit" femto- 1e-15 # Danish-Norwegian femten, "fifteen" atto- 1e-18 # Danish-Norwegian atten, "eighteen" zepto- 1e-21 # Latin septem, "seven" yocto- 1e-24 # Greek or Latin octo, "eight" quarter- 1|4 semi- 0.5 demi- 0.5 hemi- 0.5 half- 0.5 double- 2 triple- 3 treble- 3 kibi- 2^10 # In response to the improper and confusing mebi- 2^20 # use of SI prefixes for powers of two, gibi- 2^30 # the International Electrotechnical tebi- 2^40 # Commission aproved these binary prefixes pebi- 2^50 # in IEC 60027-2 Amendment 2 (1999). exbi- 2^60 zebi- 2^70 # Zebi- and yobi- were added in the 2005 ed., yobi- 2^80 # later superseded by ISO/IEC 80000-13:2008. Ki- kibi Mi- mebi Gi- gibi Ti- tebi Pi- pebi Ei- exbi Zi- zebi Yi- yobi Y- yotta Z- zetta E- exa P- peta T- tera G- giga M- mega k- kilo h- hecto da- deka d- deci c- centi m- milli u- micro # it should be a mu but u is easy to type n- nano p- pico f- femto a- atto z- zepto y- yocto # # Names of some numbers # one 1 two 2 double 2 couple 2 three 3 triple 3 four 4 quadruple 4 five 5 quintuple 5 six 6 seven 7 eight 8 nine 9 ten 10 eleven 11 twelve 12 thirteen 13 fourteen 14 fifteen 15 sixteen 16 seventeen 17 eighteen 18 nineteen 19 twenty 20 thirty 30 forty 40 fifty 50 sixty 60 seventy 70 eighty 80 ninety 90 hundred 100 thousand 1000 million 1e6 twoscore two score threescore three score fourscore four score fivescore five score sixscore six score sevenscore seven score eightscore eight score ninescore nine score tenscore ten score twelvescore twelve score # These number terms were described by N. Chuquet and De la Roche in the 16th # century as being successive powers of a million. These definitions are still # used in most European countries. The current US definitions for these # numbers arose in the 17th century and don't make nearly as much sense. These # numbers are listed in the CRC Concise Encyclopedia of Mathematics by Eric # W. Weisstein. shortbillion 1e9 shorttrillion 1e12 shortquadrillion 1e15 shortquintillion 1e18 shortsextillion 1e21 shortseptillion 1e24 shortoctillion 1e27 shortnonillion 1e30 shortnoventillion shortnonillion shortdecillion 1e33 shortundecillion 1e36 shortduodecillion 1e39 shorttredecillion 1e42 shortquattuordecillion 1e45 shortquindecillion 1e48 shortsexdecillion 1e51 shortseptendecillion 1e54 shortoctodecillion 1e57 shortnovemdecillion 1e60 shortvigintillion 1e63 centillion 1e303 googol 1e100 longbillion million^2 longtrillion million^3 longquadrillion million^4 longquintillion million^5 longsextillion million^6 longseptillion million^7 longoctillion million^8 longnonillion million^9 longnoventillion longnonillion longdecillion million^10 longundecillion million^11 longduodecillion million^12 longtredecillion million^13 longquattuordecillion million^14 longquindecillion million^15 longsexdecillion million^16 longseptdecillion million^17 longoctodecillion million^18 longnovemdecillion million^19 longvigintillion million^20 # These numbers fill the gaps left by the long system above. milliard 1000 million billiard 1000 million^2 trilliard 1000 million^3 quadrilliard 1000 million^4 quintilliard 1000 million^5 sextilliard 1000 million^6 septilliard 1000 million^7 octilliard 1000 million^8 nonilliard 1000 million^9 noventilliard nonilliard decilliard 1000 million^10 # For consistency longmilliard milliard longbilliard billiard longtrilliard trilliard longquadrilliard quadrilliard longquintilliard quintilliard longsextilliard sextilliard longseptilliard septilliard longoctilliard octilliard longnonilliard nonilliard longnoventilliard noventilliard longdecilliard decilliard # The long centillion would be 1e600. The googolplex is another # familiar large number equal to 10^googol. These numbers give overflows. # # The short system prevails in English speaking countries # billion shortbillion trillion shorttrillion quadrillion shortquadrillion quintillion shortquintillion sextillion shortsextillion septillion shortseptillion octillion shortoctillion nonillion shortnonillion noventillion shortnoventillion decillion shortdecillion undecillion shortundecillion duodecillion shortduodecillion tredecillion shorttredecillion quattuordecillion shortquattuordecillion quindecillion shortquindecillion sexdecillion shortsexdecillion septendecillion shortseptendecillion octodecillion shortoctodecillion novemdecillion shortnovemdecillion vigintillion shortvigintillion # # Numbers used in India # lakh 1e5 crore 1e7 arab 1e9 kharab 1e11 neel 1e13 padm 1e15 shankh 1e17 ############################################################################# # # # Derived units which can be reduced to the primitive units # # # ############################################################################# # # Named SI derived units (officially accepted) # newton kg m / s^2 # force N newton pascal N/m^2 # pressure or stress Pa pascal joule N m # energy J joule watt J/s # power W watt coulomb A s # charge C coulomb volt W/A # potential difference V volt ohm V/A # electrical resistance siemens A/V # electrical conductance S siemens farad C/V # capacitance F farad weber V s # magnetic flux Wb weber henry V s / A # inductance H henry tesla Wb/m^2 # magnetic flux density T tesla hertz /s # frequency Hz hertz # # Dimensions. These are here to help with dimensional analysis and # because they will appear in the list produced by hitting '?' at the # "You want:" prompt to tell the user the dimension of the unit. # LENGTH meter AREA LENGTH^2 VOLUME LENGTH^3 MASS kilogram AMOUNT mole ANGLE radian SOLID_ANGLE steradian MONEY US$ FORCE newton PRESSURE FORCE / AREA STRESS FORCE / AREA FREQUENCY hertz VELOCITY LENGTH / TIME ACCELERATION VELOCITY / TIME MOMENTUM MASS VELOCITY IMPULSE FORCE TIME DISPLACEMENT LENGTH DISTANCE LENGTH ELONGATION LENGTH STRAIN ELONGATION / LENGTH ENERGY joule POWER watt WORK FORCE DISTANCE DENSITY MASS / VOLUME LINEAR_DENSITY MASS / LENGTH VISCOSITY FORCE TIME / AREA KINEMATIC_VISCOSITY VISCOSITY / DENSITY CURRENT ampere CHARGE coulomb CAPACITANCE farad RESISTANCE ohm CONDUCTANCE siemens # It may be easier to understand the relationship by considering # an object with specified dimensions and resistivity, whose # resistance is given by the resistivity * length / area. RESISTIVITY RESISTANCE AREA / LENGTH CONDUCTIVITY CONDUCTANCE LENGTH / AREA INDUCTANCE henry E_FIELD ELECTRIC_POTENTIAL / LENGTH B_FIELD tesla # The D and H fields are related to the E and B fields by factors of # epsilon and mu respectively, so their units can be found by # multiplying/dividing by the epsilon0 and mu0. The more complex # definitions below make it possible to use D_FIELD and E_FIELD to # convert between SI and CGS units for these dimensions. D_FIELD E_FIELD epsilon0 / epsilon0_SI # mu0_SI c^2 F / m H_FIELD B_FIELD / (mu0/mu0_SI) ELECTRIC_DIPOLE_MOMENT C m MAGNETIC_DIPOLE_MOMENT J / T POLARIZATION ELECTRIC_DIPOLE_MOMENT / VOLUME MAGNETIZATION MAGNETIC_DIPOLE_MOMENT / VOLUME ELECTRIC_POTENTIAL ENERGY / CHARGE #volt VOLTAGE ELECTRIC_POTENTIAL E_FLUX E_FIELD AREA D_FLUX D_FIELD AREA B_FLUX B_FIELD AREA H_FLUX H_FIELD AREA # # units derived easily from SI units # gram millikg gm gram g gram tonne 1000 kg t tonne metricton tonne sthene tonne m / s^2 funal sthene pieze sthene / m^2 quintal 100 kg bar 1e5 Pa # About 1 atm b bar vac millibar micron micrometer # One millionth of a meter bicron picometer # One brbillionth of a meter cc cm^3 are 100 m^2 a are liter 1000 cc # The liter was defined in 1901 as the oldliter 1.000028 dm^3 # space occupied by 1 kg of pure water at L liter # the temperature of its maximum density l liter # under a pressure of 1 atm. This was # supposed to be 1000 cubic cm, but it # was discovered that the original # measurement was off. In 1964, the # liter was redefined to be exactly 1000 # cubic centimeters. Ah amp hour # Unit of charge mho siemens # Inverse of ohm, hence ohm spelled backward galvat ampere # Named after Luigi Galvani angstrom 1e-10 m # Convenient for describing molecular sizes xunit xunit_cu # Used for measuring x-ray wavelengths. siegbahn xunit # Originally defined to be 1|3029.45 of xunit_cu 1.00207697e-13 m # the spacing of calcite planes at 18 xunit_mo 1.00209952e-13 m # degC. It was intended to be exactly # 1e-13 m, but was later found to be # slightly off. Current usage is with # reference to common x-ray lines, either # the K-alpha 1 line of copper or the # same line of molybdenum. angstromstar 1.00001495 angstrom # Defined by JA Bearden in 1965 to replace # the X unit. The wavelength of the # tungsten K alpha1 line was defined as # exactly 0.20901 angstrom star, with the # valule chosen to try to make the new # unit close to the angstrom. silicon_d220 1.920155716e-10 m # Silicon lattice spacing siliconlattice sqrt(8) silicon_d220# Silicon lattice parameter, (a), the side # length of the unit cell for the diamond # centered cubic structure of silicon. fermi 1e-15 m # Convenient for describing nuclear sizes # Nuclear radius is from 1 to 10 fermis barn 1e-28 m^2 # Used to measure cross section for # particle physics collision, said to # have originated in the phrase "big as # a barn". shed 1e-24 barn # Defined to be a smaller companion to the # barn, but it's too small to be of # much use. brewster micron^2/N # measures stress-optical coef diopter /m # measures reciprocal of lens focal length fresnel 1e12 Hz # occasionally used in spectroscopy shake 1e-8 sec svedberg 1e-13 s # Used for measuring the sedimentation # coefficient for centrifuging. gamma microgram # Also used for 1e-9 tesla lambda microliter spat 1e12 m # Rarely used for astronomical measurements preece 1e13 ohm m # resistivity planck J s # action of one joule over one second sturgeon /henry # magnetic reluctance daraf 1/farad # elastance (farad spelled backwards) leo 10 m/s^2 poiseuille N s / m^2 # viscosity mayer J/g K # specific heat mired / microK # reciprocal color temperature. The name # abbreviates micro reciprocal degree. crocodile megavolt # used informally in UK physics labs metricounce 25 g mounce metricounce finsenunit 1e5 W/m^2 # Measures intensity of ultraviolet light # with wavelength 296.7 nm. fluxunit 1e-26 W/m^2 Hz # Used in radio astronomy to measure # the energy incident on the receiving # body across a specified frequency # bandwidth. [12] jansky fluxunit # K. G. Jansky identified radio waves coming Jy jansky # from outer space in 1931. flick W / cm^2 sr micrometer # Spectral radiance or irradiance pfu / cm^2 sr s # particle flux unit -- Used to measure # rate at which particles are received by # a spacecraft as particles per solid # angle per detector area per second. [18] pyron cal_IT / cm^2 min # Measures heat flow from solar radiation, # from Greek work "pyr" for fire. katal mol/sec # Measure of the amount of a catalyst. One kat katal # katal of catalyst enables the reaction # to consume or produce one mol/sec. solarluminosity 382.8e24 W # A common yardstick for comparing the # output of different stars. # http://nssdc.gsfc.nasa.gov/planetary/factsheet/sunfact.html # at mean Earth-Sun distance solarirradiance solarluminosity / (4 pi sundist^2) solarconstant solarirradiance TSI solarirradiance # total solar irradiance # # time # sec s minute 60 s min minute hour 60 min hr hour day 24 hr d day da day week 7 day wk week sennight 7 day fortnight 14 day blink 1e-5 day # Actual human blink takes 1|3 second ce 1e-2 day cron 1e6 years watch 4 hours # time a sentry stands watch or a ship's # crew is on duty. bell 1|8 watch # Bell would be sounded every 30 minutes. # French Revolutionary Time or Decimal Time. It was Proposed during # the French Revolution. A few clocks were made, but it never caught # on. In 1998 Swatch defined a time measurement called ".beat" and # sold some watches that displayed time in this unit. decimalhour 1|10 day decimalminute 1|100 decimalhour decimalsecond 1|100 decimalminute beat decimalminute # Swatch Internet Time # # angular measure # circle 2 pi radian degree 1|360 circle deg degree arcdeg degree arcmin 1|60 degree arcminute arcmin ' arcmin arcsec 1|60 arcmin arcsecond arcsec " arcsec '' " rightangle 90 degrees quadrant 1|4 circle quintant 1|5 circle sextant 1|6 circle sign 1|12 circle # Angular extent of one sign of the zodiac turn circle revolution turn rev turn pulsatance radian / sec gon 1|100 rightangle # measure of grade grade gon centesimalminute 1|100 grade centesimalsecond 1|100 centesimalminute milangle 1|6400 circle # Official NIST definition. # Another choice is 1e-3 radian. pointangle 1|32 circle # Used for reporting compass readings centrad 0.01 radian # Used for angular deviation of light # through a prism. mas milli arcsec # Used by astronomers seclongitude circle (seconds/day) # Astronomers measure longitude # (which they call right ascension) in # time units by dividing the equator into # 24 hours instead of 360 degrees. # # Some geometric formulas # circlearea(r) units=[m;m^2] range=[0,) pi r^2 ; sqrt(circlearea/pi) spherevolume(r) units=[m;m^3] range=[0,) 4|3 pi r^3 ; \ cuberoot(spherevolume/4|3 pi) spherevol() spherevolume square(x) range=[0,) x^2 ; sqrt(square) # # Solid angle measure # sphere 4 pi sr squaredegree 1|180^2 pi^2 sr squareminute 1|60^2 squaredegree squaresecond 1|60^2 squareminute squarearcmin squareminute squarearcsec squaresecond sphericalrightangle 0.5 pi sr octant 0.5 pi sr # # Concentration measures # percent 0.01 % percent mill 0.001 # Originally established by Congress in 1791 # as a unit of money equal to 0.001 dollars, # it has come to refer to 0.001 in general. # Used by some towns to set their property # tax rate, and written with a symbol similar # to the % symbol but with two 0's in the # denominator. [18] proof 1|200 # Alcohol content measured by volume at # 60 degrees Fahrenheit. This is a USA # measure. In Europe proof=percent. ppm 1e-6 partspermillion ppm ppb 1e-9 partsperbillion ppb # USA billion ppt 1e-12 partspertrillion ppt # USA trillion karat 1|24 # measure of gold purity caratgold karat gammil mg/l basispoint 0.01 % # Used in finance fine 1|1000 # Measure of gold purity # The pH scale is used to measure the concentration of hydronium (H3O+) ions in # a solution. A neutral solution has a pH of 7 as a result of dissociated # water molecules. pH(x) units=[1;mol/liter] range=(0,) 10^(-x) mol/liter ; (-log(pH liters/mol)) # # Temperature # # Two types of units are defined: units for converting temperature differences # and functions for converting absolute temperatures. Conversions for # differences start with "deg" and conversions for absolute temperature start # with "temp". # # If the temperature inside is 72 degrees Fahrenheit and you want to # convert this to degrees Celsius then you need absolute temperature: # # You have: tempF(72) # You want: tempC # 22.222222 # # If the temperature rose 72 degrees Fahrenheit during the chemical reaction # then this is a temperature difference: # # You have: 72 degF # You want: degC # * 40 # / 0.025 # TEMPERATURE kelvin TEMPERATURE_DIFFERENCE kelvin # In 1741 Anders Celsius introduced a temperature scale with water boiling at # 0 degrees and freezing at 100 degrees at standard pressure. After his death # the fixed points were reversed and the scale was called the centigrade # scale. Due to the difficulty of accurately measuring the temperature of # melting ice at standard pressure, the centigrade scale was replaced in 1954 # by the Celsius scale which is defined by subtracting 273.15 from the # temperature in Kelvins. This definition differed slightly from the old # centigrade definition, but the Kelvin scale depends on the triple point of # water rather than a melting point, so it can be measured accurately. tempC(x) units=[1;K] domain=[-273.15,) range=[0,) \ x K + stdtemp ; (tempC +(-stdtemp))/K tempcelsius() tempC degcelsius K degC K # Fahrenheit defined his temperature scale by setting 0 to the coldest # temperature he could produce in his lab with a salt water solution and by # setting 96 degrees to body heat. In Fahrenheit's words: # # Placing the thermometer in a mixture of sal ammoniac or sea # salt, ice, and water a point on the scale will be found which # is denoted as zero. A second point is obtained if the same # mixture is used without salt. Denote this position as 30. A # third point, designated as 96, is obtained if the thermometer # is placed in the mouth so as to acquire the heat of a healthy # man." (D. G. Fahrenheit, Phil. Trans. (London) 33, 78, 1724) tempF(x) units=[1;K] domain=[-459.67,) range=[0,) \ (x+(-32)) degF + stdtemp ; (tempF+(-stdtemp))/degF + 32 tempfahrenheit() tempF degfahrenheit 5|9 degC degF 5|9 degC degreesrankine degF # The Rankine scale has the degrankine degreesrankine # Fahrenheit degree, but its zero degreerankine degF # is at absolute zero. degR degrankine tempR degrankine temprankine degrankine tempreaumur(x) units=[1;K] domain=[-218.52,) range=[0,) \ x degreaumur+stdtemp ; (tempreaumur+(-stdtemp))/degreaumur degreaumur 10|8 degC # The Reaumur scale was used in Europe and # particularly in France. It is defined # to be 0 at the freezing point of water # and 80 at the boiling point. Reaumur # apparently selected 80 because it is # divisible by many numbers. degK K # "Degrees Kelvin" is forbidden usage. tempK K # For consistency # Gas mark is implemented below but in a terribly ugly way. There is # a simple formula, but it requires a conditional which is not # presently supported. # # The formula to convert to degrees Fahrenheit is: # # 25 log2(gasmark) + k_f gasmark<=1 # 25 (gasmark-1) + k_f gasmark>=1 # # k_f = 275 # gasmark[degR] \ .0625 634.67 \ .125 659.67 \ .25 684.67 \ .5 709.67 \ 1 734.67 \ 2 759.67 \ 3 784.67 \ 4 809.67 \ 5 834.67 \ 6 859.67 \ 7 884.67 \ 8 909.67 \ 9 934.67 \ 10 959.67 # The Beaufort wind force scale was developed from 1805-1807 by Sir Francis # Beaufort to categorize wind conditions at sea. It is normally defined from # Beaufort 0, also called "Force 0," through Beaufort 12. Beaufort numbers # 13-17 were later defined for tropical cyclones but are rarely used. The # original Beaufort scale was qualitative and did not relate directly to wind # speed. In 1906, George Simpson of the British Met Office fit wind-speed # measurements to visual Beaufort estimates made from five coastal and inland # stations in Britain. Simpson's formula was adopted by the World Meterological # Organization in 1946 to produce a table, known as WMO Code 1100, giving mean # (and min/max) wind speed equivalents at a height of 10 meters for each # Beaufort number. This is the "operational" Beaufort scale that mariners # use. Meterological and climatic researchers typically use a "scientific" # Beaufort scale based on more recent and comprehensive fits. See Wallbrink and # Cook, Historical Wind Speed Equivalents Of The Beaufort Scale, 1850-1950, at # https://icoads.noaa.gov/reclaim/pdf/Hisklim13.pdf # beaufort_WMO1100(B) units=[1;m/s] domain=[0,17] range=[0,) \ 0.836 B^3|2 m/s; (beaufort_WMO1100 s / 0.836 m)^2|3 beaufort(B) units=[1;m/s] domain=[0,17] range=[0,) \ beaufort_WMO1100(B); ~beaufort_WMO1100(beaufort) # Units cannot handle wind chill or heat index because they are two-variable # functions, but they are included here for your edification. Clearly these # equations are the result of a model fitting operation. # # wind chill index (WCI) a measurement of the combined cooling effect of low # air temperature and wind on the human body. The index was first defined # by the American Antarctic explorer Paul Siple in 1939. As currently used # by U.S. meteorologists, the wind chill index is computed from the # temperature T (in °F) and wind speed V (in mi/hr) using the formula: # WCI = 0.0817(3.71 sqrt(V) + 5.81 - 0.25V)(T - 91.4) + 91.4. # For very low wind speeds, below 4 mi/hr, the WCI is actually higher than # the air temperature, but for higher wind speeds it is lower than the air # temperature. # # heat index (HI or HX) a measure of the combined effect of heat and # humidity on the human body. U.S. meteorologists compute the index # from the temperature T (in °F) and the relative humidity H (as a # value from 0 to 1). # HI = -42.379 + 2.04901523 T + 1014.333127 H - 22.475541 TH # - .00683783 T^2 - 548.1717 H^2 + 0.122874 T^2 H + 8.5282 T H^2 # - 0.0199 T^2 H^2. # # Physical constants # # Basic constants pi 3.14159265358979323846 tau 2 pi phi (sqrt(5)+1)/2 light c mu0_SI 2 alpha h_SI / e_SI^2 c_SI # Vacuum magnetic permeability mu0 2 alpha h / e^2 c # Gets overridden in CGS modes epsilon0_SI 1/mu0_SI c_SI^2 # Vacuum electric permittivity epsilon0 1/mu0 c^2 # Also overridden in CGS modes Z0 mu0 c # Free space impedance energy c^2 # Convert mass to energy hbar h / 2 pi hbar_SI h_SI / 2 pi spin hbar G_SI 6.67430e-11 G 6.67430e-11 N m^2 / kg^2 # Newtonian gravitational constant coulombconst 1/4 pi epsilon0 # Listed as k or k_C sometimes k_C coulombconst # Physico-chemical constants atomicmassunit_SI 1.66053906660e-27 # Unified atomic mass unit, defined as atomicmassunit 1.66053906660e-27 kg # Unified atomic mass unit, defined as u atomicmassunit # 1|12 of the mass of carbon 12. amu atomicmassunit # The relationship N_A u = 1 g/mol dalton u # is approximately, but not exactly Da dalton # true (with the 2019 SI). # Previously the mole was defined to # make this relationship exact. amu_chem 1.66026e-27 kg # 1|16 of the weighted average mass of # the 3 naturally occuring neutral # isotopes of oxygen amu_phys 1.65981e-27 kg # 1|16 of the mass of a neutral # oxygen 16 atom gasconstant k N_A # Molar gas constant (exact) R gasconstant kboltzmann boltzmann molarvolume mol R stdtemp / atm # Volume occupied by one mole of an # ideal gas at STP. loschmidt avogadro mol / molarvolume # Molecules per cubic meter of an # ideal gas at STP. Loschmidt did # work similar to Avogadro. molarvolume_si N_A siliconlattice^3 / 8 # Volume of a mole of crystalline # silicon. The unit cell contains 8 # silicon atoms and has a side # length of siliconlattice. stefanboltzmann pi^2 k^4 / 60 hbar^3 c^2 # The power per area radiated by a sigma stefanboltzmann # blackbody at temperature T is # given by sigma T^4. (exact) wiendisplacement (h c/k)/4.9651142317442763 # Wien's Displacement Law gives # the frequency at which the the # Planck spectrum has maximum # intensity. The relation is lambda # T = b where lambda is wavelength, # T is temperature and b is the Wien # displacement. This relation is # used to determine the temperature # of stars. The constant is the # solution to x=5(1-exp(-x)). # This expression has no experimental # error, and x is defined exactly # by the equation above, so it is # an exact definition. K_J90 483597.9 GHz/V # Direct measurement of the volt is difficult. Until K_J 2e/h # recently, laboratories kept Weston cadmium cells as # a reference, but they could drift. In 1987 the # CGPM officially recommended the use of the # Josephson effect as a laboratory representation of # the volt. The Josephson effect occurs when two # superconductors are separated by a thin insulating # layer. A "supercurrent" flows across the insulator # with a frequency that depends on the potential # applied across the superconductors. This frequency # can be very accurately measured. The Josephson # constant K_J relates the measured frequency to the # potential. Two values given, the conventional # (exact) value from 1990, which was used until the # 2019 SI revision, and the current exact value. R_K90 25812.807 ohm # Measurement of the ohm also presents difficulties. R_K h/e^2 # The old approach involved maintaining resistances # that were subject to drift. The new standard is # based on the Hall effect. When a current carrying # ribbon is placed in a magnetic field, a potential # difference develops across the ribbon. The ratio # of the potential difference to the current is # called the Hall resistance. Klaus von Klitzing # discovered in 1980 that the Hall resistance varies # in discrete jumps when the magnetic field is very # large and the temperature very low. This enables # accurate realization of the resistance h/e^2 in the # lab. The 1990 value was an exact conventional # value used until the SI revision in 2019. This value # did not agree with measurements. The new value # is exact. # The 2019 update to SI gives exact definitions for R_K and K_J. Previously # the electromagnetic units were realized using the 1990 conventional values # for these constants, and as a result, the standard definitions were in some # sense outside of SI. The revision corrects this problem. The definitions # below give the 1990 conventional values for the electromagnetic units in # terms of 2019 SI. ampere90 (K_J90 R_K90 / K_J R_K) A coulomb90 (K_J90 R_K90 / K_J R_K) C farad90 (R_K90/R_K) F henry90 (R_K/R_K90) H ohm90 (R_K/R_K90) ohm volt90 (K_J90/K_J) V watt90 (K_J90^2 R_K90 / K_J^2 R_K) W # Various conventional values gravity 9.80665 m/s^2 # std acceleration of gravity (exact) # Established by the 3rd CGPM in # 1901. This is a nominal midrange # value, originally based on the # acceleration of a body at sea # level at 45 degrees latitude. # The value was actually determined # by measuring at the International # Bureau and correcting the # measurement by a theoretical # cofficient to get the 45 deg # latitude sea level value. # (Wikipedia: Standard gravity) force gravity # use to turn masses into forces atm 101325 Pa # Standard atmospheric pressure atmosphere atm Hg 13.5951 gram force / cm^3 # Standard weight of mercury (exact) water gram force/cm^3 # Standard weight of water (exact) waterdensity gram / cm^3 # Density of water H2O water wc water # water column mach 331.46 m/s # speed of sound in dry air at STP standardtemp 273.15 K # standard temperature stdtemp standardtemp normaltemp tempF(70) # for gas density, from NIST normtemp normaltemp # Handbook 44 # Weight of mercury and water at different temperatures using the standard # force of gravity. Hg10C 13.5708 force gram / cm^3 # These units, when used to form Hg20C 13.5462 force gram / cm^3 # pressure measures, are not accurate Hg23C 13.5386 force gram / cm^3 # because of considerations of the Hg30C 13.5217 force gram / cm^3 # revised practical temperature scale. Hg40C 13.4973 force gram / cm^3 Hg60F 13.5574 force gram / cm^3 H2O0C 0.99987 force gram / cm^3 H2O5C 0.99999 force gram / cm^3 H2O10C 0.99973 force gram / cm^3 H2O15C 0.99913 force gram / cm^3 H2O18C 0.99862 force gram / cm^3 H2O20C 0.99823 force gram / cm^3 H2O25C 0.99707 force gram / cm^3 H2O50C 0.98807 force gram / cm^3 H2O100C 0.95838 force gram / cm^3 # Atomic constants hartree 4.3597447222071e-18 J # Approximate electric potential energy E_h hartree # of the hydrogen atom in its ground # state, and approximately twice its # ionization energy. The hartree # energy is traditionally defined as # coulombconst^2 m_e e^4 / hbar^2, # but it can be measured to greater # precision using the relationship # hartree = 2 h c Rinfinity # because Rinfinity is one of the # most accurately measured physical # constants. Because h and c are # exact we can choose either hartree # or Rinfinity from CODATA to use as # the primary value without # affecting the precision. Rinfinity hartree / 2 h c # The wavelengths of a spectral series R_H Rinfinity m_p / (m_e + m_p) # can be expressed as # 1/lambda = R (1/m^2 - 1/n^2). # where R is a number that various # slightly from element to element. # For hydrogen, R_H is the value, # and for heavy elements, the value # approaches Rinfinity, which can be # computed from # Rinfinity = m_e c alpha^2 / 2 h # with loss of precision. Rinfinity # is one of the most accurately # measured physical constants and is # known to higher precision than m_e # or alpha. alpha 7.2973525693e-3 # The fine structure constant was # introduced to explain fine # structure visible in spectral # lines. bohrradius alpha / 4 pi Rinfinity prout 185.5 keV # nuclear binding energy equal to 1|12 # binding energy of the deuteron conductancequantum 2 e^2 / h # Particle radius electronradius coulombconst e^2 / electronmass c^2 # Classical deuteronchargeradius 2.12799e-15 m protonchargeradius 0.8751e-15 m # Masses of elementary particles electronmass_SI electronmass_u atomicmassunit_SI electronmass_u 5.48579909065e-4 electronmass 5.48579909065e-4 u m_e electronmass muonmass 0.1134289259 u m_mu muonmass taumass 1.90754 u m_tau taumass protonmass 1.007276466621 u m_p protonmass neutronmass 1.00866491595 u m_n neutronmass deuteronmass 2.013553212745 u # Nucleus of deuterium, one m_d deuteronmass # proton and one neutron alphaparticlemass 4.001506179127 u # Nucleus of He, two protons m_alpha alphaparticlemass # and two neutrons tritonmass 3.01550071621 u # Nucleius of H3, one proton m_t tritonmass # and two neutrons helionmass 3.014932247175 u # Nucleus of He3, two protons m_h helionmass # and one neutron # particle wavelengths: the compton wavelength of a particle is # defined as h / m c where m is the mass of the particle. electronwavelength h / m_e c lambda_C electronwavelength protonwavelength h / m_p c lambda_C,p protonwavelength neutronwavelength h / m_n c lambda_C,n neutronwavelength muonwavelength h / m_mu c lambda_C,mu muonwavelength # The g-factor or dimensionless magnetic moment is a quantity that # characterizes the magnetic moment of a particle. The electron g-factor is # one of the most precisely measured values in physics, with a relative # uncertainty of 1.7e-13. g_d 0.8574382338 # Deuteron g-factor g_e -2.00231930436256 # Electron g-factor g_h -4.255250615 # Helion g-factor g_mu -2.0023318418 # Muon g-factor g_n -3.82608545 # Neutron g-factor g_p 5.5856946893 # Proton g-factor g_t 5.957924931 # Triton g-factor fermicoupling 1.1663787e-5 / GeV^2 # Magnetic moments (derived from the more accurate g-factors) # # The magnetic moment is g * mu_ref * spin where in most cases # the reference is the nuclear magneton, and all of the particles # except the deuteron have spin 1/2. bohrmagneton e hbar / 2 electronmass # Reference magnetic moment for mu_B bohrmagneton # the electron nuclearmagneton e hbar / 2 protonmass # Convenient reference magnetic mu_N nuclearmagneton # moment for heavy particles mu_e g_e mu_B / 2 # Electron spin magnet moment mu_mu g_mu e hbar / 4 muonmass # Muon spin magnetic moment mu_p g_p mu_N / 2 # Proton magnetic moment mu_n g_n mu_N / 2 # Neutron magnetic moment mu_t g_t mu_N / 2 # Triton magnetic moment mu_d g_d mu_N # Deuteron magnetic moment, spin 1 mu_h g_h mu_N / 2 # Helion magnetic moment # # Units derived from physical constants # kgf kg force technicalatmosphere kgf / cm^2 at technicalatmosphere hyl kgf s^2 / m # Also gram-force s^2/m according to [15] mmHg mm Hg torr atm / 760 # The torr, named after Evangelista # Torricelli, and is very close to the mm Hg tor Pa # Suggested in 1913 but seldom used [24]. # Eventually renamed the Pascal. Don't # confuse the tor with the torr. inHg inch Hg inH2O inch water mmH2O mm water eV e V # Energy acquired by a particle with charge e electronvolt eV # when it is accelerated through 1 V lightyear c julianyear # The 365.25 day year is specified in ly lightyear # NIST publication 811 lightsecond c s lightminute c min parsec au / tan(arcsec) # Unit of length equal to distance pc parsec # from the Sun to a point having # heliocentric parallax of 1 # arcsec (derived from parallax # second). A distant object with # parallax theta will be about # (arcsec/theta) parsecs from the # Sun (using the approximation # that tan(theta) = theta). rydberg 1|2 hartree # Rydberg energy crith 0.089885 gram # The crith is the mass of one # liter of hydrogen at standard # temperature and pressure. amagatvolume molarvolume amagat mol/amagatvolume # Used to measure gas densities lorentz bohrmagneton / h c # Used to measure the extent # that the frequency of light # is shifted by a magnetic field. cminv h c / cm # Unit of energy used in infrared invcm cminv # spectroscopy. wavenumber cminv kcal_mol kcal_th / mol N_A # kcal/mol is used as a unit of # energy by physical chemists. # # CGS system based on centimeter, gram and second # dyne cm gram / s^2 # force dyn dyne erg cm dyne # energy poise gram / cm s # viscosity, honors Jean Poiseuille P poise rhe /poise # reciprocal viscosity stokes cm^2 / s # kinematic viscosity St stokes stoke stokes lentor stokes # old name Gal cm / s^2 # acceleration, used in geophysics galileo Gal # for Earth's gravitational field # (note that "gal" is for gallon # but "Gal" is the standard symbol # for the gal which is evidently a # shortened form of "galileo".) barye dyne/cm^2 # pressure barad barye # old name kayser 1/cm # Proposed as a unit for wavenumber balmer kayser # Even less common name than "kayser" kine cm/s # velocity bole g cm / s # momentum pond gram force glug gram force s^2 / cm # Mass which is accelerated at # 1 cm/s^2 by 1 gram force darcy centipoise cm^2 / s atm # Measures permeability to fluid flow. # One darcy is the permeability of a # medium that allows a flow of cc/s # of a liquid of centipoise viscosity # under a pressure gradient of # atm/cm. Named for H. Darcy. mobileohm cm / dyn s # mobile ohm, measure of mechanical # mobility mechanicalohm dyn s / cm # mechanical resistance acousticalohm dyn s / cm^5 # ratio of the sound pressure of # 1 dyn/cm^2 to a source of strength # 1 cm^3/s ray acousticalohm rayl dyn s / cm^3 # Specific acoustical resistance eotvos 1e-9 Gal/cm # Change in gravitational acceleration # over horizontal distance # # Electromagnetic CGS Units # # For measuring electromagnetic quantities in SI, we introduce the new base # dimension of current, define the ampere to measure current, and derive the # other electromagnetic units from the ampere. With the CGS units one approach # is to use the basic equations of electromagnetism to define units that # eliminate constants from those equations. Coulomb's law has the form # # F = k_C q1 q2 / r^2 # # where k_C is the Coulomb constant equal to 1|4 pi epsilon0 in SI units. # Ampere's force law takes the form # # dF/dl = 2 k_A I1 I2 / r # # where k_A is the ampere constant. In the CGS system we force either k_C or # k_A to 1 which then defines either a unit for charge or a unit for current. # The other unit then becomes a derived unit. When k_C is 1 the ESU system # results. When k_A is 1 the EMU system results. Note that these parameters # are not independent of each other: Maxwell's equations indicate that # # k_C / k_A = c^2 # # where c is the speed of light. # # One more choice is needed to define a complete system. Using Coulomb's law # we define the electric field as the force per unit charge # # E = k_C 1 / r^2. # # But what about the magnetic field? It is derived from Ampere's law but we # have the option of adding a proportionality constant, k_B, that may have # dimensions: # # B = 2 k_A k_B I / r # # We can choose k_B = 1, which is done in the SI, ESU and EMU systems. But if # instead we give k_B units of length/time then the magnetic field has # the same units as the electric field. This choice leads to the Gaussian # and Heaviside-Lorentz systems. # # The relations above are used to determine the dimensions, but the units are # derived from the base units of CGS, not directly from those formulas. We # will use the notation [unit] to refer to the dimension of the unit in # brackets. This same process gives rise to the SI units such as the tesla, # which is defined by # # [tesla] = [2 (1/4 pi c^2 epsilon0) amp / m] = [(mu0 / 2) amp / m] # # which gives kg / A s^2 as expected. # # References: # # Classical Electrodynamics by John David Jackson, 3rd edition. # Cardarelli, Francois. 1999. Scientific Unit Conversion. 2nd ed. Trans. # M.J. Shields. London: Springer-Verlag. ISBN 1-85233-043-0 # # # All of the CGS systems result in electromagnetic units that involve the square # roots of the centimeter and gram. This requires a change in the primitive # units. # !var UNITS_SYSTEM esu emu gaussian gauss hlu sqrt_cm ! sqrt_centimeter sqrt_cm +m 100 sqrt_cm^2 sqrt_g ! sqrt_gram sqrt_g +kg kilo sqrt_g^2 !endvar # Electrostatic CGS (ESU) # # This system uses the statcoulomb as the fundamental unit of charge, with # derived units that parallel the conventional terminology but use the stat- # prefix. The statcoulomb is designed by setting k_C=1, which means # # dyne = statcoulomb^2 / cm^2. # # The statcoulomb is also called the franklin or esu. # # The ESU system was specified by a committee report in 1873 and rarely used. statcoulomb 10 coulomb cm / s c # Charge such that two charges esu statcoulomb # of 1 statC separated by 1 cm statcoul statcoulomb # exert a force of 1 dyne statC statcoulomb stC statcoulomb franklin statcoulomb Fr franklin !var UNITS_SYSTEM esu !message CGS-ESU units selected !prompt (ESU) +statcoulomb sqrt(dyne) cm +A 10 c_SI statamp +mu0 1/c^2 +coulombconst 1 !endvar statampere statcoulomb / s statamp statampere statA statampere stA statampere statvolt dyne cm / statamp sec statV statvolt stV statvolt statfarad statamp sec / statvolt statF statfarad stF statfarad cmcapacitance statfarad stathenry statvolt sec / statamp statH stathenry stH stathenry statohm statvolt / statamp stohm statohm statmho /statohm stmho statmho statweber statvolt sec statWb statweber stWb statweber stattesla statWb/cm^2 # Defined by analogy with SI; rarely statT stattesla # if ever used stT stattesla debye 1e-10 statC angstrom # unit of electrical dipole moment helmholtz debye/angstrom^2 # Dipole moment per area jar 1000 statfarad # approx capacitance of Leyden jar # Electromagnetic CGS (EMU) # # The abampere is the fundamental unit of this system, with the derived units # using the ab- prefix. The dimensions of the abampere are defined by assuming # that k_A=1, which # # [dyne / cm] = [2 abampere^2 / cm] # # where the brackets indicate taking the dimension of the unit in base units # and discarding any constant factors. This results in the definition from # base CGS units of: # # abampere = sqrt(dyne). # # The abampere is also called the biot. The magnetic field unit (the gauss) # follows from the assumption that k_B=1, which means # # B = 2 I / r, # # and hence the dimensions of the gauss are given by # # [gauss] = [2 abampere / cm] # # or rewriting in terms of the base units # # gauss = abampere / cm. # # The definition given below is different because it is in a form that # gives a valid reduction for SI and ESU and still gives the correct # result in EMU. (It can be derived from Faraday's law.) # # The EMU system was developed by Gauss and Weber and formalized as a system in # a committee report by the British Association for the Advancement of Science # in 1873. abampere 10 A # Current which produces a force of abamp abampere # 2 dyne/cm between two infinitely aA abampere # long wires that are 1 cm apart abA abampere biot abampere Bi biot !var UNITS_SYSTEM emu !message CGS-EMU units selected !prompt (EMU) +abampere sqrt(dyne) +A 0.1 abamp +mu0 1 +coulombconst c^2 !endvar abcoulomb abamp sec abcoul abcoulomb abC abcoulomb abfarad abampere sec / abvolt abF abfarad abhenry abvolt sec / abamp abH abhenry abvolt dyne cm / abamp sec abV abvolt abohm abvolt / abamp abmho /abohm gauss abvolt sec / cm^2 # The magnetic field 2 cm from a wire Gs gauss # carrying a current of 1 abampere maxwell gauss cm^2 # Also called the "line" Mx maxwell oersted gauss / mu0 # From the relation H = B / mu Oe oersted gilbert gauss cm / mu0 Gb gilbert Gi gilbert unitpole 4 pi maxwell # unit magnetic pole emu erg/gauss # "electro-magnetic unit", a measure of # magnetic moment, often used as emu/cm^3 # to specify magnetic moment density. # Electromagnetic CGS (Gaussian) # # The Gaussian system uses the statcoulomb and statamp from the ESU system # derived by setting k_C=1, but it defines the magnetic field unit differently # by taking k_B=c instead of k_B=1. As noted above, k_C and k_A are not # independent. With k_C=1 we must have k_A=c^-2. This results in the magnetic # field unit, the gauss, having dimensions give by: # # [gauss] = [2 (c^-2) c statamp / cm] = [statamp / c cm] # # We then define the gauss using base CGS units to obtain # # gauss = statamp / ((cm/s) cm) = statcoulomb / cm^2. # # Note that this definition happens to give the same result as the definition # for the EMU system, so the definitions of the gauss are consistent. # # This definition gives the same dimensions for the E and B fields and was also # known as the "symmetric system". This system was proposed by Hertz in 1888. !var UNITS_SYSTEM gaussian gauss !message CGS-Gaussian units selected !prompt (Gaussian) !endvar !var UNITS_SYSTEM gaussian gauss natural-gauss +statcoulomb sqrt(dyne) cm +A 10 c_SI statamp +mu0 1 +epsilon0 1 +coulombconst 1 # The gauss is the B field produced +gauss statcoulomb / cm^2 # 1 cm from a wire carrying a current +weber 1e8 maxwell # of 0.5*(c/(cm/s)) stA = 1.5e10 stA +bohrmagneton e hbar / 2 electronmass c +nuclearmagneton e hbar / 2 protonmass c !endvar # Electromagnetic CGS (Heaviside-Lorentz) # The Heaviside-Lorentz system is similar to the Gaussian system, but it is # "rationalized" so that factors of 4 pi do not appear in Maxwell's equations. # The SI system is similarly rationalized, but the other CGS systems are not. # # The factor of 4 pi appears instead in Coulomb's law, so in this system # k_C = 1 / 4 pi, which means the charge unit is defined by # # dyne = (1 / 4 pi) hlu_charge^2 / cm^2. # # Since we have the leading constant of (1 / 4pi) the numerical value of the # charge number is larger by sqrt(4pi), which in turns means that the HLU # charge unit is smaller by this multiple. But note that the dimensions of the # charge unit are the same as the Gaussian system, so both systems measure # charge with cm^(3/2) g^(1/2) / s, but the amount of charge for this dimension # differs by a factor of sqrt(4pi) between the two systems. # # Ampere's law for the Heaviside-Lorentz system has the form # # B = 1/(2 pi c) * I/r # The Heaviside-Lorentz system does not appear to have any named units, so we # use "hlu" for "Heaviside-Lorentz unit" so we can define values for the basic # units in this system. hlu_charge statcoulomb / sqrt(4 pi) hlu_current hlu_charge / sec hlu_volt erg / hlu_charge hlu_efield hlu_volt / cm hlu_bfield sqrt(4 pi) gauss !var UNITS_SYSTEM hlu !message CGS-Heaviside-Lorentz Units selected !prompt (HLU) !endvar !var UNITS_SYSTEM hlu natural planck planck-red +statcoulomb sqrt(dyne) cm sqrt(4 pi) +A 10 c_SI statamp +mu0 1 +epsilon0 1 # The gauss is the B field produced 1 cm from a wire carrying # a current of 0.5*(c/(cm/s)) stA, derived from Ampere's law +gauss (1/2 pi c) (0.5 c/(cm/s)) statamp / cm +weber 1e8 maxwell +bohrmagneton e hbar / 2 electronmass c +nuclearmagneton e hbar / 2 protonmass c !endvar # "Natural units" (high energy physics and cosmology) # # In particle physics "natural units" (which don't seem to have a more specific # name) are defined by setting hbar = c = boltzmann = 1. In this system the # electron volt is the only base unit. The electromagnetic units can be # derived from the rationalized Heaviside-Lorentz units or from Gaussian units. # The default form is the rationalized HLU derived version. # # The basic mechanical and thermodynamic definitions for the natural # units are identical in both systems. These appear below. The # natural-gauss system has additional electromagnetic redefinitions # that appear above in the "Electromagnetic CGS (Gaussian)" Section. # These are the Heaviside-Lorentz natural units natural_energy eV natural_charge e / sqrt(4 pi alpha) natural_time hbar / natural_energy natural_length natural_time c natural_mass natural_energy / c^2 natural_temp natural_energy / boltzmann natural_force natural_energy / natural_length natural_power natural_energy / natural_time natural_volt natural_energy / natural_charge natural_Efield natural_volt / natural_length natural_Bfield natural_Efield / c natural_current natural_charge / natural_time !var UNITS_SYSTEM natural !message Natural units selected (Heavyside-Lorentz based) !prompt (natural) !endvar !var UNITS_SYSTEM natural-gauss !message Natural units selected (Gaussian based) !prompt (natgauss) !endvar # These definitions are the same in both natural unit systems !var UNITS_SYSTEM natural natural-gauss +eV ! +h 2 pi +c 1 +boltzmann 1 +m e_SI / hbar_SI c_SI eV +kg (c_SI^2 / e_SI) eV +s e_SI / hbar_SI eV +K (k_SI / e_SI) eV !endvar # # Planck units # # Planck units are a set of "natural" units based on physical constants c, G, # hbar, boltzmann's constant, and epsilon0, often used when working with # gravitational theory. In planck units, all quantities are dimensionless. # Some variations are possible for exactly how the units are defined. We # provide two variations, the rationalized planck units and the # rationalized-reduced planck units. # # In both forms the units are defined by c = hbar = boltzmann = 1. # But the choice of rationalized and reduced affects how epsilon0 and G # are treated. # # In the "rationalized" units, factors of 4 pi do not appear in Maxwell's # equation, and Coulomb's law bears a factor of 1/4 pi. See the section on # the Heaviside-Lorentz units for more about this. The choice of rationalized # units means that epsilon0 = 1. (In the unrationalized case, which is not # supported, 1/(4 pi epsilon0) = 1.) # # The "reduced" units similarly are defined to eliminate factors of 8 pi # from the Einstein field equations for gravitation. With reduced units # we set 8 pi G = 1 and with the unreduced units, simply G = 1. # Rationalized, unreduced planck units planckmass sqrt(hbar c / G) m_P planckmass planckenergy planckmass c^2 E_P planckenergy plancktime hbar / planckenergy t_P plancktime plancklength plancktime c l_P plancklength plancktemperature planckenergy / k T_P plancktemperature planckforce planckenergy / plancklength planckcharge sqrt(epsilon0 hbar c) planckcurrent planckcharge / plancktime planckvolt planckenergy / planckcharge planckEfield planckvolt / plancklength planckBfield planckEfield / c # Rationalized, reduced planck units planckmass_red sqrt(hbar c / 8 pi G) planckenergy_red planckmass_red c^2 plancktime_red hbar / planckenergy_red plancklength_red plancktime_red c plancktemperature_red planckenergy_red / k planckforce_red planckenergy_red / plancklength_red planckcharge_red sqrt(epsilon0 hbar c) planckcurrent_red planckcharge_red / plancktime_red planckvolt_red planckenergy_red / planckcharge_red planckEfield_red planckvolt_red / plancklength_red planckBfield_red planckEfield_red /c !var UNITS_SYSTEM planck !message Planck units selected !prompt (planck) +c 1 +h 2 pi +G 1 +boltzmann 1 +kg sqrt(G_SI / hbar_SI c_SI) +s c_SI^2 / hbar_SI kg +m s / c_SI +K k_SI / hbar_SI s !endvar !var UNITS_SYSTEM planck-red !message Reduced planck units selected !prompt (planck reduced) +c 1 +h 2 pi +G 1/8 pi +boltzmann 1 +kg sqrt(8 pi G_SI / hbar_SI c_SI) +s c_SI^2 / hbar_SI kg +m s / c_SI +K k_SI / hbar_SI s !endvar # # Some historical electromagnetic units # intampere 0.999835 A # Defined as the current which in one intamp intampere # second deposits .001118 gram of # silver from an aqueous solution of # silver nitrate. intfarad 0.999505 F intvolt 1.00033 V intohm 1.000495 ohm # Defined as the resistance of a # uniform column of mercury containing # 14.4521 gram in a column 1.063 m # long and maintained at 0 degC. daniell 1.042 V # Meant to be electromotive force of a # Daniell cell, but in error by .04 V faraday N_A e mol # Charge that must flow to deposit or faraday_phys 96521.9 C # liberate one gram equivalent of any faraday_chem 96495.7 C # element. (The chemical and physical # values are off slightly from what is # obtained by multiplying by amu_chem # or amu_phys. These values are from # a 1991 NIST publication.) Note that # there is a Faraday constant which is # equal to N_A e and hence has units of # C/mol. kappline 6000 maxwell # Named by and for Gisbert Kapp siemensunit 0.9534 ohm # Resistance of a meter long column of # mercury with a 1 mm cross section. # # Printed circuit board units. # # http://www.ndt-ed.org/GeneralResources/IACS/IACS.htm. # # Conductivity is often expressed as a percentage of IACS. A copper wire a # meter long with a 1 mm^2 cross section has a resistance of 1|58 ohm at # 20 deg C. Copper density also has a standard IACS value at that temperature. # copperconductivity 58 siemens m / mm^2 # A wire a meter long with IACS copperconductivity # a 1 mm^2 cross section copperdensity 8.89 g/cm^3 # The "ounce" measures the ouncecopper oz / ft^2 copperdensity # thickness of copper used ozcu ouncecopper # in circuitboard fabrication # # Photometric units # LUMINOUS_INTENSITY candela LUMINOUS_FLUX lumen LUMINOUS_ENERGY talbot ILLUMINANCE lux EXITANCE lux candle 1.02 candela # Standard unit for luminous intensity hefnerunit 0.9 candle # in use before candela hefnercandle hefnerunit # violle 20.17 cd # luminous intensity of 1 cm^2 of # platinum at its temperature of # solidification (2045 K) lumen cd sr # Luminous flux (luminous energy per lm lumen # time unit) talbot lumen s # Luminous energy lumberg talbot # References give these values for lumerg talbot # lumerg and lumberg both. Note that # a paper from 1948 suggests that # lumerg should be 1e-7 talbots so # that lumergs/erg = talbots/joule. # lumerg = luminous erg lux lm/m^2 # Illuminance or exitance (luminous lx lux # flux incident on or coming from phot lumen / cm^2 # a surface) ph phot # footcandle lumen/ft^2 # Illuminance from a 1 candela source # at a distance of one foot metercandle lumen/m^2 # Illuminance from a 1 candela source # at a distance of one meter mcs metercandle s # luminous energy per area, used to # measure photographic exposure nox 1e-3 lux # These two units were proposed for skot 1e-3 apostilb # measurements relating to dark adapted # eyes. # Luminance measures LUMINANCE nit nit cd/m^2 # Luminance: the intensity per projected stilb cd / cm^2 # area of an extended luminous source. sb stilb # (nit is from latin nitere = to shine.) apostilb cd/pi m^2 asb apostilb blondel apostilb # Named after a French scientist. # Equivalent luminance measures. These units are units which measure # the luminance of a surface with a specified exitance which obeys # Lambert's law. (Lambert's law specifies that luminous intensity of # a perfectly diffuse luminous surface is proportional to the cosine # of the angle at which you view the luminous surface.) equivalentlux cd / pi m^2 # luminance of a 1 lux surface equivalentphot cd / pi cm^2 # luminance of a 1 phot surface lambert cd / pi cm^2 footlambert cd / pi ft^2 # The bril is used to express "brilliance" of a source of light on a # logarithmic scale to correspond to subjective perception. An increase of 1 # bril means doubling the luminance. A luminance of 1 lambert is defined to # have a brilliance of 1 bril. bril(x) units=[1;lambert] 2^(x+-100) lamberts ;log2(bril/lambert)+100 # Some luminance data from the IES Lighting Handbook, 8th ed, 1993 sunlum 1.6e9 cd/m^2 # at zenith sunillum 100e3 lux # clear sky sunillum_o 10e3 lux # overcast sky sunlum_h 6e6 cd/m^2 # value at horizon skylum 8000 cd/m^2 # average, clear sky skylum_o 2000 cd/m^2 # average, overcast sky moonlum 2500 cd/m^2 # # Photographic Exposure Value # This section by Jeff Conrad (jeff_conrad@msn.com) # # The Additive system of Photographic EXposure (APEX) proposed in ASA # PH2.5-1960 was an attempt to simplify exposure determination for people who # relied on exposure tables rather than exposure meters. Shortly thereafter, # nearly all cameras incorporated exposure meters, so the APEX system never # caught on, but the concept of exposure value remains in use. Though given as # 'Ev' in ASA PH2.5-1960, it is now more commonly indicated by 'EV'. EV is # related to exposure parameters by # # A^2 LS ES # 2^EV = --- = -- = -- # t K C # # Where # A = Relative aperture (f-number) # t = Exposure time in seconds # L = Scene luminance in cd/m2 # E = Scene illuminance in lux # S = Arithmetic ISO speed # K = Reflected-light meter calibration constant # C = Incident-light meter calibration constant # # Strictly, an exposure value is a combination of aperture and exposure time, # but it's also commonly used to indicate luminance (or illuminance). # Conversion to luminance or illuminance units depends on the ISO speed and the # meter calibration constant. Common practice is to use an ISO speed of 100. # Calibration constants vary among camera and meter manufacturers: Canon, # Nikon, and Sekonic use a value of 12.5 for reflected-light meters, while # Kenko (formerly Minolta) and Pentax use a value of 14. Kenko and Sekonic use # a value of 250 for incident-light meters with flat receptors. # # The values for in-camera meters apply only averaging, weighted-averaging, or # spot metering--the multi-segment metering incorporated in most current # cameras uses proprietary algorithms that evaluate many factors related to the # luminance distribution of what is being metered; they are not amenable to # simple conversions, and are usually not disclosed by the manufacturers. s100 100 / lx s # ISO 100 speed iso100 s100 # Reflected-light meter calibration constant with ISO 100 speed k1250 12.5 (cd/m2) / lx s # For Canon, Nikon, and Sekonic k1400 14 (cd/m2) / lx s # For Kenko (Minolta) and Pentax # Incident-light meter calibration constant with ISO 100 film c250 250 lx / lx s # flat-disc receptor # Exposure value to scene luminance with ISO 100 imaging media # For Kenko (Minolta) or Pentax #ev100(x) units=[;cd/m^2] range=(0,) 2^x k1400 / s100; log2(ev100 s100/k1400) # For Canon, Nikon, or Sekonic ev100(x) units=[1;cd/m^2] range=(0,) 2^x k1250 / s100; log2(ev100 s100/k1250) EV100() ev100 # Exposure value to scene illuminance with ISO 100 imaging media iv100(x) units=[1;lx] range=(0,) 2^x c250 / s100; log2(iv100 s100 / c250) # Other Photographic Exposure Conversions # # As part of APEX, ASA PH2.5-1960 proposed several logarithmic quantities # related by # # Ev = Av + Tv = Bv + Sv # # where # Av = log2(A^2) Aperture value # Tv = log2(1/t) Time value # Sv = log2(N Sx) Speed value # Bv = log2(B S / K) Luminance ("brightness") value # Iv = log2(I S / C) Illuminance value # # and # A = Relative aperture (f-number) # t = Exposure time in seconds # Sx = Arithmetic ISO speed in 1/lux s # B = luminance in cd/m2 # I = luminance in lux # The constant N derives from the arcane relationship between arithmetic # and logarithmic speed given in ASA PH2.5-1960. That relationship # apparently was not obvious--so much so that it was thought necessary # to explain it in PH2.12-1961. The constant has had several values # over the years, usually without explanation for the changes. Although # APEX had little impact on consumer cameras, it has seen a partial # resurrection in the Exif standards published by the Camera & Imaging # Products Association of Japan. #N_apex 2^-1.75 lx s # precise value implied in ASA PH2.12-1961, # derived from ASA PH2.5-1960. #N_apex 0.30 lx s # rounded value in ASA PH2.5-1960, # ASA PH2.12-1961, and ANSI PH2.7-1986 #N_apex 0.3162 lx s # value in ANSI PH2.7-1973 N_exif 1|3.125 lx s # value in Exif 2.3 (2010), making Sv(5) = 100 K_apex1961 11.4 (cd/m2) / lx s # value in ASA PH2.12-1961 K_apex1971 12.5 (cd/m2) / lx s # value in ANSI PH3.49-1971; more common C_apex1961 224 lx / lx s # value in PH2.12-1961 (20.83 for I in # footcandles; flat sensor?) C_apex1971 322 lx / lx s # mean value in PH3.49-1971 (30 +/- 5 for I in # footcandles; hemispherical sensor?) N_speed N_exif K_lum K_apex1971 C_illum C_apex1961 # Units for Photographic Exposure Variables # # Practical photography sometimes pays scant attention to units for exposure # variables. In particular, the "speed" of the imaging medium is treated as if # it were dimensionless when it should have units of reciprocal lux seconds; # this practice works only because "speed" is almost invariably given in # accordance with international standards (or similar ones used by camera # manufacturers)--so the assumed units are invariant. In calculating # logarithmic quantities--especially the time value Tv and the exposure value # EV--the units for exposure time ("shutter speed") are often ignored; this # practice works only because the units of exposure time are assumed to be in # seconds, and the missing units that make the argument to the logarithmic # function dimensionless are silently provided. # # In keeping with common practice, the definitions that follow treat "speeds" # as dimensionless, so ISO 100 speed is given simply as '100'. When # calculating the logarithmic APEX quantities Av and Tv, the definitions # provide the missing units, so the times can be given with any appropriate # units. For example, giving an exposure time of 1 minute as either '1 min' or # '60 s' will result in Tv of -5.9068906. # # Exposure Value from f-number and Exposure Time # # Because nonlinear unit conversions only accept a single quantity, # there is no direct conversion from f-number and exposure time to # exposure value EV. But the EV can be obtained from a combination of # Av and Tv. For example, the "sunny 16" rule states that correct # exposure for a sunlit scene can achieved by using f/16 and an exposure # time equal to the reciprocal of the ISO speed in seconds; this can be # calculated as # # ~Av(16) + ~Tv(1|100 s), # # which gives 14.643856. These conversions may be combined with the # ev100 conversion: # # ev100(~Av(16) + ~Tv(1|100 s)) # # to yield the assumed average scene luminance of 3200 cd/m^2. # convert relative aperture (f-number) to aperture value Av(A) units=[1;1] domain=[-2,) range=[0.5,) 2^(A/2); 2 log2(Av) # convert exposure time to time value Tv(t) units=[1;s] range=(0,) 2^(-t) s; log2(s / Tv) # convert logarithmic speed Sv in ASA PH2.5-1960 to ASA/ISO arithmetic speed; # make arithmetic speed dimensionless # 'Sv' conflicts with the symbol for sievert; you can uncomment this function # definition if you don't need that symbol #Sv(S) units=[1;1] range=(0,) 2^S / (N_speed/lx s); log2((N_speed/lx s) Sv) Sval(S) units=[1;1] range=(0,) 2^S / (N_speed/lx s); log2((N_speed/lx s) Sval) # convert luminance value Bv in ASA PH2.12-1961 to luminance Bv(x) units=[1;cd/m^2] range=(0,) \ 2^x K_lum N_speed ; log2(Bv / (K_lum N_speed)) # convert illuminance value Iv in ASA PH2.12-1961 to illuminance Iv(x) units=[1;lx] range=(0,) \ 2^x C_illum N_speed ; log2(Iv / (C_illum N_speed)) # convert ASA/ISO arithmetic speed Sx to ASA logarithmic speed in # ASA PH2.5-1960; make arithmetic speed dimensionless Sx(S) units=[1;1] domain=(0,) \ log2((N_speed/lx s) S); 2^Sx / (N_speed/lx s) # convert DIN speed/ISO logarithmic speed in ISO 6:1993 to arithmetic speed # for convenience, speed is treated here as if it were dimensionless Sdeg(S) units=[1;1] range=(0,) 10^((S - 1) / 10) ; (1 + 10 log(Sdeg)) Sdin() Sdeg # Numerical Aperture and f-Number of a Lens # # The numerical aperture (NA) is given by # # NA = n sin(theta) # # where n is the index of refraction of the medium and theta is half # of the angle subtended by the aperture stop from a point in the image # or object plane. For a lens in air, n = 1, and # # NA = 0.5 / f-number # # convert NA to f-number numericalaperture(x) units=[1;1] domain=(0,1] range=[0.5,) \ 0.5 / x ; 0.5 / numericalaperture NA() numericalaperture # # convert f-number to itself; restrict values to those possible fnumber(x) units=[1;1] domain=[0.5,) range=[0.5,) x ; fnumber # Referenced Photographic Standards # # ASA PH-2.5-1960. USA Standard, Method for Determining (Monochrome, # Continuous-Tone) Speed of Photographic Negative Materials. # ASA PH2.12-1961. American Standard, General-Purpose Photographic # Exposure Meters (photoelectric type). # ANSI PH3.49-1971. American National Standard for general-purpose # photographic exposure meters (photoelectric type). # ANSI PH2.7-1973. American National Standard Photographic Exposure Guide. # ANSI PH2.7-1986. American National Standard for Photography -- # Photographic Exposure Guide. # CIPA DC-008-2010. Exchangeable image file format for digital still # cameras: Exif Version 2.3 # ISO 6:1993. International Standard, Photography -- Black-and-white # pictorial still camera negative film/process systems -- # Determination of ISO Speed. # # Astronomical time measurements # # Astronomical time measurement is a complicated matter. The length of the # true day at a given place can be 21 seconds less than 24 hours or 30 seconds # over 24 hours. The two main reasons for this are the varying speed of # Earth in its elliptical orbit and the fact that the Sun moves on the ecliptic # instead of along the celestial equator. To devise a workable system for time # measurement, Simon Newcomb (1835-1909) used a fictitious "mean Sun". # Consider a first fictitious Sun traveling along the ecliptic at a constant # speed and coinciding with the true Sun at perigee and apogee. Then # considering a second fictitious Sun traveling along the celestial equator at # a constant speed and coinciding with the first fictitious Sun at the # equinoxes. The second fictitious Sun is the "mean Sun". From this equations # can be written out to determine the length of the mean day, and the tropical # year. The length of the second was determined based on the tropical year # from such a calculation and was officially used from 1960-1967 until atomic # clocks replaced astronomical measurements for a standard of time. All of the # values below give the mean time for the specified interval. # # See "Mathematical Astronomy Morsels" by Jean Meeus for more details # and a description of how to compute the correction to mean time. # TIME second anomalisticyear 365.2596 days # The time between successive # perihelion passages of # Earth. siderealyear 365.256360417 day # The time for Earth to make # one revolution around the Sun # relative to the stars. tropicalyear 365.242198781 day # The time needed for the mean Sun # as defined above to increase # its longitude by 360 degrees. # Most references defined the # tropical year as the interval # between vernal equinoxes, but # this is misleading. The length # of the season changes over time # because of the eccentricity of # Earth's orbit. The time # between vernal equinoxes is # approximately 365.24237 days # around the year 2000. See # "Mathematical Astronomy # Morsels" for more details. eclipseyear 346.62 days # The line of nodes is the # intersection of the plane of # Earth's orbit around the Sun # with the plane of the Moon's # orbit around Earth. Eclipses # can only occur when the Moon # and Sun are close to this # line. The line rotates and # appearances of the Sun on the # line of nodes occur every # eclipse year. saros 223 synodicmonth # The Earth, Moon and Sun appear in # the same arrangement every # saros, so if an eclipse occurs, # then one saros later, a similar # eclipse will occur. (The saros # is close to 19 eclipse years.) # The eclipse will occur about # 120 degrees west of the # preceding one because the # saros is not an even number of # days. After 3 saros, an # eclipse will occur at # approximately the same place. solarday day # Time from noon to noon siderealday 86164.09054 s # The sidereal day is the interval siderealhour 1|24 siderealday # between two successive transits siderealminute 1|60 siderealhour # of a star over the meridian, siderealsecond 1|60 siderealminute # or the time required for # Earth to make one rotation # relative to the stars. Another # way to think about it is to # imagine looking down at the # solar system and noting when # Earth has made a rotation. # The more usual solar day is the # time required to make a # rotation relative to the Sun, # which means the same point on # Earth faces the Sun again. # Because Earth moves in its # orbit, it has to rotate a bit # more to face the Sun again, # hence the solar day is slightly # longer than the sidereal day. # The value given here is the # mean day length taken from # ssd.jpl.nasa.gov/astro_par.html # which in turn cites the # "Explanatory Supplement to the # Astronomical Almanac", 1992. anomalisticmonth 27.55454977 day # Time for the Moon to travel from # perigee to perigee nodicalmonth 27.2122199 day # The nodes are the points where draconicmonth nodicalmonth # an orbit crosses the ecliptic. draconiticmonth nodicalmonth # This is the time required to # travel from the ascending node # to the next ascending node. siderealmonth 27.321661 day # Time required for the Moon to # orbit the Earth lunarmonth 29 days + 12 hours + 44 minutes + 2.8 seconds # Mean time between full moons. synodicmonth lunarmonth # Full moons occur when the Sun lunation synodicmonth # and Moon are on opposite sides lune 1|30 lunation # of the Earth. Since the Earth lunour 1|24 lune # moves around the Sun, the Moon # has to move a bit further in its # orbit to return to the full moon # configuration. year tropicalyear yr year month 1|12 year mo month lustrum 5 years # The Lustrum was a Roman # purification ceremony that took # place every five years. # Classically educated Englishmen # used this term. decade 10 years century 100 years millennium 1000 years millennia millennium solaryear year lunaryear 12 lunarmonth calendaryear 365 day commonyear 365 day leapyear 366 day julianyear 365.25 day gregorianyear 365.2425 day islamicyear 354 day # A year of 12 lunar months. They islamicleapyear 355 day # began counting on July 16, AD 622 # when Muhammad emigrated to Medina # (the year of the Hegira). They need # 11 leap days in 30 years to stay in # sync with the lunar year which is a # bit longer than the 29.5 days of the # average month. The months do not # keep to the same seasons, but # regress through the seasons every # 32.5 years. islamicmonth 1|12 islamicyear # They have 29 day and 30 day months. # The Hebrew year is also based on lunar months, but synchronized to the solar # calendar. The months vary irregularly between 29 and 30 days in length, and # the years likewise vary. The regular year is 353, 354, or 355 days long. To # keep up with the solar calendar, a leap month of 30 days is inserted every # 3rd, 6th, 8th, 11th, 14th, 17th, and 19th years of a 19 year cycle. This # gives leap years that last 383, 384, or 385 days. # # Planetary data from JPL's planet fact sheets. Each planet has its # own sheet at https://nssdc.gsfc.nasa.gov/planetary/factsheet/fact.html # The source for data on the fact sheets is described at # https://nssdc.gsfc.nasa.gov/planetary/factsheet/fact_notes.html # and they also indicate that the values listed are not "official" values: # there is no no single set of agreed upon values. # Sidereal days. The sidereal day is the time required for a planet to make a # revolution relative to the stars. This is the default day value. mercuryday mercuryday_sidereal venusday venusday_sidereal earthday earthday_sidereal marsday marsday_sidereal jupiterday jupiterday_sidereal saturnday saturnday_sidereal uranusday uranusday_sidereal neptuneday neptuneday_sidereal plutoday plutoday_sidereal mercuryday_sidereal 1407.6 hr # Mercury is in a 3:2 resonance lock # where it makes 3 rotations per 2 orbits # so 3 sidereal days = 2 years venusday_sidereal 5832.6 hr # Retrograde earthday_sidereal siderealday marsday_sidereal 24.6229 hr jupiterday_sidereal 9.9250 hr saturnday_sidereal 10.656 hr uranusday_sidereal 17.24 hr # Retrograde neptuneday_sidereal 16.11 hr plutoday_sidereal 153.2928 hr # Retrograde # In astronomy, an object's rotation is "prograde" if it rotates in # the same direction as the primary object it orbits. Prograde # rotation is the more common case: in Earth's solar system, Mercury, # Earth, Mars, Jupiter, Saturn, and Neptune have prograde rotation. # When an object rotates opposite the direction of its primary object, # the object's rotation is "retrograde". Venus, Uranus, and Pluto have # retrograde rotation. # # The solar (or synodic) day is the time from noon to noon on a planet. This # is different from the sidereal day because the planet has moved in its orbit, # so (if its rotation is prograde) it needs additional rotation to return to # the same orientation relative to the Sun. In one orbital period (a year), # this amounts to one additional complete rotation, so the number of sidereal # days in a year is one greater than the number of solar days. # # If the planet's rotation is retrograde, less rotation is needed to return to # the same orientation relative to the Sun, and the number of sidereal days in # a year is one fewer than the number of solar days. # # The solar day can be computed from the sidereal day in the typical prograde # case by: # solar_day = sidereal_day year / (year - sidereal_day) # If the planet's rotation is retrograde like Venus then the formula is # solar_day = sidereal_day year / (year + sidereal_day) # If the sidereal day and year are the same length then the same face of the # planet faces the Sun and there is no solar day. mercuryday_solar 4222.6 hr venusday_solar 2802.0 hr earthday_solar 24 hr marsday_solar 24.6597 hr jupiterday_solar 9.9259 hr saturnday_solar 10.656 hr uranusday_solar 17.24 hr neptuneday_solar 16.11 hr plutoday_solar 153.2820 hr # Sidereal years mercuryyear 87.969 day venusyear 224.701 day earthyear siderealyear marsyear 686.980 day jupiteryear 4332.589 day saturnyear 10759.22 day uranusyear 30685.4 day neptuneyear 60189 day plutoyear 90560 day # Equatorial radii for the planets from JPL fact sheets mercuryradius 2440.5 km venusradius 6051.8 km earthradius 6371.01 km marsradius 3396.2 km jupiterradius 71492 km # 1 bar level saturnradius 60268 km # 1 bar level uranusradius 25559 km # 1 bar level neptuneradius 24764 km # 1 bar level plutoradius 1188 km mercurysundist_min 46.000 Gm mercurysundist_max 69.818 Gm venussundist_min 107.480 Gm venussundist_max 108.941 Gm earthsundist_min sundist_min earthsundist_max sundist_max marssundist_min 206.650 Gm marssundist_max 249.261 Gm jupitersundist_min 740.595 Gm jupitersundist_max 816.363 Gm saturnsundist_min 1357.554 Gm saturnsundist_max 1506.527 Gm uranussundist_min 2732.696 Gm uranussundist_max 3001.390 Gm neptunesundist_min 4471.050 Gm neptunesundist_max 4558.857 Gm plutosundist_min 4434.987 Gm plutosundist_max 7304.326 Gm sundist 1.0000010178 au # mean Earth-Sun distance moondist 3.844e8 m # mean Earth-Moon distance sundist_near 147.095 Gm # Earth-Sun distance at perihelion sundist_min sundist_near sundist_far 152.100 Gm # Earth-Sun distance at aphelion sundist_max sundist_far # The Earth-Moon distances at perigee and apogee are different for every # lunation. The values here are the extremes for 1500-2500 according to # Jean Meeus's Astronomical Algorithms (1991, 332). moondist_min 356.371 km # minimum distance at perigee 1500-2500 moondist_max 406.720 km # maximum distance at apogee 1500-2500 # Objects on Earth are charted relative to a perfect ellipsoid whose # dimensions are specified by different organizations. The ellipsoid is # specified by an equatorial radius and a flattening value which defines the # polar radius. These values are the 1996 values given by the International # Earth Rotation Service (IERS) whose reference documents can be found at # http://maia.usno.navy.mil/ earthflattening IERS_earthflattening earthradius_equatorial IERS_earthradius_equatorial earthradius_polar (1-earthflattening) earthradius_equatorial # The World Geodetic System maintains a standard, WGS84, which is used by the # the GPS system. This system uses a conventional ellipsoid that was fixed in # 1984 and has remained constant so that data collected at different times is # referenced to the same ellipsoid. https://epsg.io/4326 WGS84_earthflattening 1|298.257223563 WGS84_earthradius_equatorial 6378137 m WGS84_earthradius_polar (1-WGS84_earthflattening) WGS84_earthradius_equatorial # The International Earth Rotation Service (IERS) attempts to # maintain an accurate model of Earth, with updates to maintain the highest # possible accuracy, even though this makes it more difficult to relate geodetic # mesurements made at different times. Values below are from the 2017 standard. # https://iers-conventions.obspm.fr/content/chapter1/icc1.pdf IERS_earthflattening 1|298.25642 IERS_earthradius_equatorial 6378136.6 m IERS_earthradius_polar (1-IERS_earthflattening) IERS_earthradius_equatorial landarea 148.847e6 km^2 oceanarea 361.254e6 km^2 moonradius 1738 km # mean value sunradius 6.96e8 m # Many astronomical values can be measured most accurately in a system of units # using the astronomical unit and the mass of the Sun as base units. The # uncertainty in the gravitational constant makes conversion to SI units # significantly less accurate. # The astronomical unit was defined to be the length of the of the semimajor # axis of a massless object with the same year as Earth. With such a # definition in force, and with the mass of the Sun set equal to one, Kepler's # third law can be used to solve for the value of the gravitational constant. # Kepler's third law says that (2 pi / T)^2 a^3 = G M where T is the orbital # period, a is the size of the semimajor axis, G is the gravitational constant # and M is the mass. With M = 1 and T and a chosen for Earth's orbit, we # find sqrt(G) = (2 pi / T) sqrt(AU^3). This constant is called the Gaussian # gravitational constant, apparently because Gauss originally did the # calculations. However, when the original calculation was done, the value # for the length of Earth's year was inaccurate. The value used is called # the Gaussian year. Changing the astronomical unit to bring it into # agreement with more accurate values for the year would have invalidated a # lot of previous work, so instead the astronomical unit has been kept equal # to this original value. This is accomplished by using a standard value for # the Gaussian gravitational constant. This constant is called k. gauss_k 0.01720209895 # This beast has dimensions of # au^(3|2) / day and is exact. gaussianyear (2 pi / gauss_k) days # Year that corresponds to the Gaussian # gravitational constant. This is a # fictional year, and doesn't # correspond to any celestial event. astronomicalunit 149597870700 m # IAU definition from 2012, exact au astronomicalunit # ephemeris for the above described # astronomical unit. (See the NASA # site listed above.) GMsun 132712440041.279419 km^3 / s^2 # heliocentric gravitational constant solarmass GMsun/G # is known more accurately than G. sunmass solarmass # Estimated from DE440 # The following are masses for planetary systems, not just the planet itself, # except for the case of Earth, where the Moon is excluded. Masses are # relative to G because they are known much more accurately than G. # # See https://ssd.jpl.nasa.gov/astro_par.html. Values are from # the DE440 Ephermeris: https://ssd.jpl.nasa.gov/doc/Park.2021.AJ.DE440.pdf mercurymass 22031.868551 km^3 / s^2 G venusmass 324858.592000 km^3 / s^2 G marsmass 42828.375816 km^3 / s^2 G jupitermass 126712764.100000 km^3 / s^2 G saturnmass 37940584.841800 km^3 / s^2 G uranusmass 5794556.400000 km^3 / s^2 G neptunemass 6836527.100580 km^3 / s^2 G plutomass 975.500000 km^3 / s^2 G ceresmass 62.62890 km^3 / s^2 G vestamass 17.288245 km^3 / s^2 G earthmass 398600.435507 km^3 / s^2 G # Earth alone moonmass 4902.800118 km^3 / s^2 G moonearthmassratio moonmass/earthmass earthmoonmass earthmass+moonmass moongravity 1.62 m/s^2 # Earth gravity values at the equator and poles. These values are # obtained from the WGS84 model. gravity_equatorial 9.7803263359 m / s^2 gravity_polar 9.8321849378 m / s^2 # The Hubble constant gives the speed at which distance galaxies are moving # away from Earth according to v = H0*d, where H0 is the hubble constant # and d is the distance to the galaxy. hubble 70 km/s/Mpc # approximate H0 hubble # Parallax is the angular difference between the topocentric (on Earth's # surface) and geocentric (at Earth's center) direction toward a celestial body # when the body is at a given altitude. When the body is on the horizon, the # parallax is the horizontal parallax; when the body is on the horizon and the # observer is on the equator, the parallax is the equatorial horizontal # parallax. When the body is at zenith, the parallax is zero. lunarparallax asin(earthradius_equatorial / moondist) # Moon equatorial moonhp lunarparallax # horizontal parallax # at mean distance # Light from celestial objects is attenuated by passage through Earth's # atmosphere. A body near the horizon passes through much more air than an # object at zenith, and is consequently less bright. Air mass is the ratio of # the length of the optical path at a given altitude (angle above the horizon) # to the length at zenith. Air mass at zenith is by definition unity; at the # horizon, air mass is approximately 38, though the latter value can vary # considerably with atmospheric conditions. The general formula is # E = E0 # exp(-c X), where E0 is the value outside Earth's atmosphere, E is the value # seen by an observer, X is the air mass and c is the extinction coefficient. # A common value for c in reasonably clear air is 0.21, but values can be # considerably greater in urban areas. Apparent altitude is that perceived by # an observer; it includes the effect of atmospheric refraction. There is no # shortage of formulas for air mass # (https://en.wikipedia.org/wiki/Air_mass_(astronomy)); all are subject to # variations in local atmospheric conditions. The formula used here is simple # and is in good agreement with rigorously calculated values under standard # conditions. # # Extraterrestrial illuminance or luminance of an object at a given altitude # determined with vmag() or SB_xxx() below can be multiplied by # atm_transmission() or atm_transmissionz() to estimate the terrestrial value. # # Kasten and Young (1989) air mass formula. alt is apparent altitude # Reference: # Kasten, F., and A.T. Young. 1989. "Revised Optical Air Mass Tables # and Approximation Formula." Applied Optics. Vol. 28, 4735–4738. # Bibcode:1989ApOpt..28.4735K. doi:10.1364/AO.28.004735. airmass(alt) units=[degree;1] domain=[0,90] noerror \ 1 / (sin(alt) + 0.50572 (alt / degree + 6.07995)^-1.6364) # zenith is apparent zenith angle (zenith = 90 deg - alt) airmassz(zenith) units=[degree;1] domain=[0,90] noerror \ 1 / (cos(zenith) + 0.50572 (96.07995 - zenith / degree)^-1.6364) # For reasonably clear air at sea level; values may need adjustment for # elevation and local atmospheric conditions # for scotopic vision (510 nm), appropriate for the dark-adapted eye # extinction_coeff 0.26 # for photopic vision, appropriate for observing brighter objects such # as the full moon extinction_coeff 0.21 atm_transmission(alt) units=[degree;1] domain=[0,90] noerror \ exp(-extinction_coeff airmass(alt)) # in terms of zenith angle (zenith = 90 deg - alt) atm_transmissionz(zenith) units=[degree;1] domain=[0,90] noerror \ exp(-extinction_coeff airmassz(zenith)) # Moon and Sun data at mean distances moonvmag -12.74 # Moon apparent visual magnitude at mean distance sunvmag -26.74 # Sun apparent visual magnitude at mean distance moonsd asin(moonradius / moondist) # Moon angular semidiameter at mean distance sunsd asin(sunradius / sundist) # Sun angular semidiameter at mean distance # Visual magnitude of star or other celestial object. The system of stellar # magnitudes, developed in ancient Greece, assigned magnitudes from 1 # (brightest) to 6 (faintest visible to the naked eye). In 1856, British # astronomer Norman Pogson made the system precise, with a magnitude 1 object # 100 times as bright as a magnitude 6 object, and each magnitude differing # from the next by a constant ratio; the ratio, sometimes known as Pogson's # ratio, is thus 100^0.2, or approximately 2.5119. The logarithm of 100^0.2 is # 0.4, hence the common use of powers of 10 and base-10 logarithms. # # Reference: # Allen, C.W. 1976. Astrophysical Quantities, 3rd ed. 1973, reprinted # with corrections, 1976. London: Athlone. # # The function argument is the (dimensionless) visual magnitude; reference # illuminance of 2.54e-6 lx is from Allen (2000, 21), and is for outside # Earth's atmosphere. Illuminance values can be adjusted to terrestrial values # by multiplying by one of the atm_transmission functions above. # Illuminance from apparent visual magnitude vmag(mag) units=[1;lx] domain=[,] range=(0,] \ 2.54e-6 lx 10^(-0.4 mag); -2.5 log(vmag / (2.54e-6 lx)) # Surface brightness of a celestial object of a given visual magnitude # is a logarithmic measure of the luminance the object would have if its # light were emitted by an object of specified solid angle; it is # expressed in magnitudes per solid angle. Surface brightness can be # obtained from the visual magnitude by # S = m + 2.5 log(pi pi k a b), # where k is the phase (fraction illuminated), a is the equatorial # radius, and b is the polar radius. For 100% illumination (e.g., full # moon), this is often simplified to # S = m + 2.5 log(pi k s^2), # where s is the object's angular semidiameter; the units of s determine # the units of solid angle. The visual magnitude and semidiameter must # be appropriate for the object's distance; for other than 100% # illumination, the visual magnitude must be appropriate for the phase. # Luminance values are for outside Earth's atmosphere; they can be # adjusted to terrestrial values by multiplying by one of the atm_transmission # functions above. # luminance from surface brightness in magnitudes per square degree SB_degree(sb) units=[1;cd/m^2] domain=[,] range=(0,] \ vmag(sb) / squaredegree ; \ ~vmag(SB_degree squaredegree) # luminance from surface brightness in magnitudes per square minute SB_minute(sb) units=[1;cd/m^2] domain=[,] range=(0,] \ vmag(sb) / squareminute ; \ ~vmag(SB_minute squareminute) # luminance from surface brightness in magnitudes per square second SB_second(sb) units=[1;cd/m^2] domain=[,] range=(0,] \ vmag(sb) / squaresecond ; \ ~vmag(SB_second squaresecond) # luminance from surface brightness in magnitudes per steradian SB_sr(sb) units=[1;cd/m^2] domain=[,] range=(0,] \ vmag(sb) / sr ; \ ~vmag(SB_sr sr) SB() SB_second SB_sec() SB_second SB_min() SB_minute SB_deg() SB_degree # The brightness of one tenth-magnitude star per square degree outside # Earth's atmosphere; often used for night sky brightness. S10 SB_degree(10) # Examples for magnitude and surface brightness functions # Sun illuminance from visual magnitude # You have: sunvmag # You want: # Definition: -26.74 = -26.74 # You have: vmag(sunvmag) # You want: lx # * 126134.45 # / 7.9280482e-06 # # Moon surface brightness from visual magnitude and semidiameter at 100% # illumination (full moon): # You have: moonvmag # You want: # Definition: -12.74 = -12.74 # You have: moonsd # You want: arcsec # * 932.59484 # / 0.001072277 # You have: moonvmag + 2.5 log(pi 932.59484^2) # You want: # Definition: 3.3513397 # # Similar example with specific data obtained from another source (JPL # Horizons, https://ssd.jpl.nasa.gov/horizons.cgi); semidiameter is in # arcseconds # # You have: -12.9 + 2.5 log(pi 2023.201|2^2) # You want: # Definition: 3.3679199 # You have: SB_second(-12.9 + 2.5 log(pi 2023.201|2^2)) # You want: # Definition: 4858.6547 cd / m^2 # # If surface brightness is provided by another source (e.g., Horizons), # it can simply be used directly: # You have: SB_second(3.3679199) # You want: cd/m^2 # * 4858.6546 # / 0.0002058183 # The illuminance and luminance values are extraterrestrial (outside # Earth's atmosphere). The values at Earth's surface are less than these # because of atmospheric extinction. For example, in the last example # above, if the Moon were at an altitude of 55 degrees, the terrestrial # luminance could be calculated with # You have: SB_second(3.3679199) # You want: cd/m^2 # * 4858.6546 # / 0.0002058183 # You have: _ atm_transmission(55 deg) # You want: cd/m^2 # * 3760.6356 # / 0.0002659125 # If desired, photographic exposure can be determined with EV100(), # leading to acceptable combinations of aperture and exposure time. # For the example above, but with the Moon at 10 degrees, # You have: SB_second(3.3679199) atm_transmission(10 deg) # You want: EV100 # 13.553962 # # The Hartree system of atomic units, derived from fundamental units # of mass (of the electron), action (Planck's constant), charge, and # the Coulomb constant. This system is used in the fields of physical # chemistry and condensed matter physics. # # Fundamental units atomicmass electronmass atomiccharge e atomicaction hbar atomicenergy hartree # Derived units atomicvelocity sqrt(atomicenergy / atomicmass) atomictime atomicaction / atomicenergy atomiclength atomicvelocity atomictime atomicforce atomicenergy / atomiclength atomicmomentum atomicenergy / atomicvelocity atomiccurrent atomiccharge / atomictime atomicpotential atomicenergy / atomiccharge # electrical potential atomicvolt atomicpotential atomicEfield atomicpotential / atomiclength atomicBfield atomicEfield / atomicvelocity atomictemperature atomicenergy / boltzmann # # In Hartree units, m_e = hbar = e = coulombconst = bohrradius = alpha*c = 1 # !var UNITS_SYSTEM hartree !message Hartree units selected !prompt (hartree) +hartree 1 +kg 1/electronmass_SI +K k_SI / hbar_SI s +m alpha c_SI electronmass_SI / hbar_SI +s alpha c_SI m +A 1 / s e_SI !endvar # # These thermal units treat entropy as charge, from [5] # thermalcoulomb J/K # entropy thermalampere W/K # entropy flow thermalfarad J/K^2 thermalohm K^2/W # thermal resistance fourier thermalohm thermalhenry J K^2/W^2 # thermal inductance thermalvolt K # thermal potential difference # # United States units # # linear measure # The US Metric Law of 1866 legalized the metric system in the USA and # defined the meter in terms of the British system with the exact # 1 meter = 39.37 inches. On April 5, 1893 Thomas Corwin Mendenhall, # Superintendent of Weights and Measures, decided, in what has become # known as the "Mendenhall Order" that the meter and kilogram would be the # fundamental standards in the USA. The definition from 1866 was turned # around to give an exact definition of the yard as 3600|3937 meters This # definition was used until July of 1959 when the definition was changed # to bring the US and other English-speaking countries into agreement; the # Canadian value of 1 yard = 0.9144 meter (exactly) was chosen because it # was approximately halfway between the British and US values; it had the # added advantage of making 1 inch = 25.4 mm (exactly). Since 1959, the # "international" foot has been exactly 0.3048 meters. At the same time, # it was decided that any data expressed in feet derived from geodetic # surveys within the US would continue to use the old definition and call # the old unit the "survey foot." The US continues to define the statute # mile, furlong, chain, rod, link, and fathom in terms of the US survey # foot. # Sources: # NIST Special Publication 447, Sects. 5, 7, and 8. # NIST Handbook 44, 2011 ed., Appendix C. # Canadian Journal of Physics, 1959, 37:(1) 84, 10.1139/p59-014. US 1200|3937 m/ft # These four values will convert US- US # international measures to survey- US # US Survey measures geodetic- US int 3937|1200 ft/m # Convert US Survey measures to int- int # international measures inch 2.54 cm in inch foot 12 inch feet foot ft foot yard 3 ft yd yard mile 5280 ft # The mile was enlarged from 5000 ft # to this number in order to make # it an even number of furlongs. # (The Roman mile is 5000 romanfeet.) line 1|12 inch # Also defined as '.1 in' or as '1e-8 Wb' rod 5.5 yard perch rod furlong 40 rod # From "furrow long" statutemile mile league 3 mile # Intended to be an an hour's walk # surveyor's measure surveyorschain 66 surveyft surveychain surveyorschain surveyorspole 1|4 surveyorschain surveyorslink 1|100 surveyorschain chain 66 ft link 1|100 chain ch chain USacre 10 surveychain^2 intacre 10 chain^2 # Acre based on international ft intacrefoot acre foot USacrefoot USacre surveyfoot acrefoot intacrefoot acre intacre section mile^2 township 36 section homestead 160 acre # Area of land granted by the 1862 Homestead # Act of the United States Congress gunterschain surveyorschain engineerschain 100 ft engineerslink 1|100 engineerschain ramsdenschain engineerschain ramsdenslink engineerslink gurleychain 33 feet # Andrew Ellicott chain is the gurleylink 1|50 gurleychain # same length wingchain 66 feet # Chain from 1664, introduced by winglink 1|80 wingchain # Vincent Wing, also found in a # 33 foot length with 40 links. # early US length standards # The US has had four standards for the yard: one by Troughton of London # (1815); bronze yard #11 (1856); the Mendhall yard (1893), consistent # with the definition of the meter in the metric joint resolution of # Congress in 1866, but defining the yard in terms of the meter; and the # international yard (1959), which standardized definitions for Australia, # Canada, New Zealand, South Africa, the UK, and the US. # Sources: Pat Naughtin (2009), Which Inch?, www.metricationmatters.com; # Lewis E. Barbrow and Lewis V. Judson (1976). NBS Special Publication # 447, Weights and Measures Standards of the United States: A Brief # History. troughtonyard 914.42190 mm bronzeyard11 914.39980 mm mendenhallyard surveyyard internationalyard yard # nautical measure fathom 6 ft # Originally defined as the distance from # fingertip to fingertip with arms fully # extended. nauticalmile 1852 m # Supposed to be one minute of latitude at # the equator. That value is about 1855 m. # Early estimates of Earth's circumference # were a bit off. The value of 1852 m was # made the international standard in 1929. # The US did not accept this value until # 1954. The UK switched in 1970. cable 1|10 nauticalmile intcable cable # international cable cablelength cable UScable 100 USfathom navycablelength 720 USft # used for depth in water marineleague 3 nauticalmile geographicalmile brnauticalmile knot nauticalmile / hr click km # US military slang klick click # Avoirdupois weight pound 0.45359237 kg # The one normally used lb pound # From the latin libra grain 1|7000 pound # The grain is the same in all three # weight systems. It was originally # defined as the weight of a barley # corn taken from the middle of the # ear. ounce 1|16 pound oz ounce dram 1|16 ounce dr dram ushundredweight 100 pounds cwt hundredweight shorthundredweight ushundredweight uston shortton shortton 2000 lb quarterweight 1|4 uston shortquarterweight 1|4 shortton shortquarter shortquarterweight # Troy Weight. In 1828 the troy pound was made the first United States # standard weight. It was to be used to regulate coinage. troypound 5760 grain troyounce 1|12 troypound ozt troyounce pennyweight 1|20 troyounce # Abbreviated "d" in reference to a dwt pennyweight # Frankish coin called the "denier" # minted in the late 700's. There # were 240 deniers to the pound. assayton mg ton / troyounce # mg / assayton = troyounce / ton usassayton mg uston / troyounce brassayton mg brton / troyounce fineounce troyounce # A troy ounce of 99.5% pure gold # Some other jewelers units metriccarat 0.2 gram # Defined in 1907 metricgrain 50 mg carat metriccarat ct carat jewelerspoint 1|100 carat silversmithpoint 1|4000 inch momme 3.75 grams # Traditional Japanese unit based # on the chinese mace. It is used for # pearls in modern times and also for # silk density. The definition here # was adopted in 1891. # Apothecaries' weight appound troypound apounce troyounce apdram 1|8 apounce apscruple 1|3 apdram # Liquid measure usgallon 231 in^3 # US liquid measure is derived from gal gallon # the British wine gallon of 1707. quart 1|4 gallon # See the "winegallon" entry below pint 1|2 quart # more historical information. gill 1|4 pint usquart 1|4 usgallon uspint 1|2 usquart usgill 1|4 uspint usfluidounce 1|16 uspint fluiddram 1|8 usfloz minimvolume 1|60 fluiddram qt quart pt pint floz fluidounce usfloz usfluidounce fldr fluiddram liquidbarrel 31.5 usgallon usbeerbarrel 2 beerkegs beerkeg 15.5 usgallon # Various among brewers ponykeg 1|2 beerkeg winekeg 12 usgallon petroleumbarrel 42 usgallon # Originated in Pennsylvania oil barrel petroleumbarrel # fields, from the winetierce bbl barrel ushogshead 2 liquidbarrel usfirkin 9 usgallon # Dry measures: The Winchester Bushel was defined by William III in 1702 and # legally adopted in the US in 1836. usbushel 2150.42 in^3 # Volume of 8 inch cylinder with 18.5 bu bushel # inch diameter (rounded) peck 1|4 bushel uspeck 1|4 usbushel brpeck 1|4 brbushel pk peck drygallon 1|2 uspeck dryquart 1|4 drygallon drypint 1|2 dryquart drybarrel 7056 in^3 # Used in US for fruits, vegetables, # and other dry commodities except for # cranberries. cranberrybarrel 5826 in^3 # US cranberry barrel heapedbushel 1.278 usbushel# The following explanation for this # value was provided by Wendy Krieger # based on # guesswork. The cylindrical vessel is # 18.5 inches in diameter and 1|2 inch # thick. A heaped bushel includes the # contents of this cylinder plus a heap # on top. The heap is a cone 19.5 # inches in diameter and 6 inches # high. With these values, the volume # of the bushel is 684.5 pi in^3 and # the heap occupies 190.125 pi in^3. # Therefore, the heaped bushel is # 874.625|684.5 bushels. This value is # approximately 1.2777575 and it rounds # to the value listed for the size of # the heaped bushel. Sometimes the # heaped bushel is reported as 1.25 # bushels. This same explanation gives # that value if the heap is taken to # have an 18.5 inch diameter. # Grain measures. The bushel as it is used by farmers in the USA is actually # a measure of mass which varies for different commodities. Canada uses the # same bushel masses for most commodities, but not for oats. wheatbushel 60 lb soybeanbushel 60 lb cornbushel 56 lb ryebushel 56 lb barleybushel 48 lb oatbushel 32 lb ricebushel 45 lb canada_oatbushel 34 lb # Wine and Spirits measure ponyvolume 1 usfloz jigger 1.5 usfloz # Can vary between 1 and 2 usfloz shot jigger # Sometimes 1 usfloz eushot 25 ml # EU standard spirits measure fifth 1|5 usgallon winebottle 750 ml # US industry standard, 1979 winesplit 1|4 winebottle magnum 1.5 liter # Standardized in 1979, but given # as 2 qt in some references metrictenth 375 ml metricfifth 750 ml metricquart 1 liter # Old British bottle size reputedquart 1|6 brgallon reputedpint 1|2 reputedquart brwinebottle reputedquart # Very close to 1|5 winegallon # French champagne bottle sizes split 200 ml jeroboam 2 magnum rehoboam 3 magnum methuselah 4 magnum imperialbottle 4 magnum salmanazar 6 magnum balthazar 8 magnum nebuchadnezzar 10 magnum solomon 12 magnum melchior 12 magnum sovereign 17.5 magnum primat 18 magnum goliath 18 magnum melchizedek 20 magnum midas 20 magnum # The wine glass doesn't seem to have an official standard, but the same value # is suggested by several organization. # https://www.rethinkingdrinking.niaaa.nih.gov/ # http://www.rethinkyourdrinking.ca/what-is-a-standard-drink/ # https://www.drinkaware.co.uk/ # https://www.gov.uk/government/uploads/system/uploads/attachment_data/file/545937/UK_CMOs__report.pdf # http://www.alcohol.gov.au/internet/alcohol/publishing.nsf/content/drinksguide-cnt wineglass 150 mL # the size of a "typical" serving # A unit of alcohol is a specified mass of pure ethyl alcohol. # The term is used officially in the UK, but other countries use the same # concept but with different values. For example, the UK value of 8 g is # nominally the amount of alcohol that a typical adult can metabolize in # one hour. Values for several countries, converted to a volumetric basis: alcoholunitus 14 g / ethanoldensity alcoholunitca 13.6 g / ethanoldensity alcoholunituk 8 g / ethanoldensity alcoholunitau 10 g / ethanoldensity # Example: for 12% ABV (alcohol by volume) # alcoholunitus / 12% = 147.8 mL, close to the “standard” serving of 150 mL. # Coffee # # The recommended ratio of coffee to water. Values vary considerably; # one is from the Specialty Coffee Association of America # http://scaa.org/?page=resources&d=brewing-best-practices coffeeratio 55 g/L # ± 10% # other recommendations are more loose, e.g., # http://www.ncausa.org/About-Coffee/How-to-Brew-Coffee # # Water is "hard" if it contains various minerals, expecially calcium # carbonate. # clarkdegree grains/brgallon # Content by weigh of calcium carbonate gpg grains/usgallon # Divide by water's density to convert to # a dimensionless concentration measure # # Shoe measures # shoeiron 1|48 inch # Used to measure leather in soles shoeounce 1|64 inch # Used to measure non-sole shoe leather # USA shoe sizes. These express the length of the shoe or the length # of the "last", the form that the shoe is made on. But note that # this only captures the length. It appears that widths change 1/4 # inch for each letter within the same size, and if you change the # length by half a size then the width changes between 1/8 inch and # 1/4 inch. But this may not be standard. If you know better, please # contact me. shoesize_delta 1|3 inch # USA shoe sizes differ by this amount shoe_men0 8.25 inch shoe_women0 (7+11|12) inch shoe_boys0 (3+11|12) inch shoe_girls0 (3+7|12) inch shoesize_men(n) units=[1;inch] shoe_men0 + n shoesize_delta ; \ (shoesize_men+(-shoe_men0))/shoesize_delta shoesize_women(n) units=[1;inch] shoe_women0 + n shoesize_delta ; \ (shoesize_women+(-shoe_women0))/shoesize_delta shoesize_boys(n) units=[1;inch] shoe_boys0 + n shoesize_delta ; \ (shoesize_boys+(-shoe_boys0))/shoesize_delta shoesize_girls(n) units=[1;inch] shoe_girls0 + n shoesize_delta ; \ (shoesize_girls+(-shoe_girls0))/shoesize_delta # European shoe size. According to # http://www.shoeline.com/footnotes/shoeterm.shtml # shoe sizes in Europe are measured with Paris points which simply measure # the length of the shoe. europeshoesize 2|3 cm # # USA slang units # buck US$ fin 5 US$ sawbuck 10 US$ usgrand 1000 US$ greenback US$ key kg # usually of marijuana, 60's lid 1 oz # Another 60's weed unit footballfield usfootballfield usfootballfield 100 yards canadafootballfield 110 yards # And 65 yards wide marathon 26 miles + 385 yards # # British # # The length measure in the UK was defined by a bronze bar manufactured in # 1844. Various conversions were sanctioned for convenience at different # times, which makes conversions before 1963 a confusing matter. Apparently # previous conversions were never explicitly revoked. Four different # conversion factors appear below. Multiply them times an imperial length # units as desired. The Weights and Measures Act of 1963 switched the UK away # from their bronze standard and onto a definition of the yard in terms of the # meter. This happened after an international agreement in 1959 to align the # world's measurement systems. UK UKlength_SJJ UK- UK british- UK UKlength_B 0.9143992 meter / yard # Benoit found the yard to be # 0.9143992 m at a weights and # measures conference around # 1896. Legally sanctioned # in 1898. UKlength_SJJ 0.91439841 meter / yard # In 1922, Seers, Jolly and # Johnson found the yard to be # 0.91439841 meters. # Used starting in the 1930's. UKlength_K meter / 39.37079 inch # In 1816 Kater found this ratio # for the meter and inch. This # value was used as the legal # conversion ratio when the # metric system was legalized # for contract in 1864. UKlength_C meter / 1.09362311 yard # In 1866 Clarke found the meter # to be 1.09362311 yards. This # conversion was legalized # around 1878. brnauticalmile 6080 ft # Used until 1970 when the UK brknot brnauticalmile / hr # switched to the international brcable 1|10 brnauticalmile # nautical mile. admiraltymile brnauticalmile admiraltyknot brknot admiraltycable brcable seamile 6000 ft shackle 15 fathoms # Adopted 1949 by British navy # British Imperial weight is mostly the same as US weight. A few extra # units are added here. clove 7 lb stone 14 lb tod 28 lb brquarterweight 1|4 brhundredweight brhundredweight 8 stone longhundredweight brhundredweight longton 20 brhundredweight brton longton # British Imperial volume measures brminim 1|60 brdram brscruple 1|3 brdram fluidscruple brscruple brdram 1|8 brfloz brfluidounce 1|20 brpint brfloz brfluidounce brgill 1|4 brpint brpint 1|2 brquart brquart 1|4 brgallon brgallon 4.54609 l # The British Imperial gallon was # defined in 1824 to be the volume of # water which weighed 10 pounds at 62 # deg F with a pressure of 30 inHg. # It was also defined as 277.274 in^3, # Which is slightly in error. In # 1963 it was defined to be the volume # occupied by 10 pounds of distilled # water of density 0.998859 g/ml weighed # in air of density 0.001217 g/ml # against weights of density 8.136 g/ml. # This gives a value of approximately # 4.5459645 liters, but the old liter # was in force at this time. In 1976 # the definition was changed to exactly # 4.54609 liters using the new # definition of the liter (1 dm^3). brbarrel 36 brgallon # Used for beer brbushel 8 brgallon brheapedbushel 1.278 brbushel brquarter 8 brbushel brchaldron 36 brbushel # Obscure British volume measures. These units are generally traditional # measures whose definitions have fluctuated over the years. Often they # depended on the quantity being measured. They are given here in terms of # British Imperial measures. For example, the puncheon may have historically # been defined relative to the wine gallon or beer gallon or ale gallon # rather than the British Imperial gallon. bag 4 brbushel bucket 4 brgallon kilderkin 2 brfirkin last 40 brbushel noggin brgill pottle 0.5 brgallon pin 4.5 brgallon puncheon 72 brgallon seam 8 brbushel coomb 4 brbushel boll 6 brbushel firlot 1|4 boll brfirkin 9 brgallon # Used for ale and beer cran 37.5 brgallon # measures herring, about 750 fish brwinehogshead 52.5 brgallon # This value is approximately equal brhogshead brwinehogshead # to the old wine hogshead of 63 # wine gallons. This adjustment # is listed in the OED and in # "The Weights and Measures of # England" by R. D. Connor brbeerhogshead 54 brgallon brbeerbutt 2 brbeerhogshead registerton 100 ft^3 # Used for internal capacity of ships shippington 40 ft^3 # Used for ship's cargo freight or timber brshippington 42 ft^3 # freightton shippington # Both register ton and shipping ton derive # from the "tun cask" of wine. displacementton 35 ft^3 # Approximate volume of a longton weight of # sea water. Measures water displaced by # ships. waterton 224 brgallon strike 70.5 l # 16th century unit, sometimes # defined as .5, 2, or 4 bushels # depending on the location. It # probably doesn't make a lot of # sense to define in terms of imperial # bushels. Zupko gives a value of # 2 Winchester grain bushels or about # 70.5 liters. amber 4 brbushel# Used for dry and liquid capacity [18] # British volume measures with "imperial" imperialminim brminim imperialscruple brscruple imperialdram brdram imperialfluidounce brfluidounce imperialfloz brfloz imperialgill brgill imperialpint brpint imperialquart brquart imperialgallon brgallon imperialbarrel brbarrel imperialbushel brbushel imperialheapedbushel brheapedbushel imperialquarter brquarter imperialchaldron brchaldron imperialwinehogshead brwinehogshead imperialhogshead brhogshead imperialbeerhogshead brbeerhogshead imperialbeerbutt brbeerbutt imperialfirkin brfirkin # obscure British lengths barleycorn 1|3 UKinch # Given in Realm of Measure as the # difference between successive shoe sizes nail 1|16 UKyard # Originally the width of the thumbnail, # or 1|16 ft. This took on the general # meaning of 1|16 and settled on the # nail of a yard or 1|16 yards as its # final value. [12] pole 16.5 UKft # This was 15 Saxon feet, the Saxon rope 20 UKft # foot (aka northern foot) being longer englishell 45 UKinch flemishell 27 UKinch ell englishell # supposed to be measure from elbow to # fingertips span 9 UKinch # supposed to be distance from thumb # to pinky with full hand extension goad 4.5 UKft # used for cloth, possibly named after the # stick used for prodding animals. # misc obscure British units hide 120 acre # English unit of land area dating to the 7th # century, originally the amount of land # that a single plowman could cultivate, # which varied from 60-180 acres regionally. # Standardized at Normon conquest. virgate 1|4 hide nook 1|2 virgate rood furlong rod # Area of a strip a rod by a furlong englishcarat troyounce/151.5 # Originally intended to be 4 grain # but this value ended up being # used in the London diamond market mancus 2 oz mast 2.5 lb nailkeg 100 lbs basebox 31360 in^2 # Used in metal plating # alternate spellings gramme gram litre liter dioptre diopter aluminium aluminum sulphur sulfur # # Units derived the human body (may not be very accurate) # geometricpace 5 ft # distance between points where the same # foot hits the ground pace 2.5 ft # distance between points where alternate # feet touch the ground USmilitarypace 30 in # United States official military pace USdoubletimepace 36 in # United States official doubletime pace fingerbreadth 7|8 in # The finger is defined as either the width fingerlength 4.5 in # or length of the finger finger fingerbreadth palmwidth hand # The palm is a unit defined as either the width palmlength 8 in # or the length of the hand hand 4 inch # width of hand shaftment 6 inch # Distance from tip of outstretched thumb to the # opposite side of the palm of the hand. The # ending -ment is from the old English word # for hand. [18] smoot 5 ft + 7 in # Created as part of an MIT fraternity prank. # In 1958 Oliver Smoot was used to measure # the length of the Harvard Bridge, which was # marked off in Smoot lengths. These # markings have been maintained on the bridge # since then and repainted by subsequent # incoming fraternity members. During a # bridge renovation the new sidewalk was # scored every Smoot rather than at the # customary 6 ft spacing. tomcruise 5 ft + 7.75 in # Height of Tom Cruise # # Cooking measures # # Common abbreviations tbl tablespoon tbsp tablespoon tblsp tablespoon Tb tablespoon tsp teaspoon saltspoon 1|4 tsp # US measures uscup 8 usfloz ustablespoon 1|16 uscup usteaspoon 1|3 ustablespoon ustbl ustablespoon ustbsp ustablespoon ustblsp ustablespoon ustsp usteaspoon metriccup 250 ml stickbutter 1|4 lb # Butter in the USA is sold in one # pound packages that contain four # individually wrapped pieces. The # pieces are marked into tablespoons, # making it possible to measure out # butter by volume by slicing the # butter. legalcup 240 ml # The cup used on nutrition labeling legaltablespoon 1|16 legalcup legaltbsp legaltablespoon # Scoop size. Ice cream scoops in the US are marked with numbers # indicating the number of scoops required to fill a US quart. scoop(n) units=[1;cup] domain=[4,100] range=[0.04,1] \ 32 usfloz / n ; 32 usfloz / scoop # US can sizes. number1can 10 usfloz number2can 19 usfloz number2.5can 3.5 uscups number3can 4 uscups number5can 7 uscups number10can 105 usfloz # British measures brcup 1|2 brpint brteacup 1|3 brpint brtablespoon 15 ml # Also 5|8 brfloz, approx 17.7 ml brteaspoon 1|3 brtablespoon # Also 1|4 brtablespoon brdessertspoon 2 brteaspoon dessertspoon brdessertspoon dsp dessertspoon brtsp brteaspoon brtbl brtablespoon brtbsp brtablespoon brtblsp brtablespoon # Australian australiatablespoon 20 ml austbl australiatablespoon austbsp australiatablespoon austblsp australiatablespoon australiateaspoon 1|4 australiatablespoon austsp australiateaspoon # Italian etto 100 g # Used for buying items like meat and etti etto # cheese. # Chinese catty 0.5 kg oldcatty 4|3 lbs # Before metric conversion. tael 1|16 oldcatty # Should the tael be defined both ways? mace 0.1 tael oldpicul 100 oldcatty picul 100 catty # Chinese usage # Indian seer 14400 grain # British Colonial standard ser seer maund 40 seer pakistanseer 1 kg pakistanmaund 40 pakistanseer chittak 1|16 seer tola 1|5 chittak ollock 1|4 liter # Is this right? # Japanese japancup 200 ml # densities of cooking ingredients from The Cake Bible by Rose Levy Beranbaum # so you can convert '2 cups sugar' to grams, for example, or in the other # direction grams could be converted to 'cup flour_scooped'. butter 8 oz/uscup butter_clarified 6.8 oz/uscup cocoa_butter 9 oz/uscup shortening 6.75 oz/uscup # vegetable shortening oil 7.5 oz/uscup cakeflour_sifted 3.5 oz/uscup # The density of flour depends on the cakeflour_spooned 4 oz/uscup # measuring method. "Scooped", or cakeflour_scooped 4.5 oz/uscup # "dip and sweep" refers to dipping a flour_sifted 4 oz/uscup # measure into a bin, and then sweeping flour_spooned 4.25 oz/uscup # the excess off the top. "Spooned" flour_scooped 5 oz/uscup # means to lightly spoon into a measure breadflour_sifted 4.25 oz/uscup # and then sweep the top. Sifted means breadflour_spooned 4.5 oz/uscup # sifting the flour directly into a breadflour_scooped 5.5 oz/uscup # measure and then sweeping the top. cornstarch 120 grams/uscup dutchcocoa_sifted 75 g/uscup # These are for Dutch processed cocoa dutchcocoa_spooned 92 g/uscup dutchcocoa_scooped 95 g/uscup cocoa_sifted 75 g/uscup # These are for nonalkalized cocoa cocoa_spooned 82 g/uscup cocoa_scooped 95 g/uscup heavycream 232 g/uscup milk 242 g/uscup sourcream 242 g/uscup molasses 11.25 oz/uscup cornsyrup 11.5 oz/uscup honey 11.75 oz/uscup sugar 200 g/uscup powdered_sugar 4 oz/uscup brownsugar_light 217 g/uscup # packed brownsugar_dark 239 g/uscup baking_powder 4.6 grams / ustsp salt 6 g / ustsp koshersalt 2.8 g / ustsp # Diamond Crystal kosher salt koshersalt_morton 4.8 g / ustsp # Morton kosher salt # Values are from the nutrition info # on the packages # Egg weights and volumes for a USA large egg egg 50 grams # without shell eggwhite 30 grams eggyolk 18.6 grams eggvolume 3 ustablespoons + 1|2 ustsp eggwhitevolume 2 ustablespoons eggyolkvolume 3.5 ustsp # Alcohol density ethanoldensity 0.7893 g/cm^3 # From CRC Handbook, 91st Edition alcoholdensity ethanoldensity # # Density measures. Density has traditionally been measured on a variety of # bizarre nonlinear scales. # # Density of a sugar syrup is frequently measured in candy making procedures. # In the USA the boiling point of the syrup is measured. Some recipes instead # specify the density using degrees Baume. Conversion between degrees Baume # and the boiling point measure has proved elusive. This table appeared in one # text, and provides a fragmentary relationship to the concentration. # # temp(C) conc (%) # 100 30 # 101 40 # 102 50 # 103 60 # 106 70 # 112 80 # 123 90 # 140 95 # 151 97 # 160 98.2 # 166 99.5 # 171 99.6 # # The best source identified to date came from "Boiling point elevation of # technical sugarcane solutions and its use in automatic pan boiling" by # Michael Saska. International Sugar Journal, 2002, 104, 1247, pp 500-507. # # But I'm using equation (3) which is credited to Starzak and Peacock, # "Water activity coefficient in aqueous solutions of sucrose--A comprehensive # data analysis. Zuckerindustrie, 122, 380-387. (I couldn't find this # document.) # # Note that the range of validity is uncertain, but answers are in agreement # with the above table all the way to 99.6. # # The original equation has a parameter for the boiling point of water, which # of course varies with altitude. It also includes various other model # parameters. The input is the molar concentration of sucrose in the solution, # (moles sucrose) / (total moles). # # Bsp 3797.06 degC # Csp 226.28 degC # QQ -17638 J/mol # asp -1.0038 # bsp -0.24653 # tbw 100 degC # boiling point of water # sugar_bpe_orig(x) ((1-QQ/R Bsp * x^2 (1+asp x + bsp x^2) (tbw + Csp) \ # /(tbw+stdtemp)) / (1+(tbw + Csp)/Bsp *ln(1-x))-1) * (tbw + Csp) # # To convert mass concentration (brix) to molar concentration # # sc(x) (x / 342.3) / (( x/342.3) + (100-x)/18.02); \ # 100 sc 342.3|18.02 / (sc (342.3|18.02-1)+1) # # Here is a simplified version of this equation where the temperature of boiling # water has been fixed at 100 degrees Celsius and the argument is now the # concentration (brix). # # sugar_bpe(x) ((1+ 0.48851085 * sc(x)^2 (1+ -1.0038 sc(x) + -0.24653 sc(x)^2)) \ # / (1+0.08592964 ln(1-sc(x)))-1) 326.28 K # # # The formula is not invertible, so to implement it in units we unfortunately # must turn it into a table. # This table gives the boiling point elevation as a function of the sugar syrup # concentration expressed as a percentage. sugar_conc_bpe[K] \ 0 0.0000 5 0.0788 10 0.1690 15 0.2729 20 0.3936 25 0.5351 \ 30 0.7027 35 0.9036 40 1.1475 42 1.2599 44 1.3825 46 1.5165 \ 48 1.6634 50 1.8249 52 2.0031 54 2.2005 56 2.4200 58 2.6651 \ 60 2.9400 61 3.0902 62 3.2499 63 3.4198 64 3.6010 65 3.7944 \ 66 4.0012 67 4.2227 68 4.4603 69 4.7156 70 4.9905 71 5.2870 \ 72 5.6075 73 5.9546 74 6.3316 75 6.7417 76 7.1892 77 7.6786 \ 78.0 8.2155 79.0 8.8061 80.0 9.4578 80.5 9.8092 81.0 10.1793 \ 81.5 10.5693 82.0 10.9807 82.5 11.4152 83.0 11.8743 83.5 12.3601 \ 84.0 12.8744 84.5 13.4197 85.0 13.9982 85.5 14.6128 86.0 15.2663 \ 86.5 15.9620 87.0 16.7033 87.5 17.4943 88.0 18.3391 88.5 19.2424 \ 89.0 20.2092 89.5 21.2452 90.0 22.3564 90.5 23.5493 91.0 24.8309 \ 91.5 26.2086 92.0 27.6903 92.5 29.2839 93.0 30.9972 93.5 32.8374 \ 94.0 34.8104 94.5 36.9195 95.0 39.1636 95.5 41.5348 96.0 44.0142 \ 96.5 46.5668 97.0 49.1350 97.5 51.6347 98.0 53.9681 98.1 54.4091 \ 98.2 54.8423 98.3 55.2692 98.4 55.6928 98.5 56.1174 98.6 56.5497 \ 98.7 56.9999 98.8 57.4828 98.9 58.0206 99.0 58.6455 99.1 59.4062 \ 99.2 60.3763 99.3 61.6706 99.4 63.4751 99.5 66.1062 99.6 70.1448 \ 99.7 76.7867 # Using the brix table we can use this to produce a mapping from boiling point # to density which makes all of the units interconvertible. Because the brix # table stops at 95 this approach works up to a boiling point elevation of 39 K # or a boiling point of 139 C / 282 F, which is the "soft crack" stage in candy # making. The "hard crack" stage continues up to 310 F. # Boiling point elevation sugar_bpe(T) units=[K;g/cm^3] domain=[0,39.1636] range=[0.99717,1.5144619] \ brix(~sugar_conc_bpe(T)); sugar_conc_bpe(~brix(sugar_bpe)) # Absolute boiling point (produces an absolute temperature) sugar_bp(T) units=[K;g/cm^3] domain=[373.15,412.3136] \ range=[0.99717,1.5144619] \ brix(~sugar_conc_bpe(T-tempC(100))) ;\ sugar_conc_bpe(~brix(sugar_bp))+tempC(100) # In practice dealing with the absolute temperature is annoying because it is # not possible to convert to a nested function, so you're stuck retyping the # absolute temperature in Kelvins to convert to celsius or Fahrenheit. To # prevent this we supply definitions that build in the temperature conversion # and produce results in the Fahrenheit and Celsius scales. So using these # measures, to convert 46 degrees Baume to a Fahrenheit boiling point: # # You have: baume(45) # You want: sugar_bpF # 239.05647 # sugar_bpF(T) units=[1;g/cm^3] domain=[212,282.49448] range=[0.99717,1.5144619]\ brix(~sugar_conc_bpe(tempF(T)+-tempC(100))) ;\ ~tempF(sugar_conc_bpe(~brix(sugar_bpF))+tempC(100)) sugar_bpC(T) units=[1;g/cm^3] domain=[100,139.1636] range=[0.99717,1.5144619]\ brix(~sugar_conc_bpe(tempC(T)+-tempC(100))) ;\ ~tempC(sugar_conc_bpe(~brix(sugar_bpC))+tempC(100)) # Degrees Baume is used in European recipes to specify the density of a sugar # syrup. An entirely different definition is used for densities below # 1 g/cm^3. An arbitrary constant appears in the definition. This value is # equal to 145 in the US, but was according to [], the old scale used in # Holland had a value of 144, and the new scale or Gerlach scale used 146.78. baumeconst 145 # US value baume(d) units=[1;g/cm^3] domain=[0,145) range=[1,) \ (baumeconst/(baumeconst+-d)) g/cm^3 ; \ (baume+((-g)/cm^3)) baumeconst / baume # It's not clear if this value was ever used with negative degrees. twaddell(x) units=[1;g/cm^3] domain=[-200,) range=[0,) \ (1 + 0.005 x) g / cm^3 ; \ 200 (twaddell / (g/cm^3) +- 1) # The degree quevenne is a unit for measuring the density of milk. # Similarly it's unclear if negative values were allowed here. quevenne(x) units=[1;g/cm^3] domain=[-1000,) range=[0,) \ (1 + 0.001 x) g / cm^3 ; \ 1000 (quevenne / (g/cm^3) +- 1) # Degrees brix measures sugar concentration by weigh as a percentage, so a # solution that is 3 degrees brix is 3% sugar by weight. This unit was named # after Adolf Brix who invented a hydrometer that read this percentage # directly. This data is from Table 114 of NIST Circular 440, "Polarimetry, # Saccharimetry and the Sugars". It gives apparent specific gravity at 20 # degrees Celsius of various sugar concentrations. As rendered below this # data is converted to apparent density at 20 degrees Celsius using the # density figure for water given in the same NIST reference. They use the # word "apparent" to refer to measurements being made in air with brass # weights rather than vacuum. brix[0.99717g/cm^3]\ 0 1.00000 1 1.00390 2 1.00780 3 1.01173 4 1.01569 5 1.01968 \ 6 1.02369 7 1.02773 8 1.03180 9 1.03590 10 1.04003 11 1.04418 \ 12 1.04837 13 1.05259 14 1.05683 15 1.06111 16 1.06542 17 1.06976 \ 18 1.07413 19 1.07853 20 1.08297 21 1.08744 22 1.09194 23 1.09647 \ 24 1.10104 25 1.10564 26 1.11027 27 1.11493 28 1.11963 29 1.12436 \ 30 1.12913 31 1.13394 32 1.13877 33 1.14364 34 1.14855 35 1.15350 \ 36 1.15847 37 1.16349 38 1.16853 39 1.17362 40 1.17874 41 1.18390 \ 42 1.18910 43 1.19434 44 1.19961 45 1.20491 46 1.21026 47 1.21564 \ 48 1.22106 49 1.22652 50 1.23202 51 1.23756 52 1.24313 53 1.24874 \ 54 1.25439 55 1.26007 56 1.26580 57 1.27156 58 1.27736 59 1.28320 \ 60 1.28909 61 1.29498 62 1.30093 63 1.30694 64 1.31297 65 1.31905 \ 66 1.32516 67 1.33129 68 1.33748 69 1.34371 70 1.34997 71 1.35627 \ 72 1.36261 73 1.36900 74 1.37541 75 1.38187 76 1.38835 77 1.39489 \ 78 1.40146 79 1.40806 80 1.41471 81 1.42138 82 1.42810 83 1.43486 \ 84 1.44165 85 1.44848 86 1.45535 87 1.46225 88 1.46919 89 1.47616 \ 90 1.48317 91 1.49022 92 1.49730 93 1.50442 94 1.51157 95 1.51876 # Density measure invented by the American Petroleum Institute. Lighter # petroleum products are more valuable, and they get a higher API degree. # # The intervals of range and domain should be open rather than closed. # apidegree(x) units=[1;g/cm^3] domain=[-131.5,) range=[0,) \ 141.5 g/cm^3 / (x+131.5) ; \ 141.5 (g/cm^3) / apidegree + (-131.5) # # Average densities of various woods (dried) # Data from The Wood Database https://www.wood-database.com # # North American Hardwoods wood_cherry 35 lb/ft^3 wood_redoak 44 lb/ft^3 wood_whiteoak 47 lb/ft^3 wood_blackwalnut 38 lb/ft^3 wood_walnut wood_blackwalnut wood_birch 43 lb/ft^3 wood_hardmaple 44 lb/ft^3 wood_bigleafmaple 34 lb/ft^3 wood_boxeldermaple 30 lb/ft^3 wood_redmaple 38 lb/ft^3 wood_silvermaple 33 lb/ft^3 wood_stripedmaple 32 lb/ft^3 wood_softmaple (wood_bigleafmaple \ + wood_boxeldermaple \ + wood_redmaple \ + wood_silvermaple \ + wood_stripedmaple) / 5 wood_poplar 29 lb/ft^3 wood_beech 45 lb/ft^3 # North American Softwoods wood_jeffreypine 28 lb/ft^3 wood_ocotepine 44 lb/ft^3 wood_ponderosapine 28 lb/ft^3 wood_loblollypine 35 lb/ft^3 wood_longleafpine 41 lb/ft^3 wood_shortleafpine 35 lb/ft^3 wood_slashpine 41 lb/ft^3 wood_yellowpine (wood_loblollypine \ + wood_longleafpine \ + wood_shortleafpine \ + wood_slashpine) / 4 wood_redpine 34 lb/ft^3 wood_easternwhitepine 25 lb/ft^3 wood_westernwhitepine 27 lb/ft^3 wood_whitepine (wood_easternwhitepine + wood_westernwhitepine) / 2 wood_douglasfir 32 lb/ft^3 wood_blackspruce 28 lb/ft^3 wood_engelmannspruce 24 lb/ft^3 wood_redspruce 27 lb/ft^3 wood_sitkaspruce 27 lb/ft^3 wood_whitespruce 27 lb/ft^3 wood_spruce (wood_blackspruce \ + wood_engelmannspruce \ + wood_redspruce \ + wood_sitkaspruce \ + wood_whitespruce) / 5 # Other woods wood_basswood 26 lb/ft^3 wood_balsa 9 lb/ft^3 wood_ebony_gaboon 60 lb/ft^3 wood_ebony_macassar 70 lb/ft^3 wood_mahogany 37 lb/ft^3 # True (Honduran) mahogany, # Swietenia macrophylla wood_teak 41 lb/ft^3 wood_rosewood_brazilian 52 lb/ft^3 wood_rosewood_honduran 64 lb/ft^3 wood_rosewood_indian 52 lb/ft^3 wood_cocobolo 69 lb/ft^3 wood_bubinga 56 lb/ft^3 wood_zebrawood 50 lb/ft^3 wood_koa 38 lb/ft^3 wood_snakewood 75.7 lb/ft^3 wood_lignumvitae 78.5 lb/ft^3 wood_blackwood 79.3 lb/ft^3 wood_blackironwood 84.5 lb/ft^3 # Krugiodendron ferreum, listed # in database as the heaviest wood # # Modulus of elasticity of selected woods. # Data from The Wood Database https://www.wood-database.com # # North American Hardwoods wood_mod_beech 1.720e6 lbf/in^2 wood_mod_birchyellow 2.010e6 lbf/in^2 wood_mod_birch wood_mod_birchyellow wood_mod_cherry 1.490e6 lbf/in^2 wood_mod_hardmaple 1.830e6 lbf/in^2 wood_mod_bigleafmaple 1.450e6 lbf/in^2 wood_mod_boxeldermaple 1.050e6 lbf/in^2 wood_mod_redmaple 1.640e6 lbf/in^2 wood_mod_silvermaple 1.140e6 lbf/in^2 wood_mod_softmaple (wood_mod_bigleafmaple \ + wood_mod_boxeldermaple \ + wood_mod_redmaple \ + wood_mod_silvermaple) / 4 wood_mod_redoak 1.761e6 lbf/in^2 wood_mod_whiteoak 1.762e6 lbf/in^2 wood_mod_poplar 1.580e6 lbf/in^2 wood_mod_blackwalnut 1.680e6 lbf/in^2 wood_mod_walnut wood_mod_blackwalnut # North American Softwoods wood_mod_jeffreypine 1.240e6 lbf/in^2 wood_mod_ocotepine 2.209e6 lbf/in^2 wood_mod_ponderosapine 1.290e6 lbf/in^2 wood_mod_loblollypine 1.790e6 lbf/in^2 wood_mod_longleafpine 1.980e6 lbf/in^2 wood_mod_shortleafpine 1.750e6 lbf/in^2 wood_mod_slashpine 1.980e6 lbf/in^2 wood_mod_yellowpine (wood_mod_loblollypine \ + wood_mod_longleafpine \ + wood_mod_shortleafpine \ + wood_mod_slashpine) / 4 wood_mod_redpine 1.630e6 lbf/in^2 wood_mod_easternwhitepine 1.240e6 lbf/in^2 wood_mod_westernwhitepine 1.460e6 lbf/in^2 wood_mod_whitepine (wood_mod_easternwhitepine + \ wood_mod_westernwhitepine) / 2 wood_mod_douglasfir 1.765e6 lbf/in^2 wood_mod_blackspruce 1.523e6 lbf/in^2 wood_mod_englemannspruce 1.369e6 lbf/in^2 wood_mod_redspruce 1.560e6 lbf/in^2 wood_mod_sitkaspruce 1.600e6 lbf/in^2 wood_mod_whitespruce 1.315e6 lbf/in^2 wood_mod_spruce (wood_mod_blackspruce \ + wood_mod_englemannspruce \ + wood_mod_redspruce + wood_mod_sitkaspruce \ + wood_mod_whitespruce) / 5 # Other woods wood_mod_balsa 0.538e6 lbf/in^2 wood_mod_basswood 1.460e6 lbf/in^2 wood_mod_blackwood 2.603e6 lbf/in^2 # African, Dalbergia melanoxylon wood_mod_bubinga 2.670e6 lbf/in^2 wood_mod_cocobolo 2.712e6 lbf/in^2 wood_mod_ebony_gaboon 2.449e6 lbf/in^2 wood_mod_ebony_macassar 2.515e6 lbf/in^2 wood_mod_blackironwood 2.966e6 lbf/in^2 # Krugiodendron ferreum wood_mod_koa 1.503e6 lbf/in^2 wood_mod_lignumvitae 2.043e6 lbf/in^2 wood_mod_mahogany 1.458e6 lbf/in^2 # True (Honduran) mahogany, # Swietenia macrophylla wood_mod_rosewood_brazilian 2.020e6 lbf/in^2 wood_mod_rosewood_honduran 3.190e6 lbf/in^2 wood_mod_rosewood_indian 1.668e6 lbf/in^2 wood_mod_snakewood 3.364e6 lbf/in^2 wood_mod_teak 1.781e6 lbf/in^2 wood_mod_zebrawood 2.374e6 lbf/in^2 # # Area of countries and other regions. This is the "total area" which # includes land and water areas within international boundaries and # coastlines. Data from January, 2019. # # except as noted, sources are # https://en.wikipedia.org/wiki/List_of_countries_and_dependencies_by_area # https://www.cia.gov/library/publications/the-world-factbook) area_russia 17098246 km^2 area_antarctica 14000000 km^2 # area_canada is covered below as sum of province and territory areas area_china 9596961 km^2 # area_unitedstates is covered below as sum of state areas # includes only the 50 states and District of Columbia area_us area_unitedstates area_brazil 8515767 km^2 area_australia 7692024 km^2 # area_europeanunion is covered below as sum of member areas area_india 3287263 km^2 area_argentina 2780400 km^2 area_kazakhstan 2724900 km^2 area_algeria 2381741 km^2 area_drcongo 2344858 km^2 area_greenland 2166086 km^2 area_saudiarabia 2149690 km^2 area_mexico 1964375 km^2 area_indonesia 1910931 km^2 area_sudan 1861484 km^2 area_libya 1759540 km^2 area_iran 1648195 km^2 area_mongolia 1564110 km^2 area_peru 1285216 km^2 area_chad 1284000 km^2 area_niger 1267000 km^2 area_angola 1246700 km^2 area_mali 1240192 km^2 area_southafrica 1221037 km^2 area_colombia 1141748 km^2 area_ethiopia 1104300 km^2 area_bolivia 1098581 km^2 area_mauritania 1030700 km^2 area_egypt 1002450 km^2 area_tanzania 945087 km^2 area_nigeria 923768 km^2 area_venezuela 916445 km^2 area_pakistan 881912 km^2 area_namibia 825615 km^2 area_mozambique 801590 km^2 area_turkey 783562 km^2 area_chile 756102 km^2 area_zambia 752612 km^2 area_myanmar 676578 km^2 area_burma area_myanmar area_afghanistan 652230 km^2 area_southsudan 644329 km^2 area_france 640679 km^2 area_somalia 637657 km^2 area_centralafrica 622984 km^2 area_ukraine 603500 km^2 area_crimea 27000 km^2 # occupied by Russia; included in # (Encyclopedia Britannica) area_madagascar 587041 km^2 area_botswana 581730 km^2 area_kenya 580367 km^2 area_yemen 527968 km^2 area_thailand 513120 km^2 area_spain 505992 km^2 area_turkmenistan 488100 km^2 area_cameroon 475422 km^2 area_papuanewguinea 462840 km^2 area_sweden 450295 km^2 area_uzbekistan 447400 km^2 area_morocco 446550 km^2 area_iraq 438317 km^2 area_paraguay 406752 km^2 area_zimbabwe 390757 km^2 area_japan 377973 km^2 area_germany 357114 km^2 area_congorepublic 342000 km^2 area_finland 338424 km^2 area_vietnam 331212 km^2 area_malaysia 330803 km^2 area_norway 323802 km^2 area_ivorycoast 322463 km^2 area_poland 312696 km^2 area_oman 309500 km^2 area_italy 301339 km^2 area_philippines 300000 km^2 area_ecuador 276841 km^2 area_burkinafaso 274222 km^2 area_newzealand 270467 km^2 area_gabon 267668 km^2 area_westernsahara 266000 km^2 area_guinea 245857 km^2 # area_unitedkingdom is covered below area_uganda 241550 km^2 area_ghana 238533 km^2 area_romania 238397 km^2 area_laos 236800 km^2 area_guyana 214969 km^2 area_belarus 207600 km^2 area_kyrgyzstan 199951 km^2 area_senegal 196722 km^2 area_syria 185180 km^2 area_golanheights 1150 km^2 # occupied by Israel; included in # Syria (Encyclopedia Britannica) area_cambodia 181035 km^2 area_uruguay 176215 km^2 area_somaliland 176120 km^2 area_suriname 163820 km^2 area_tunisia 163610 km^2 area_bangladesh 147570 km^2 area_nepal 147181 km^2 area_tajikistan 143100 km^2 area_greece 131990 km^2 area_nicaragua 130373 km^2 area_northkorea 120540 km^2 area_malawi 118484 km^2 area_eritrea 117600 km^2 area_benin 114763 km^2 area_honduras 112492 km^2 area_liberia 111369 km^2 area_bulgaria 110879 km^2 area_cuba 109884 km^2 area_guatemala 108889 km^2 area_iceland 103000 km^2 area_southkorea 100210 km^2 area_hungary 93028 km^2 area_portugal 92090 km^2 area_jordan 89342 km^2 area_serbia 88361 km^2 area_azerbaijan 86600 km^2 area_austria 83871 km^2 area_uae 83600 km^2 area_czechia 78865 km^2 area_czechrepublic area_czechia area_panama 75417 km^2 area_sierraleone 71740 km^2 area_ireland 70273 km^2 area_georgia 69700 km^2 area_srilanka 65610 km^2 area_lithuania 65300 km^2 area_latvia 64559 km^2 area_togo 56785 km^2 area_croatia 56594 km^2 area_bosnia 51209 km^2 area_costarica 51100 km^2 area_slovakia 49037 km^2 area_dominicanrepublic 48671 km^2 area_estonia 45227 km^2 area_denmark 43094 km^2 area_netherlands 41850 km^2 area_switzerland 41284 km^2 area_bhutan 38394 km^2 area_taiwan 36193 km^2 area_guineabissau 36125 km^2 area_moldova 33846 km^2 area_belgium 30528 km^2 area_lesotho 30355 km^2 area_armenia 29743 km^2 area_solomonislands 28896 km^2 area_albania 28748 km^2 area_equitorialguinea 28051 km^2 area_burundi 27834 km^2 area_haiti 27750 km^2 area_rwanda 26338 km^2 area_northmacedonia 25713 km^2 area_djibouti 23200 km^2 area_belize 22966 km^2 area_elsalvador 21041 km^2 area_israel 20770 km^2 area_slovenia 20273 km^2 area_fiji 18272 km^2 area_kuwait 17818 km^2 area_eswatini 17364 km^2 area_easttimor 14919 km^2 area_bahamas 13943 km^2 area_montenegro 13812 km^2 area_vanatu 12189 km^2 area_qatar 11586 km^2 area_gambia 11295 km^2 area_jamaica 10991 km^2 area_kosovo 10887 km^2 area_lebanon 10452 km^2 area_cyprus 9251 km^2 area_puertorico 9104 km^2 # United States territory; not included # in United States area area_westbank 5860 km^2 # (CIA World Factbook) area_hongkong 2755 km^2 area_luxembourg 2586 km^2 area_singapore 716 km^2 area_gazastrip 360 km^2 # (CIA World Factbook) area_malta 316 km^2 # smallest EU country area_liechtenstein 160 km^2 area_monaco 2.02 km^2 area_vaticancity 0.44 km^2 # Members as of 1 Feb 2020 area_europeanunion area_austria + area_belgium + area_bulgaria \ + area_croatia + area_cyprus + area_czechia + area_denmark \ + area_estonia + area_finland + area_france + area_germany \ + area_greece + area_hungary + area_ireland + area_italy \ + area_latvia + area_lithuania + area_luxembourg \ + area_malta + area_netherlands + area_poland \ + area_portugal + area_romania + area_slovakia \ + area_slovenia + area_spain + area_sweden area_eu area_europeanunion # # Areas of the individual US states # # https://en.wikipedia.org/wiki/List_of_U.S._states_and_territories_by_area # # United States Summary: 2010, Population and Housing Unit Counts, Table 18, p. 41 # Issued September 2012 area_alaska 1723336.8 km^2 area_texas 695661.6 km^2 area_california 423967.4 km^2 area_montana 380831.1 km^2 area_newmexico 314917.4 km^2 area_arizona 295233.5 km^2 area_nevada 286379.7 km^2 area_colorado 269601.4 km^2 area_oregon 254799.2 km^2 area_wyoming 253334.5 km^2 area_michigan 250486.8 km^2 area_minnesota 225162.8 km^2 area_utah 219881.9 km^2 area_idaho 216442.6 km^2 area_kansas 213100.0 km^2 area_nebraska 200329.9 km^2 area_southdakota 199728.7 km^2 area_washington 184660.8 km^2 area_northdakota 183107.8 km^2 area_oklahoma 181037.2 km^2 area_missouri 180540.3 km^2 area_florida 170311.7 km^2 area_wisconsin 169634.8 km^2 area_georgia_us 153910.4 km^2 area_illinois 149995.4 km^2 area_iowa 145745.9 km^2 area_newyork 141296.7 km^2 area_northcarolina 139391.0 km^2 area_arkansas 137731.8 km^2 area_alabama 135767.4 km^2 area_louisiana 135658.7 km^2 area_mississippi 125437.7 km^2 area_pennsylvania 119280.2 km^2 area_ohio 116097.7 km^2 area_virginia 110786.6 km^2 area_tennessee 109153.1 km^2 area_kentucky 104655.7 km^2 area_indiana 94326.2 km^2 area_maine 91633.1 km^2 area_southcarolina 82932.7 km^2 area_westvirginia 62755.5 km^2 area_maryland 32131.2 km^2 area_hawaii 28313.0 km^2 area_massachusetts 27335.7 km^2 area_vermont 24906.3 km^2 area_newhampshire 24214.2 km^2 area_newjersey 22591.4 km^2 area_connecticut 14357.4 km^2 area_delaware 6445.8 km^2 area_rhodeisland 4001.2 km^2 area_districtofcolumbia 177.0 km^2 area_unitedstates area_alabama + area_alaska + area_arizona \ + area_arkansas + area_california + area_colorado \ + area_connecticut + area_delaware \ + area_districtofcolumbia + area_florida \ + area_georgia_us + area_hawaii + area_idaho \ + area_illinois + area_indiana + area_iowa \ + area_kansas + area_kentucky + area_louisiana \ + area_maine + area_maryland + area_massachusetts \ + area_michigan + area_minnesota + area_mississippi \ + area_missouri + area_montana + area_nebraska \ + area_nevada + area_newhampshire + area_newjersey \ + area_newmexico + area_newyork + area_northcarolina \ + area_northdakota + area_ohio + area_oklahoma \ + area_oregon + area_pennsylvania + area_rhodeisland \ + area_southcarolina + area_southdakota \ + area_tennessee + area_texas + area_utah \ + area_vermont + area_virginia + area_washington \ + area_westvirginia + area_wisconsin + area_wyoming # Total area of Canadian province and territories # # Statistics Canada, "Land and freshwater area, by province and territory", # 2016-10-07: # # https://www150.statcan.gc.ca/n1/pub/11-402-x/2012000/chap/geo/tbl/tbl06-eng.htm area_ontario 1076395 km^2 # confederated 1867-Jul-01 area_quebec 1542056 km^2 # confederated 1867-Jul-01 area_novascotia 55284 km^2 # confederated 1867-Jul-01 area_newbrunswick 72908 km^2 # confederated 1867-Jul-01 area_canada_original area_ontario + area_quebec + area_novascotia \ + area_newbrunswick area_manitoba 647797 km^2 # confederated 1870-Jul-15 area_britishcolumbia 944735 km^2 # confederated 1871-Jul-20 area_princeedwardisland 5660 km^2 # confederated 1873-Jul-01 area_canada_additional area_manitoba + area_britishcolumbia \ + area_princeedwardisland area_alberta 661848 km^2 # confederated 1905-Sep-01 area_saskatchewan 651036 km^2 # confederated 1905-Sep-01 area_newfoundlandandlabrador 405212 km^2 # confederated 1949-Mar-31 area_canada_recent area_alberta + area_saskatchewan \ + area_newfoundlandandlabrador area_canada_provinces area_canada_original + area_canada_additional \ + area_canada_recent area_northwestterritories 1346106 km^2 # NT confederated 1870-Jul-15 area_yukon 482443 km^2 # YT confederated 1898-Jun-13 area_nunavut 2093190 km^2 # NU confederated 1999-Apr-01 area_canada_territories area_northwestterritories + area_yukon \ + area_nunavut area_canada area_canada_provinces + area_canada_territories # area-uk-countries.units - UK country (/province) total areas # https://en.wikipedia.org/wiki/Countries_of_the_United_Kingdom#Statistics # GB is official UK country code for some purposes but internally is a Kingdom # # areas from A Beginners Guide to UK Geography 2019 v1.0, Office for National Statistics # England: country; 0927-Jul-12 united; 1603-Mar-24 union of crowns area_england 132947.76 km^2 # # Wales: 1282 conquered; 1535 union; principality until 2011 area_wales 21224.48 km^2 # # England and Wales: nation; 1535 union area_englandwales area_england + area_wales # # Scotland: country; ~900 united; 1603-Mar-24 union of crowns area_scotland 80226.36 km^2 # # Great Britain: kingdom; excludes NI; # 1707 Treaty and Acts of Union: union of parliaments area_greatbritain area_england + area_wales + area_scotland area_gb area_greatbritain # # Northern Ireland: province; Ireland: 1177 Henry II lordship; # 1542 Henry VIII kingdom; 1652 Cromwell commonwealth; # 1691 William III kingdom; 1800 Acts of Union: UK of GB & Ireland; # 1921 Irish Free State independent of UK area_northernireland 14133.38 km^2 # # United Kingdom of GB & NI: 1800 Acts of Union: UK of GB & Ireland; # 1921 Irish Free State independent of UK area_unitedkingdom area_greatbritain + area_northernireland area_uk area_unitedkingdom # # Units derived from imperial system # ouncedal oz ft / s^2 # force which accelerates an ounce # at 1 ft/s^2 poundal lb ft / s^2 # same thing for a pound tondal longton ft / s^2 # and for a ton pdl poundal osi ounce force / inch^2 # used in aviation psi pound force / inch^2 psia psi # absolute pressure # Note that gauge pressure can be given # using the gaugepressure() and # psig() nonlinear unit definitions tsi ton force / inch^2 reyn psi sec slug lbf s^2 / ft slugf slug force slinch lbf s^2 / inch # Mass unit derived from inch second slinchf slinch force # pound-force system. Used in space # applications where in/sec^2 was a # natural acceleration measure. geepound slug lbf lb force tonf ton force lbm lb kip 1000 lbf # from kilopound ksi kip / in^2 mil 0.001 inch thou 0.001 inch tenth 0.0001 inch # one tenth of one thousandth of an inch millionth 1e-6 inch # one millionth of an inch circularinch 1|4 pi in^2 # area of a one-inch diameter circle circleinch circularinch # A circle with diameter d inches has # an area of d^2 circularinches cylinderinch circleinch inch # Cylinder h inch tall, d inches diameter # has volume d^2 h cylinder inches circularmil 1|4 pi mil^2 # area of one-mil diameter circle cmil circularmil cental 100 pound centner cental caliber 0.01 inch # for measuring bullets duty ft lbf celo ft / s^2 jerk ft / s^3 australiapoint 0.01 inch # The "point" is used to measure rainfall # in Australia sabin ft^2 # Measure of sound absorption equal to the # absorbing power of one square foot of # a perfectly absorbing material. The # sound absorptivity of an object is the # area times a dimensionless # absorptivity coefficient. standardgauge 4 ft + 8.5 in # Standard width between railroad track flag 5 ft^2 # Construction term referring to sidewalk. rollwallpaper 30 ft^2 # Area of roll of wall paper fillpower in^3 / ounce # Density of down at standard pressure. # The best down has 750-800 fillpower. pinlength 1|16 inch # A #17 pin is 17/16 in long in the USA. buttonline 1|40 inch # The line was used in 19th century USA # to measure width of buttons. beespace 1|4 inch # Bees will fill any space that is smaller # than the bee space and leave open # spaces that are larger. The size of # the space varies with species. diamond 8|5 ft # Marking on US tape measures that is # useful to carpenters who wish to place # five studs in an 8 ft distance. Note # that the numbers appear in red every # 16 inches as well, giving six # divisions in 8 feet. retmaunit 1.75 in # Height of rack mountable equipment. U retmaunit # Equipment should be 1|32 inch narrower RU U # than its U measurement indicates to # allow for clearance, so 4U=(6+31|32)in # RETMA stands for the former name of # the standardizing organization, Radio # Electronics Television Manufacturers # Association. This organization is now # called the Electronic Industries # Alliance (EIA) and the rack standard # is specified in EIA RS-310-D. count per pound # For measuring the size of shrimp flightlevel 100 ft # Flight levels are used to ensure safe FL flightlevel # vertical separation between aircraft # despite variations in local air # pressure. Flight levels define # altitudes based on a standard air # pressure so that altimeter calibration # is not needed. This means that # aircraft at separated flight levels # are guaranteed to be separated. # Hence the definition of 100 feet is # a nominal, not true, measure. # Customarily written with no space in # the form FL290, which will not work in # units. But note "FL 290" will work. # # Other units of work, energy, power, etc # # Calorie: approximate energy to raise a gram of water one degree celsius calorie cal_th # Default is the thermochemical calorie cal calorie calorie_th 4.184 J # Thermochemical calorie, defined in 1930 thermcalorie calorie_th # by Frederick Rossini as 4.1833 J to cal_th calorie_th # avoid difficulties associated with the # uncertainty in the heat capacity of # water. In 1948 the value of the joule # was changed, so the thermochemical # calorie was redefined to 4.184 J. # This kept the energy measured by this # unit the same. calorie_IT 4.1868 J # International (Steam) Table calorie, cal_IT calorie_IT # defined in 1929 as watt-hour/860 or # equivalently 180|43 joules. At this # time the international joule had a # different value than the modern joule, # and the values were different in the # USA and in Europe. In 1956 at the # Fifth International Conference on # Properties of Steam the exact # definition given here was adopted. calorie_15 4.18580 J # Energy to go from 14.5 to 15.5 degC cal_15 calorie_15 calorie_fifteen cal_15 calorie_20 4.18190 J # Energy to go from 19.5 to 20.5 degC cal_20 calorie_20 calorie_twenty calorie_20 calorie_4 4.204 J # Energy to go from 3.5 to 4.5 degC cal_4 calorie_4 calorie_four calorie_4 cal_mean 4.19002 J # 1|100 energy to go from 0 to 100 degC Calorie kilocalorie # the food Calorie thermie 1e6 cal_15 # Heat required to raise the # temperature of a tonne of # water from 14.5 to 15.5 degC. # btu definitions: energy to raise a pound of water 1 degF btu btu_IT # International Table BTU is the default britishthermalunit btu btu_IT cal_IT lb degF / gram K btu_th cal_th lb degF / gram K btu_mean cal_mean lb degF / gram K btu_15 cal_15 lb degF / gram K btu_ISO 1055.06 J # Exact, rounded ISO definition based # on the IT calorie quad quadrillion btu ECtherm 1e5 btu_ISO # Exact definition UStherm 1.054804e8 J # Exact definition, therm UStherm # Water latent heat from [23] water_fusion_heat 6.01 kJ/mol / (18.015 g/mol) # At 0 deg C water_vaporization_heat 2256.4 J/g # At saturation, 100 deg C, 101.42 kPa # Specific heat capacities of various substances specificheat_water calorie / g K water_specificheat specificheat_water # Values from www.engineeringtoolbox.com/specific-heat-metals-d_152.html specificheat_aluminum 0.91 J/g K specificheat_antimony 0.21 J/g K specificheat_barium 0.20 J/g K specificheat_beryllium 1.83 J/g K specificheat_bismuth 0.13 J/g K specificheat_cadmium 0.23 J/g K specificheat_cesium 0.24 J/g K specificheat_chromium 0.46 J/g K specificheat_cobalt 0.42 J/g K specificheat_copper 0.39 J/g K specificheat_gallium 0.37 J/g K specificheat_germanium 0.32 J/g K specificheat_gold 0.13 J/g K specificheat_hafnium 0.14 J/g K specificheat_indium 0.24 J/g K specificheat_iridium 0.13 J/g K specificheat_iron 0.45 J/g K specificheat_lanthanum 0.195 J/g K specificheat_lead 0.13 J/g K specificheat_lithium 3.57 J/g K specificheat_lutetium 0.15 J/g K specificheat_magnesium 1.05 J/g K specificheat_manganese 0.48 J/g K specificheat_mercury 0.14 J/g K specificheat_molybdenum 0.25 J/g K specificheat_nickel 0.44 J/g K specificheat_osmium 0.13 J/g K specificheat_palladium 0.24 J/g K specificheat_platinum 0.13 J/g K specificheat_plutonum 0.13 J/g K specificheat_potassium 0.75 J/g K specificheat_rhenium 0.14 J/g K specificheat_rhodium 0.24 J/g K specificheat_rubidium 0.36 J/g K specificheat_ruthenium 0.24 J/g K specificheat_scandium 0.57 J/g K specificheat_selenium 0.32 J/g K specificheat_silicon 0.71 J/g K specificheat_silver 0.23 J/g K specificheat_sodium 1.21 J/g K specificheat_strontium 0.30 J/g K specificheat_tantalum 0.14 J/g K specificheat_thallium 0.13 J/g K specificheat_thorium 0.13 J/g K specificheat_tin 0.21 J/g K specificheat_titanium 0.54 J/g K specificheat_tungsten 0.13 J/g K specificheat_uranium 0.12 J/g K specificheat_vanadium 0.39 J/g K specificheat_yttrium 0.30 J/g K specificheat_zinc 0.39 J/g K specificheat_zirconium 0.27 J/g K specificheat_ethanol 2.3 J/g K specificheat_ammonia 4.6 J/g K specificheat_freon 0.91 J/g K # R-12 at 0 degrees Fahrenheit specificheat_gasoline 2.22 J/g K specificheat_iodine 2.15 J/g K specificheat_oliveoil 1.97 J/g K # en.wikipedia.org/wiki/Heat_capacity#Table_of_specific_heat_capacities specificheat_hydrogen 14.3 J/g K specificheat_helium 5.1932 J/g K specificheat_argon 0.5203 J/g K specificheat_tissue 3.5 J/g K specificheat_diamond 0.5091 J/g K specificheat_granite 0.79 J/g K specificheat_graphite 0.71 J/g K specificheat_ice 2.11 J/g K specificheat_asphalt 0.92 J/g K specificheat_brick 0.84 J/g K specificheat_concrete 0.88 J/g K specificheat_glass_silica 0.84 J/g K specificheat_glass_flint 0.503 J/g K specificheat_glass_pyrex 0.753 J/g K specificheat_gypsum 1.09 J/g K specificheat_marble 0.88 J/g K specificheat_sand 0.835 J/g K specificheat_soil 0.835 J/g K specificheat_wood 1.7 J/g K specificheat_sucrose 1.244 J/g K #www.sugartech.co.za/heatcapacity/index.php # Energy densities of various fuels # # Most of these fuels have varying compositions or qualities and hence their # actual energy densities vary. These numbers are hence only approximate. # # E1. http://bioenergy.ornl.gov/papers/misc/energy_conv.html # E2. http://www.aps.org/policy/reports/popa-reports/energy/units.cfm # E3. http://www.ior.com.au/ecflist.html tonoil 1e10 cal_IT # Ton oil equivalent. A conventional # value for the energy released by toe tonoil # burning one metric ton of oil. [18,E2] # Note that energy per mass of petroleum # products is fairly constant. # Variations in volumetric energy # density result from variations in the # density (kg/m^3) of different fuels. # This definition is given by the # IEA/OECD. toncoal 7e9 cal_IT # Energy in metric ton coal from [18]. # This is a nominal value which # is close to the heat content # of coal used in the 1950's barreloil 5.8 Mbtu # Conventional value for barrel of crude # oil [E2]. Actual range is 5.6 - 6.3. naturalgas_HHV 1027 btu/ft3 # Energy content of natural gas. HHV naturalgas_LHV 930 btu/ft3 # is for Higher Heating Value and naturalgas naturalgas_HHV # includes energy from condensation # combustion products. LHV is for Lower # Heating Value and excludes these. # American publications typically report # HHV whereas European ones report LHV. charcoal 30 GJ/tonne woodenergy_dry 20 GJ/tonne # HHV, a cord weights about a tonne woodenergy_airdry 15 GJ/tonne # 20% moisture content coal_bituminous 27 GJ / tonne coal_lignite 15 GJ / tonne coal_US 22 GJ / uston # Average for US coal (short ton), 1995 ethanol_HHV 84000 btu/usgallon ethanol_LHV 75700 btu/usgallon diesel 130500 btu/usgallon gasoline_LHV 115000 btu/usgallon gasoline_HHV 125000 btu/usgallon gasoline gasoline_HHV heating 37.3 MJ/liter fueloil 39.7 MJ/liter # low sulphur propane 93.3 MJ/m^3 butane 124 MJ/m^3 # These values give total energy from uranium fission. Actual efficiency # of nuclear power plants is around 30%-40%. Note also that some reactors # use enriched uranium around 3% U-235. Uranium during processing or use # may be in a compound of uranium oxide or uranium hexafluoride, in which # case the energy density would be lower depending on how much uranium is # in the compound. uranium_pure 200 MeV avogadro / (235.0439299 g/mol) # Pure U-235 uranium_natural 0.7% uranium_pure # Natural uranium: 0.7% U-235 # Celsius heat unit: energy to raise a pound of water 1 degC celsiusheatunit cal lb degC / gram K chu celsiusheatunit # "Apparent" average power in an AC circuit, the product of rms voltage # and rms current, equal to the true power in watts when voltage and # current are in phase. In a DC circuit, always equal to the true power. VA volt ampere kWh kilowatt hour # The horsepower is supposedly the power of one horse pulling. Obviously # different people had different horses. horsepower 550 foot pound force / sec # Invented by James Watt mechanicalhorsepower horsepower hp horsepower metrichorsepower 75 kilogram force meter / sec # PS=Pferdestaerke in electrichorsepower 746 W # Germany boilerhorsepower 9809.50 W waterhorsepower 746.043 W brhorsepower horsepower # Value corrected Dec, 2019. Was 745.7 W. donkeypower 250 W chevalvapeur metrichorsepower # # Heat Transfer # # Thermal conductivity, K, measures the rate of heat transfer across # a material. The heat transfered is # Q = K dT A t / L # where dT is the temperature difference across the material, A is the # cross sectional area, t is the time, and L is the length (thickness). # Thermal conductivity is a material property. THERMAL_CONDUCTIVITY POWER / AREA (TEMPERATURE_DIFFERENCE/LENGTH) THERMAL_RESISTIVITY 1/THERMAL_CONDUCTIVITY # Thermal conductance is the rate at which heat flows across a given # object, so the area and thickness have been fixed. It depends on # the size of the object and is hence not a material property. THERMAL_CONDUCTANCE POWER / TEMPERATURE_DIFFERENCE THERMAL_RESISTANCE 1/THERMAL_CONDUCTANCE # Thermal admittance is the rate of heat flow per area across an # object whose thickness has been fixed. Its reciprocal, thermal # insulation, is used to for measuring the heat transfer per area # of sheets of insulation or cloth that are of specified thickness. THERMAL_ADMITTANCE THERMAL_CONDUCTIVITY / LENGTH THERMAL_INSULANCE THERMAL_RESISTIVITY LENGTH THERMAL_INSULATION THERMAL_RESISTIVITY LENGTH Rvalue degF ft^2 hr / btu Uvalue 1/Rvalue europeanUvalue watt / m^2 K RSI degC m^2 / W clo 0.155 degC m^2 / W # Supposed to be the insulance # required to keep a resting person # comfortable indoors. The value # given is from NIST and the CRC, # but [5] gives a slightly different # value of 0.875 ft^2 degF hr / btu. tog 0.1 degC m^2 / W # Also used for clothing. # Thermal Conductivity of a few materials diamond_natural_thermal_conductivity 2200 W / m K diamond_synthetic_thermal_conductivity 3320 W / m K # 99% pure C12 silver_thermal_conductivity 406 W / m K aluminum_thermal_conductivity 205 W / m K copper_thermal_conductivity 385 W / m K gold_thermal_conductivity 314 W / m K iron_thermal_conductivity 79.5 W / m K stainless_304_thermal_conductivity 15.5 W / m K # average value # The bel was defined by engineers of Bell Laboratories to describe the # reduction in audio level over a length of one mile. It was originally # called the transmission unit (TU) but was renamed around 1923 to honor # Alexander Graham Bell. The bel proved inconveniently large so the decibel # has become more common. The decibel is dimensionless since it reports a # ratio, but it is used in various contexts to report a signal's power # relative to some reference level. bel(x) units=[1;1] range=(0,) 10^(x); log(bel) # Basic bel definition decibel(x) units=[1;1] range=(0,) 10^(x/10); 10 log(decibel) # Basic decibel dB() decibel # Abbreviation dBW(x) units=[1;W] range=(0,) dB(x) W ; ~dB(dBW/W) # Reference = 1 W dBk(x) units=[1;W] range=(0,) dB(x) kW ; ~dB(dBk/kW) # Reference = 1 kW dBf(x) units=[1;W] range=(0,) dB(x) fW ; ~dB(dBf/fW) # Reference = 1 fW dBm(x) units=[1;W] range=(0,) dB(x) mW ; ~dB(dBm/mW) # Reference = 1 mW dBmW(x) units=[1;W] range=(0,) dBm(x) ; ~dBm(dBmW) # Reference = 1 mW dBJ(x) units=[1;J] range=(0,) dB(x) J; ~dB(dBJ/J) # Energy relative # to 1 joule. Used for power spectral # density since W/Hz = J # When used to measure amplitude, voltage, or current the signal is squared # because power is proportional to the square of these measures. The root # mean square (RMS) voltage is typically used with these units. dB_amplitude(x) units=[1;1] dB(0.5 x) ; ~dB(dB_amplitude^2) dBV(x) units=[1;V] range=(0,) dB(0.5 x) V;~dB(dBV^2 / V^2) # Reference = 1 V dBmV(x) units=[1;V] range=(0,) dB(0.5 x) mV;~dB(dBmV^2/mV^2)# Reference = 1 mV dBuV(x) units=[1;V] range=(0,) dB(0.5 x) microV ; ~dB(dBuV^2 / microV^2) # Reference = 1 microvolt # Here are dB measurements for current. Be aware that dbA is also # a unit for frequency weighted sound pressure. dBA(x) units=[1;A] range=(0,) dB(0.5 x) A;~dB(dBA^2 / A^2) # Reference = 1 A dBmA(x) units=[1;A] range=(0,) dB(0.5 x) mA;~dB(dBmA^2/mA^2)# Reference = 1 mA dBuA(x) units=[1;A] range=(0,) dB(0.5 x) microA ; ~dB(dBuA^2 / microA^2) # Reference = 1 microamp # Referenced to the voltage that causes 1 mW dissipation in a 600 ohm load. # Originally defined as dBv but changed to prevent confusion with dBV. # The "u" is for unloaded. dBu(x) units=[1;V] range=(0,) dB(0.5 x) sqrt(mW 600 ohm) ; \ ~dB(dBu^2 / mW 600 ohm) dBv(x) units=[1;V] range=(0,) dBu(x) ; ~dBu(dBv) # Synonym for dBu # Measurements for sound in air, referenced to the threshold of human hearing # Note that sound in other media typically uses 1 micropascal as a reference # for sound pressure. Units dBA, dBB, dBC, refer to different frequency # weightings meant to approximate the human ear's response. # sound pressure level dBSPL(x) units=[1;Pa] range=(0,) dB(0.5 x) 20 microPa ; \ ~dB(dBSPL^2 / (20 microPa)^2) # sound intensity level dBSIL(x) units=[1;W/m^2] range=(0,) dB(x) 1e-12 W/m^2; \ ~dB(dBSIL / (1e-12 W/m^2)) # sound power level (The W in SWL is for the reference power, 1 W.) dBSWL(x) units=[1;W] range=(0,) dB(x) 1e-12 W; ~dB(dBSWL/1e-12 W) # The neper is another similar logarithmic unit. Note that the neper # is defined based on the ratio of amplitudes rather than the power # ratio like the decibel. This means that if the data is power, and # you convert to nepers you should take the square root of the data # to convert to amplitude. If you want to convert nepers to a power # measurement you need to square the resulting output. neper(x) units=[1;1] range=(0,) exp(x); ln(neper) centineper(x) units=[1;1] range=(0,) exp(x/100); 100 ln(centineper) Np() neper cNp() centineper Np_power(x) units=[1;1] Np(2 x) ; ~Np(Np_power)/2 # Misc other measures ENTROPY ENERGY / TEMPERATURE clausius 1e3 cal/K # A unit of physical entropy langley thermcalorie/cm^2 # Used in radiation theory poncelet 100 kg force m / s tonrefrigeration uston 144 btu / lb day # One ton refrigeration is # the rate of heat extraction required # turn one ton of water to ice in # a day. Ice is defined to have a # latent heat of 144 btu/lb. tonref tonrefrigeration refrigeration tonref / ton frigorie 1000 cal_15 # Used in refrigeration engineering. airwatt 8.5 (ft^3/min) inH2O # Measure of vacuum power as # pressure times air flow. # The unit "tnt" is defined so that you can write "tons tnt". The # question of which ton, exactly, is intended. The answer is that # nobody knows: # # Quoting the footnote from page 13 of # https://www.dtra.mil/Portals/61/Documents/NTPR/4-Rad_Exp_Rpts/36_The_Effects_of_Nuclear_Weapons.pdf # # The majority of the experimental and theoretical values of the # explosive energy released by TNT range from 900 to 1,100 calories per # gram. At one time, there was some uncertainty as to whether the term # “kiloton” of TNT referred to a short kiloton (2*10^6 pounds), a metric # kiloton (2.205*10^6 pounds), or a long kiloton (2.24*10^6 pounds). In # order to avoid ambiguity, it was agreed that the term “kiloton” would # refer to the release of 10^12 calories of explosive energy. This is # equivalent to 1 short kiloton of TNT if the energy release is 1,102 # calories per gram or to 1 long kiloton if the energy is 984 calories # per gram of TNT. # # It is therefore not well-defined how much energy a "gram of tnt" is, # though this term does appear in some references. tnt 1e9 cal_th / ton # Defined exact value # Nuclear weapon yields davycrocket 10 ton tnt # lightest US tactical nuclear weapon hiroshima 15.5 kiloton tnt # Uranium-235 fission bomb nagasaki 21 kiloton tnt # Plutonium-239 fission bomb fatman nagasaki littleboy hiroshima ivyking 500 kiloton tnt # most powerful fission bomb castlebravo 15 megaton tnt # most powerful US test tsarbomba 50 megaton tnt # most powerful test ever: USSR, # 30 October 1961 b53bomb 9 megaton tnt # http://rarehistoricalphotos.com/gadget-first-atomic-bomb/ trinity 18 kiloton tnt # July 16, 1945 gadget trinity # # Permeability: The permeability or permeance, n, of a substance determines # how fast vapor flows through the substance. The formula W = n A dP # holds where W is the rate of flow (in mass/time), n is the permeability, # A is the area of the flow path, and dP is the vapor pressure difference. # perm_0C grain / hr ft^2 inHg perm_zero perm_0C perm_0 perm_0C perm perm_0C perm_23C grain / hr ft^2 in Hg23C perm_twentythree perm_23C # # Counting measures # pair 2 brace 2 nest 3 # often used for items like bowls that # nest together hattrick 3 # Used in sports, especially cricket and ice # hockey to report the number of goals. dicker 10 dozen 12 bakersdozen 13 score 20 flock 40 timer 40 shock 60 toncount 100 # Used in sports in the UK longhundred 120 # From a germanic counting system gross 144 greatgross 12 gross tithe 1|10 # From Anglo-Saxon word for tenth # Paper counting measure shortquire 24 quire 25 shortream 480 ream 500 perfectream 516 bundle 2 reams bale 5 bundles # # Paper measures # # USA paper sizes lettersize 8.5 inch 11 inch legalsize 8.5 inch 14 inch ledgersize 11 inch 17 inch executivesize 7.25 inch 10.5 inch Apaper 8.5 inch 11 inch Bpaper 11 inch 17 inch Cpaper 17 inch 22 inch Dpaper 22 inch 34 inch Epaper 34 inch 44 inch # Correspondence envelope sizes. #10 is the standard business # envelope in the USA. envelope6_25size 3.5 inch 6 inch envelope6_75size 3.625 inch 6.5 inch envelope7size 3.75 inch 6.75 inch envelope7_75size 3.875 inch 7.5 inch envelope8_625size 3.625 inch 8.625 inch envelope9size 3.875 inch 8.875 inch envelope10size 4.125 inch 9.5 inch envelope11size 4.5 inch 10.375 inch envelope12size 4.75 inch 11 inch envelope14size 5 inch 11.5 inch envelope16size 6 inch 12 inch # Announcement envelope sizes (no relation to metric paper sizes like A4) envelopeA1size 3.625 inch 5.125 inch # same as 4bar envelopeA2size 4.375 inch 5.75 inch envelopeA6size 4.75 inch 6.5 inch envelopeA7size 5.25 inch 7.25 inch envelopeA8size 5.5 inch 8.125 inch envelopeA9size 5.75 inch 8.75 inch envelopeA10size 6 inch 9.5 inch # Baronial envelopes envelope4bar 3.625 inch 5.125 inch # same as A1 envelope5_5bar 4.375 inch 5.75 inch envelope6bar 4.75 inch 6.5 inch # Coin envelopes envelope1baby 2.25 inch 3.5 inch # same as #1 coin envelope00coin 1.6875 inch 2.75 inch envelope1coin 2.25 inch 3.5 inch envelope3coin 2.5 inch 4.25 inch envelope4coin 3 inch 4.5 inch envelope4_5coin 3 inch 4.875 inch envelope5coin 2.875 inch 5.25 inch envelope5_5coin 3.125 inch 5.5 inch envelope6coin 3.375 inch 6 inch envelope7coin 3.5 inch 6.5 inch # The metric paper sizes are defined so that if a sheet is cut in half # along the short direction, the result is two sheets which are # similar to the original sheet. This means that for any metric size, # the long side is close to sqrt(2) times the length of the short # side. Each series of sizes is generated by repeated cuts in half, # with the values rounded down to the nearest millimeter. A0paper 841 mm 1189 mm # The basic size in the A series A1paper 594 mm 841 mm # is defined to have an area of A2paper 420 mm 594 mm # one square meter. A3paper 297 mm 420 mm A4paper 210 mm 297 mm A5paper 148 mm 210 mm A6paper 105 mm 148 mm A7paper 74 mm 105 mm A8paper 52 mm 74 mm A9paper 37 mm 52 mm A10paper 26 mm 37 mm B0paper 1000 mm 1414 mm # The basic B size has an area B1paper 707 mm 1000 mm # of sqrt(2) square meters. B2paper 500 mm 707 mm B3paper 353 mm 500 mm B4paper 250 mm 353 mm B5paper 176 mm 250 mm B6paper 125 mm 176 mm B7paper 88 mm 125 mm B8paper 62 mm 88 mm B9paper 44 mm 62 mm B10paper 31 mm 44 mm C0paper 917 mm 1297 mm # The basic C size has an area C1paper 648 mm 917 mm # of sqrt(sqrt(2)) square meters. C2paper 458 mm 648 mm C3paper 324 mm 458 mm # Intended for envelope sizes C4paper 229 mm 324 mm C5paper 162 mm 229 mm C6paper 114 mm 162 mm C7paper 81 mm 114 mm C8paper 57 mm 81 mm C9paper 40 mm 57 mm C10paper 28 mm 40 mm # gsm (Grams per Square Meter), a sane, metric paper weight measure gsm grams / meter^2 # In the USA, a collection of crazy historical paper measures are used. Paper # is measured as a weight of a ream of that particular type of paper. This is # sometimes called the "substance" or "basis" (as in "substance 20" paper). # The standard sheet size or "basis size" varies depending on the type of # paper. As a result, 20 pound bond paper and 50 pound text paper are actually # about the same weight. The different sheet sizes were historically the most # convenient for printing or folding in the different applications. These # different basis weights are standards maintained by American Society for # Testing Materials (ASTM) and the American Forest and Paper Association # (AF&PA). poundbookpaper lb / 25 inch 38 inch ream lbbook poundbookpaper poundtextpaper poundbookpaper lbtext poundtextpaper poundoffsetpaper poundbookpaper # For offset printing lboffset poundoffsetpaper poundbiblepaper poundbookpaper # Designed to be lightweight, thin, lbbible poundbiblepaper # strong and opaque. poundtagpaper lb / 24 inch 36 inch ream lbtag poundtagpaper poundbagpaper poundtagpaper lbbag poundbagpaper poundnewsprintpaper poundtagpaper lbnewsprint poundnewsprintpaper poundposterpaper poundtagpaper lbposter poundposterpaper poundtissuepaper poundtagpaper lbtissue poundtissuepaper poundwrappingpaper poundtagpaper lbwrapping poundwrappingpaper poundwaxingpaper poundtagpaper lbwaxing poundwaxingpaper poundglassinepaper poundtagpaper lbglassine poundglassinepaper poundcoverpaper lb / 20 inch 26 inch ream lbcover poundcoverpaper poundindexpaper lb / 25.5 inch 30.5 inch ream lbindex poundindexpaper poundindexbristolpaper poundindexpaper lbindexbristol poundindexpaper poundbondpaper lb / 17 inch 22 inch ream # Bond paper is stiff and lbbond poundbondpaper # durable for repeated poundwritingpaper poundbondpaper # filing, and it resists lbwriting poundwritingpaper # ink penetration. poundledgerpaper poundbondpaper lbledger poundledgerpaper poundcopypaper poundbondpaper lbcopy poundcopypaper poundblottingpaper lb / 19 inch 24 inch ream lbblotting poundblottingpaper poundblankspaper lb / 22 inch 28 inch ream lbblanks poundblankspaper poundpostcardpaper lb / 22.5 inch 28.5 inch ream lbpostcard poundpostcardpaper poundweddingbristol poundpostcardpaper lbweddingbristol poundweddingbristol poundbristolpaper poundweddingbristol lbbristol poundbristolpaper poundboxboard lb / 1000 ft^2 lbboxboard poundboxboard poundpaperboard poundboxboard lbpaperboard poundpaperboard # When paper is marked in units of M, it means the weight of 1000 sheets of the # given size of paper. To convert this to paper weight, divide by the size of # the paper in question. paperM lb / 1000 # In addition paper weight is reported in "caliper" which is simply the # thickness of one sheet, typically in inches. Thickness is also reported in # "points" where a point is 1|1000 inch. These conversions are supplied to # convert these units roughly (using an approximate density) into the standard # paper weight values. pointthickness 0.001 in paperdensity 0.8 g/cm^3 # approximate--paper densities vary! papercaliper in paperdensity paperpoint pointthickness paperdensity # # Printing # fournierpoint 0.1648 inch / 12 # First definition of the printers # point made by Pierre Fournier who # defined it in 1737 as 1|12 of a # cicero which was 0.1648 inches. olddidotpoint 1|72 frenchinch # François Ambroise Didot, one of # a family of printers, changed # Fournier's definition around 1770 # to fit to the French units then in # use. bertholdpoint 1|2660 m # H. Berthold tried to create a # metric version of the didot point # in 1878. INpoint 0.4 mm # This point was created by a # group directed by Fermin Didot in # 1881 and is associated with the # imprimerie nationale. It doesn't # seem to have been used much. germandidotpoint 0.376065 mm # Exact definition appears in DIN # 16507, a German standards document # of 1954. Adopted more broadly in # 1966 by ??? metricpoint 3|8 mm # Proposed in 1977 by Eurograf oldpoint 1|72.27 inch # The American point was invented printerspoint oldpoint # by Nelson Hawks in 1879 and texpoint oldpoint # dominates USA publishing. # It was standardized by the American # Typefounders Association at the # value of 0.013837 inches exactly. # Knuth uses the approximation given # here (which is very close). The # comp.fonts FAQ claims that this # value is supposed to be 1|12 of a # pica where 83 picas is equal to 35 # cm. But this value differs from # the standard. texscaledpoint 1|65536 texpoint # The TeX typesetting system uses texsp texscaledpoint # this for all computations. computerpoint 1|72 inch # The American point was rounded point computerpoint computerpica 12 computerpoint # to an even 1|72 inch by computer postscriptpoint computerpoint # people at some point. pspoint postscriptpoint twip 1|20 point # TWentieth of an Imperial Point Q 1|4 mm # Used in Japanese phototypesetting # Q is for quarter frenchprinterspoint olddidotpoint didotpoint germandidotpoint # This seems to be the dominant value europeanpoint didotpoint # for the point used in Europe cicero 12 didotpoint stick 2 inches # Type sizes excelsior 3 oldpoint brilliant 3.5 oldpoint diamondtype 4 oldpoint pearl 5 oldpoint agate 5.5 oldpoint # Originally agate type was 14 lines per # inch, giving a value of 1|14 in. ruby agate # British nonpareil 6 oldpoint mignonette 6.5 oldpoint emerald mignonette # British minion 7 oldpoint brevier 8 oldpoint bourgeois 9 oldpoint longprimer 10 oldpoint smallpica 11 oldpoint pica 12 oldpoint english 14 oldpoint columbian 16 oldpoint greatprimer 18 oldpoint paragon 20 oldpoint meridian 44 oldpoint canon 48 oldpoint # German type sizes nonplusultra 2 didotpoint brillant 3 didotpoint diamant 4 didotpoint perl 5 didotpoint nonpareille 6 didotpoint kolonel 7 didotpoint petit 8 didotpoint borgis 9 didotpoint korpus 10 didotpoint corpus korpus garamond korpus mittel 14 didotpoint tertia 16 didotpoint text 18 didotpoint kleine_kanon 32 didotpoint kanon 36 didotpoint grobe_kanon 42 didotpoint missal 48 didotpoint kleine_sabon 72 didotpoint grobe_sabon 84 didotpoint # # Information theory units. Note that the name "entropy" is used both # to measure information and as a physical quantity. # INFORMATION bit nat (1/ln(2)) bits # Entropy measured base e hartley log2(10) bits # Entropy of a uniformly ban hartley # distributed random variable # over 10 symbols. dit hartley # from Decimal digIT # # Computer # bps bit/sec # Sometimes the term "baud" is # incorrectly used to refer to # bits per second. Baud refers # to symbols per second. Modern # modems transmit several bits # per symbol. byte 8 bit # Not all machines had 8 bit B byte # bytes, but these days most of # them do. But beware: for # transmission over modems, a # few extra bits are used so # there are actually 10 bits per # byte. octet 8 bits # The octet is always 8 bits nybble 4 bits # Half of a byte. Sometimes # equal to different lengths # such as 3 bits. nibble nybble nyp 2 bits # Donald Knuth asks in an exercise # for a name for a 2 bit # quantity and gives the "nyp" # as a solution due to Gregor # Purdy. Not in common use. meg megabyte # Some people consider these # units along with the kilobyte gig gigabyte # to be defined according to # powers of 2 with the kilobyte # equal to 2^10 bytes, the # megabyte equal to 2^20 bytes and # the gigabyte equal to 2^30 bytes # but these usages are forbidden # by SI. Binary prefixes have # been defined by IEC to replace # the SI prefixes. Use them to # get the binary units KiB, MiB, # GiB, etc. jiffy 0.01 sec # This is defined in the Jargon File jiffies jiffy # (http://www.jargon.org) as being the # duration of a clock tick for measuring # wall-clock time. Supposedly the value # used to be 1|60 sec or 1|50 sec # depending on the frequency of AC power, # but then 1|100 sec became more common. # On linux systems, this term is used and # for the Intel based chips, it does have # the value of .01 sec. The Jargon File # also lists two other definitions: # millisecond, and the time taken for # light to travel one foot. cdaudiospeed 44.1 kHz 2*16 bits # CD audio data rate at 44.1 kHz with 2 # samples of sixteen bits each. cdromspeed 75 2048 bytes / sec # For data CDs (mode1) 75 sectors are read # each second with 2048 bytes per sector. # Audio CDs do not have sectors, but # people sometimes divide the bit rate by # 75 and claim a sector length of 2352. # Data CDs have a lower rate due to # increased error correction overhead. # There is a rarely used mode (mode2) with # 2336 bytes per sector that has fewer # error correction bits than mode1. dvdspeed 1385 kB/s # This is the "1x" speed of a DVD using # constant linear velocity (CLV) mode. # Modern DVDs may vary the linear velocity # as they go from the inside to the # outside of the disc. # See http://www.osta.org/technology/dvdqa/dvdqa4.htm FIT / 1e9 hour # Failures In Time, number of failures per billion hours # # The IP address space is divided into subnets. The number of hosts # in a subnet depends on the length of the subnet prefix. This is # often written as /N where N is the number of bits in the prefix. # # https://en.wikipedia.org/wiki/Subnetwork # # These definitions gives the number of hosts for a subnet whose # prefix has the specified length in bits. # ipv4subnetsize(prefix_len) units=[1;1] domain=[0,32] range=[1,4294967296] \ 2^(32-prefix_len) ; 32-log2(ipv4subnetsize) ipv4classA ipv4subnetsize(8) ipv4classB ipv4subnetsize(16) ipv4classC ipv4subnetsize(24) ipv6subnetsize(prefix_len) units=[1;1] domain=[0,128] \ range=[1,340282366920938463463374607431768211456] \ 2^(128-prefix_len) ; 128-log2(ipv6subnetsize) # # Musical measures. Musical intervals expressed as ratios. Multiply # two intervals together to get the sum of the interval. The function # musicalcent can be used to convert ratios to cents. # # Perfect intervals octave 2 majorsecond musicalfifth^2 / octave majorthird 5|4 minorthird 6|5 musicalfourth 4|3 musicalfifth 3|2 majorsixth musicalfourth majorthird minorsixth musicalfourth minorthird majorseventh musicalfifth majorthird minorseventh musicalfifth minorthird pythagoreanthird majorsecond musicalfifth^2 / octave syntoniccomma pythagoreanthird / majorthird pythagoreancomma musicalfifth^12 / octave^7 # Equal tempered definitions semitone octave^(1|12) musicalcent(x) units=[1;1] range=(0,) semitone^(x/100) ; \ 100 log(musicalcent)/log(semitone) # # Musical note lengths. # wholenote ! MUSICAL_NOTE_LENGTH wholenote halfnote 1|2 wholenote quarternote 1|4 wholenote eighthnote 1|8 wholenote sixteenthnote 1|16 wholenote thirtysecondnote 1|32 wholenote sixtyfourthnote 1|64 wholenote dotted 3|2 doubledotted 7|4 breve doublewholenote semibreve wholenote minimnote halfnote crotchet quarternote quaver eighthnote semiquaver sixteenthnote demisemiquaver thirtysecondnote hemidemisemiquaver sixtyfourthnote semidemisemiquaver hemidemisemiquaver # # yarn and cloth measures # # yarn linear density woolyarnrun 1600 yard/pound # 1600 yds of "number 1 yarn" weighs # a pound. yarncut 300 yard/pound # Less common system used in # Pennsylvania for wool yarn cottonyarncount 840 yard/pound linenyarncount 300 yard/pound # Also used for hemp and ramie worstedyarncount 1680 ft/pound metricyarncount meter/gram denier 1|9 tex # used for silk and rayon manchesteryarnnumber drams/1000 yards # old system used for silk pli lb/in typp 1000 yd/lb # abbreviation for Thousand Yard Per Pound asbestoscut 100 yd/lb # used for glass and asbestos yarn tex gram / km # rational metric yarn measure, meant drex 0.1 tex # to be used for any kind of yarn poumar lb / 1e6 yard # yarn and cloth length skeincotton 80*54 inch # 80 turns of thread on a reel with a # 54 in circumference (varies for other # kinds of thread) cottonbolt 120 ft # cloth measurement woolbolt 210 ft bolt cottonbolt heer 600 yards cut 300 yards # used for wet-spun linen yarn lea 300 yards sailmakersyard 28.5 in sailmakersounce oz / sailmakersyard 36 inch silkmomme momme / 25 yards 1.49 inch # Traditional silk weight silkmm silkmomme # But it is also defined as # lb/100 yd 45 inch. The two # definitions are slightly different # and neither one seems likely to be # the true source definition. # # drug dosage # mcg microgram # Frequently used for vitamins iudiptheria 62.8 microgram # IU is for international unit iupenicillin 0.6 microgram iuinsulin 41.67 microgram drop 1|20 ml # The drop was an old "unit" that was # replaced by the minim. But I was # told by a pharmacist that in his # profession, the conversion of 20 # drops per ml is actually used. bloodunit 450 ml # For whole blood. For blood # components, a blood unit is the # quanity of the component found in a # blood unit of whole blood. The # human body contains about 12 blood # units of whole blood. # # misc medical measure # frenchcathetersize 1|3 mm # measure used for the outer diameter # of a catheter charriere frenchcathetersize # # fixup units for times when prefix handling doesn't do the job # hectare hectoare megohm megaohm kilohm kiloohm microhm microohm megalerg megaerg # 'L' added to make it pronounceable [18]. # # Money # # Note that US$ is the primitive unit so other currencies are # generally given in US$. # unitedstatesdollar US$ usdollar US$ $ dollar mark germanymark #bolivar venezuelabolivar # Not all databases are #venezuelabolivarfuerte 1e-5 bolivar # supplying these #bolivarfuerte 1e-5 bolivar # The currency was revalued #oldbolivar 1|1000 bolivarfuerte # twice peseta spainpeseta rand southafricarand escudo portugalescudo guilder netherlandsguilder hollandguilder netherlandsguilder peso mexicopeso yen japanyen lira turkeylira rupee indiarupee drachma greecedrachma franc francefranc markka finlandmarkka britainpound unitedkingdompound greatbritainpound unitedkingdompound unitedkingdompound ukpound poundsterling britainpound yuan chinayuan # Unicode Currency Names !utf8 icelandkróna icelandkrona polandzłoty polandzloty tongapa’anga tongapa'anga #venezuelabolívar venezuelabolivar vietnamđồng vietnamdong mongoliatögrög mongoliatugrik sãotomé&príncipedobra saotome&principedobra !endutf8 UKP GBP # Not an ISO code, but looks like one, and # sometimes used on usenet. !include currency.units # Money on the gold standard, used in the late 19th century and early # 20th century. olddollargold 23.22 grains goldprice # Used until 1934 newdollargold 96|7 grains goldprice # After Jan 31, 1934 dollargold newdollargold poundgold 113 grains goldprice # British pound # Precious metals goldounce goldprice troyounce silverounce silverprice troyounce platinumounce platinumprice troyounce XAU goldounce XPT platinumounce XAG silverounce # Nominal masses of US coins. Note that dimes, quarters and half dollars # have weight proportional to value. Before 1965 it was $40 / kg. USpennyweight 2.5 grams # Since 1982, 48 grains before USnickelweight 5 grams USdimeweight US$ 0.10 / (20 US$ / lb) # Since 1965 USquarterweight US$ 0.25 / (20 US$ / lb) # Since 1965 UShalfdollarweight US$ 0.50 / (20 US$ / lb) # Since 1971 USdollarweight 8.1 grams # Weight of Susan B. Anthony and # Sacagawea dollar coins # British currency quid britainpound # Slang names fiver 5 quid tenner 10 quid monkey 500 quid brgrand 1000 quid bob shilling shilling 1|20 britainpound # Before decimalisation, there oldpence 1|12 shilling # were 20 shillings to a pound, farthing 1|4 oldpence # each of twelve old pence guinea 21 shilling # Still used in horse racing crown 5 shilling florin 2 shilling groat 4 oldpence tanner 6 oldpence brpenny 0.01 britainpound pence brpenny tuppence 2 pence tuppenny tuppence ha'penny halfbrpenny hapenny ha'penny oldpenny oldpence oldtuppence 2 oldpence oldtuppenny oldtuppence threepence 3 oldpence # threepence never refers to new money threepenny threepence oldthreepence threepence oldthreepenny threepence oldhalfpenny halfoldpenny oldha'penny oldhalfpenny oldhapenny oldha'penny brpony 25 britainpound # Canadian currency loony 1 canadadollar # This coin depicts a loon toony 2 canadadollar # Cryptocurrency satoshi 1e-8 bitcoin XBT bitcoin # nonstandard code # # Units used for measuring volume of wood # cord 4*4*8 ft^3 # 4 ft by 4 ft by 8 ft bundle of wood facecord 1|2 cord cordfoot 1|8 cord # One foot long section of a cord cordfeet cordfoot housecord 1|3 cord # Used to sell firewood for residences, # often confusingly called a "cord" boardfoot ft^2 inch # Usually 1 inch thick wood boardfeet boardfoot fbm boardfoot # feet board measure stack 4 yard^3 # British, used for firewood and coal [18] rick 4 ft 8 ft 16 inches # Stack of firewood, supposedly # sometimes called a face cord, but this # value is equal to 1|3 cord. Name # comes from an old Norse word for a # stack of wood. stere m^3 timberfoot ft^3 # Used for measuring solid blocks of wood standard 120 12 ft 11 in 1.5 in # This is the St Petersburg or # Pittsburg standard. Apparently the # term is short for "standard hundred" # which was meant to refer to 100 pieces # of wood (deals). However, this # particular standard is equal to 120 # deals which are 12 ft by 11 in by 1.5 # inches (not the standard deal). hoppusfoot (4/pi) ft^3 # Volume calculation suggested in 1736 hoppusboardfoot 1|12 hoppusfoot # forestry manual by Edward Hoppus, for hoppuston 50 hoppusfoot # estimating the usable volume of a log. # It results from computing the volume # of a cylindrical log of length, L, and # girth (circumference), G, by V=L(G/4)^2. # The hoppus ton is apparently still in # use for shipments from Southeast Asia. # In Britain, the deal is apparently any piece of wood over 6 feet long, over # 7 wide and 2.5 inches thick. The OED doesn't give a standard size. A piece # of wood less than 7 inches wide is called a "batten". This unit is now used # exclusively for fir and pine. deal 12 ft 11 in 2.5 in # The standard North American deal [OED] wholedeal 12 ft 11 in 1.25 in # If it's half as thick as the standard # deal it's called a "whole deal"! splitdeal 12 ft 11 in 5|8 in # And half again as thick is a split deal. # Used for shellac mixing rate poundcut pound / gallon lbcut poundcut # # Gas and Liquid flow units # FLUID_FLOW VOLUME / TIME # Some obvious volumetric gas flow units (cu is short for cubic) cumec m^3/s cusec ft^3/s # Conventional abbreviations for fluid flow units gph gal/hr gpm gal/min mgd megagal/day brgph brgallon/hr brgpm brgallon/min brmgd mega brgallon/day usgph usgallon/hr usgpm usgallon/min usmgd mega usgallon/day cfs ft^3/s cfh ft^3/hour cfm ft^3/min lpm liter/min lfm ft/min # Used to report air flow produced by fans. # Multiply by cross sectional area to get a # flow in cfm. pru mmHg / (ml/min) # peripheral resistance unit, used in # medicine to assess blood flow in # the capillaries. # Miner's inch: This is an old historic unit used in the Western United # States. It is generally defined as the rate of flow through a one square # inch hole at a specified depth such as 4 inches. In the late 19th century, # volume of water was sometimes measured in the "24 hour inch". Values for the # miner's inch were fixed by state statues. (This information is from a web # site operated by the Nevada Division of Water Planning: The Water Words # Dictionary at http://www.state.nv.us/cnr/ndwp/dict-1/waterwds.htm.) minersinchAZ 1.5 ft^3/min minersinchCA 1.5 ft^3/min minersinchMT 1.5 ft^3/min minersinchNV 1.5 ft^3/min minersinchOR 1.5 ft^3/min minersinchID 1.2 ft^3/min minersinchKS 1.2 ft^3/min minersinchNE 1.2 ft^3/min minersinchNM 1.2 ft^3/min minersinchND 1.2 ft^3/min minersinchSD 1.2 ft^3/min minersinchUT 1.2 ft^3/min minersinchCO 1 ft^3/sec / 38.4 # 38.4 miner's inches = 1 ft^3/sec minersinchBC 1.68 ft^3/min # British Columbia # Oceanographic flow sverdrup 1e6 m^3 / sec # Used to express flow of ocean # currents. Named after Norwegian # oceanographer H. Sverdrup. # In vacuum science and some other applications, gas flow is measured # as the product of volumetric flow and pressure. This is useful # because it makes it easy to compare with the flow at standard # pressure (one atmosphere). It also directly relates to the number # of gas molecules per unit time, and hence to the mass flow if the # molecular mass is known. GAS_FLOW PRESSURE FLUID_FLOW sccm atm cc/min # 's' is for "standard" to indicate sccs atm cc/sec # flow at standard pressure scfh atm ft^3/hour # scfm atm ft^3/min slpm atm liter/min slph atm liter/hour lusec liter micron Hg / s # Used in vacuum science # US Standard Atmosphere (1976) # Atmospheric temperature and pressure vs. geometric height above sea level # This definition covers only the troposphere (the lowest atmospheric # layer, up to 11 km), and assumes the layer is polytropic. # A polytropic process is one for which PV^k = const, where P is the # pressure, V is the volume, and k is the polytropic exponent. The # polytropic index is n = 1 / (k - 1). As noted in the Wikipedia article # https://en.wikipedia.org/wiki/Polytropic_process, some authors reverse # the definitions of "exponent" and "index." The functions below assume # the following parameters: # temperature lapse rate, -dT/dz, in troposphere lapserate 6.5 K/km # US Std Atm (1976) # air molecular weight, including constituent mol wt, given # in Table 3, p. 3 air_1976 78.084 % 28.0134 \ + 20.9476 % 31.9988 \ + 9340 ppm 39.948 \ + 314 ppm 44.00995 \ + 18.18 ppm 20.183 \ + 5.24 ppm 4.0026 \ + 2 ppm 16.04303 \ + 1.14 ppm 83.80 \ + 0.55 ppm 2.01594 \ + 0.087 ppm 131.30 # universal gas constant R_1976 8.31432e3 N m/(kmol K) # polytropic index n polyndx_1976 air_1976 (kg/kmol) gravity/(R_1976 lapserate) - 1 # If desired, redefine using current values for air mol wt and R polyndx polyndx_1976 # polyndx air (kg/kmol) gravity/(R lapserate) - 1 # for comparison with various references polyexpnt (polyndx + 1) / polyndx # The model assumes the following reference values: # sea-level temperature and pressure stdatmT0 288.15 K stdatmP0 atm # "effective radius" for relation of geometric to geopotential height, # at a latitude at which g = 9.80665 m/s (approximately 45.543 deg); no # relation to actual radius earthradUSAtm 6356766 m # Temperature vs. geopotential height h # Assumes 15 degC at sea level # Based on approx 45 deg latitude # Lower limits of domain and upper limits of range are those of the # tables in US Standard Atmosphere (NASA 1976) stdatmTH(h) units=[m;K] domain=[-5000,11e3] range=[217,321] \ stdatmT0+(-lapserate h) ; (stdatmT0+(-stdatmTH))/lapserate # Temperature vs. geometric height z; based on approx 45 deg latitude stdatmT(z) units=[m;K] domain=[-5000,11e3] range=[217,321] \ stdatmTH(geop_ht(z)) ; ~geop_ht(~stdatmTH(stdatmT)) # Pressure vs. geopotential height h # Assumes 15 degC and 101325 Pa at sea level # Based on approx 45 deg latitude # Lower limits of domain and upper limits of range are those of the # tables in US Standard Atmosphere (NASA 1976) stdatmPH(h) units=[m;Pa] domain=[-5000,11e3] range=[22877,177764] \ atm (1 - (lapserate/stdatmT0) h)^(polyndx + 1) ; \ (stdatmT0/lapserate) (1+(-(stdatmPH/stdatmP0)^(1/(polyndx + 1)))) # Pressure vs. geometric height z; based on approx 45 deg latitude stdatmP(z) units=[m;Pa] domain=[-5000,11e3] range=[22877,177764] \ stdatmPH(geop_ht(z)); ~geop_ht(~stdatmPH(stdatmP)) # Geopotential height from geometric height # Based on approx 45 deg latitude # Lower limits of domain and range are somewhat arbitrary; they # correspond to the limits in the US Std Atm tables geop_ht(z) units=[m;m] domain=[-5000,) range=[-5004,) \ (earthradUSAtm z) / (earthradUSAtm + z) ; \ (earthradUSAtm geop_ht) / (earthradUSAtm + (-geop_ht)) # The standard value for the sea-level acceleration due to gravity is # 9.80665 m/s^2, but the actual value varies with latitude (Harrison 1949) # R_eff = 2 g_phi / denom # g_phi = 978.0356e-2 (1+0.0052885 sin(lat)^2+(-0.0000059) sin(2 lat)^2) # or # g_phi = 980.6160e-2 (1+(-0.0026373) cos(2 lat)+0.0000059 cos(2 lat)^2) # denom = 3.085462e-6+2.27e-9 cos(2 lat)+(-2e-12) cos(4 lat) (minutes?) # There is no inverse function; the standard value applies at a latitude # of about 45.543 deg g_phi(lat) units=[deg;m/s2] domain=[0,90] noerror \ 980.6160e-2 (1+(-0.0026373) cos(2 lat)+0.0000059 cos(2 lat)^2) m/s2 # effective Earth radius for relation of geometric height to # geopotential height, as function of latitude (Harrison 1949) earthradius_eff(lat) units=[deg;m] domain=[0,90] noerror \ m 2 9.780356 (1+0.0052885 sin(lat)^2+(-0.0000059) sin(2 lat)^2) / \ (3.085462e-6 + 2.27e-9 cos(2 lat) + (-2e-12) cos(4 lat)) # References # Harrison, L.P. 1949. Relation Between Geopotential and Geometric # Height. In Smithsonian Meteorological Tables. List, Robert J., ed. # 6th ed., 4th reprint, 1968. Washington, DC: Smithsonian Institution. # NASA. US National Aeronautics and Space Administration. 1976. # US Standard Atmosphere 1976. Washington, DC: US Government Printing Office. # Gauge pressure functions # # Gauge pressure is measured relative to atmospheric pressure. In the English # system, where pressure is often given in pounds per square inch, gauge # pressure is often indicated by 'psig' to distinguish it from absolute # pressure, often indicated by 'psia'. At the standard atmospheric pressure # of 14.696 psia, a gauge pressure of 0 psig is an absolute pressure of 14.696 # psia; an automobile tire inflated to 31 psig has an absolute pressure of # 45.696 psia. # # With gaugepressure(), the units must be specified (e.g., gaugepressure(1.5 # bar)); with psig(), the units are taken as psi, so the example above of tire # pressure could be given as psig(31). # # If the normal elevation is significantly different from sea level, change # Patm appropriately, and adjust the lower domain limit on the gaugepressure # definition. Patm atm gaugepressure(x) units=[Pa;Pa] domain=[-101325,) range=[0,) \ x + Patm ; gaugepressure+(-Patm) psig(x) units=[1;Pa] domain=[-14.6959487755135,) range=[0,) \ gaugepressure(x psi) ; ~gaugepressure(psig) / psi # Pressure for underwater diving seawater 0.1 bar / meter msw meter seawater fsw foot seawater # # Wire Gauge # # This area is a nightmare with huge charts of wire gauge diameters # that usually have no clear origin. There are at least 5 competing wire gauge # systems to add to the confusion. The use of wire gauge is related to the # manufacturing method: a metal rod is heated and drawn through a hole. The # size change can't be too big. To get smaller wires, the process is repeated # with a series of smaller holes. Generally larger gauges mean smaller wires. # The gauges often have values such as "00" and "000" which are larger sizes # than simply "0" gauge. In the tables that appear below, these gauges must be # specified as negative numbers (e.g. "00" is -1, "000" is -2, etc). # Alternatively, you can use the following units: # g00 (-1) g000 (-2) g0000 (-3) g00000 (-4) g000000 (-5) g0000000 (-6) # American Wire Gauge (AWG) or Brown & Sharpe Gauge appears to be the most # important gauge. ASTM B-258 specifies that this gauge is based on geometric # interpolation between gauge 0000, which is 0.46 inches exactly, and gauge 36 # which is 0.005 inches exactly. Therefore, the diameter in inches of a wire # is given by the formula 1|200 92^((36-g)/39). Note that 92^(1/39) is close # to 2^(1/6), so diameter is approximately halved for every 6 gauges. For the # repeated zero values, use negative numbers in the formula. The same document # also specifies rounding rules which seem to be ignored by makers of tables. # Gauges up to 44 are to be specified with up to 4 significant figures, but no # closer than 0.0001 inch. Gauges from 44 to 56 are to be rounded to the # nearest 0.00001 inch. # # In addition to being used to measure wire thickness, this gauge is used to # measure the thickness of sheets of aluminum, copper, and most metals other # than steel, iron and zinc. wiregauge(g) units=[1;m] range=(0,) \ 1|200 92^((36+(-g))/39) in; 36+(-39)ln(200 wiregauge/in)/ln(92) awg() wiregauge # Next we have the SWG, the Imperial or British Standard Wire Gauge. This one # is piecewise linear. It was used for aluminum sheets. brwiregauge[in] \ -6 0.5 \ -5 0.464 \ -3 0.4 \ -2 0.372 \ 3 0.252 \ 6 0.192 \ 10 0.128 \ 14 0.08 \ 19 0.04 \ 23 0.024 \ 26 0.018 \ 28 0.0148 \ 30 0.0124 \ 39 0.0052 \ 49 0.0012 \ 50 0.001 # The following is from the Appendix to ASTM B 258 # # For example, in U.S. gage, the standard for sheet metal is based on the # weight of the metal, not on the thickness. 16-gage is listed as # approximately .0625 inch thick and 40 ounces per square foot (the original # standard was based on wrought iron at .2778 pounds per cubic inch; steel # has almost entirely superseded wrought iron for sheet use, at .2833 pounds # per cubic inch). Smaller numbers refer to greater thickness. There is no # formula for converting gage to thickness or weight. # # It's rather unclear from the passage above whether the plate gauge values are # therefore wrong if steel is being used. Reference [15] states that steel is # in fact measured using this gauge (under the name Manufacturers' Standard # Gauge) with a density of 501.84 lb/ft3 = 0.2904 lb/in3 used for steel. # But this doesn't seem to be the correct density of steel (.2833 lb/in3 is # closer). # # This gauge was established in 1893 for purposes of taxation. # Old plate gauge for iron plategauge[(oz/ft^2)/(480*lb/ft^3)] \ -5 300 \ 1 180 \ 14 50 \ 16 40 \ 17 36 \ 20 24 \ 26 12 \ 31 7 \ 36 4.5 \ 38 4 # Manufacturers Standard Gage stdgauge[(oz/ft^2)/(501.84*lb/ft^3)] \ -5 300 \ 1 180 \ 14 50 \ 16 40 \ 17 36 \ 20 24 \ 26 12 \ 31 7 \ 36 4.5 \ 38 4 # A special gauge is used for zinc sheet metal. Notice that larger gauges # indicate thicker sheets. zincgauge[in] \ 1 0.002 \ 10 0.02 \ 15 0.04 \ 19 0.06 \ 23 0.1 \ 24 0.125 \ 27 0.5 \ 28 1 # # Imperial drill bit sizes are reported in inches or in a numerical or # letter gauge. # drillgauge[in] \ 1 0.2280 \ 2 0.2210 \ 3 0.2130 \ 4 0.2090 \ 5 0.2055 \ 6 0.2040 \ 7 0.2010 \ 8 0.1990 \ 9 0.1960 \ 10 0.1935 \ 11 0.1910 \ 12 0.1890 \ 13 0.1850 \ 14 0.1820 \ 15 0.1800 \ 16 0.1770 \ 17 0.1730 \ 18 0.1695 \ 19 0.1660 \ 20 0.1610 \ 22 0.1570 \ 23 0.1540 \ 24 0.1520 \ 25 0.1495 \ 26 0.1470 \ 27 0.1440 \ 28 0.1405 \ 29 0.1360 \ 30 0.1285 \ 31 0.1200 \ 32 0.1160 \ 33 0.1130 \ 34 0.1110 \ 35 0.1100 \ 36 0.1065 \ 38 0.1015 \ 39 0.0995 \ 40 0.0980 \ 41 0.0960 \ 42 0.0935 \ 43 0.0890 \ 44 0.0860 \ 45 0.0820 \ 46 0.0810 \ 48 0.0760 \ 51 0.0670 \ 52 0.0635 \ 53 0.0595 \ 54 0.0550 \ 55 0.0520 \ 56 0.0465 \ 57 0.0430 \ 65 0.0350 \ 66 0.0330 \ 68 0.0310 \ 69 0.0292 \ 70 0.0280 \ 71 0.0260 \ 73 0.0240 \ 74 0.0225 \ 75 0.0210 \ 76 0.0200 \ 78 0.0160 \ 79 0.0145 \ 80 0.0135 \ 88 0.0095 \ 104 0.0031 drillA 0.234 in drillB 0.238 in drillC 0.242 in drillD 0.246 in drillE 0.250 in drillF 0.257 in drillG 0.261 in drillH 0.266 in drillI 0.272 in drillJ 0.277 in drillK 0.281 in drillL 0.290 in drillM 0.295 in drillN 0.302 in drillO 0.316 in drillP 0.323 in drillQ 0.332 in drillR 0.339 in drillS 0.348 in drillT 0.358 in drillU 0.368 in drillV 0.377 in drillW 0.386 in drillX 0.397 in drillY 0.404 in drillZ 0.413 in # # Screw sizes # # In the USA, screw diameters for both wood screws and machine screws # are reported using a gauge number. Metric machine screws are # reported as Mxx where xx is the diameter in mm. # screwgauge(g) units=[1;m] range=[0,) \ (.06 + .013 g) in ; (screwgauge/in + (-.06)) / .013 # # Abrasive grit size # # Standards governing abrasive grit sizes are complicated, specifying # fractions of particles that are passed or retained by different mesh # sizes. As a result, it is not possible to make precise comparisons # of different grit standards. The tables below allow the # determination of rough equivlants by using median particle size. # # Standards in the USA are determined by the Unified Abrasives # Manufacturers' Association (UAMA), which resulted from the merger of # several previous organizations. One of the old organizations was # CAMI (Coated Abrasives Manufacturers' Institute). # # UAMA has a web page with plots showing abrasive particle ranges for # various different grits and comparisons between standards. # # http://www.uama.org/Abrasives101/101Standards.html # # Abrasives are grouped into "bonded" abrasives for use with grinding # wheels and "coated" abrasives for sandpapers and abrasive films. # The industry uses different grit standards for these two # categories. # # Another division is between "macrogrits", grits below 240 and # "microgrits", which are above 240. Standards differ, as do methods # for determining particle size. In the USA, ANSI B74.12 is the # standard governing macrogrits. ANSI B74.10 covers bonded microgrit # abrasives, and ANSI B74.18 covers coated microgrit abrasives. It # appears that the coated standard is identical to the bonded standard # for grits up through 600 but then diverges significantly. # # European grit sizes are determined by the Federation of European # Producers of Abrasives. http://www.fepa-abrasives.org # # They give two standards, the "F" grit for bonded abrasives and the # "P" grit for coated abrasives. This data is taken directly from # their web page. # FEPA P grit for coated abrasives is commonly seen on sandpaper in # the USA where the paper will be marked P600, for example. FEPA P # grits are said to be more tightly constrained than comparable ANSI # grits so that the particles are more uniform in size and hence give # a better finish. grit_P[micron] \ 12 1815 \ 16 1324 \ 20 1000 \ 24 764 \ 30 642 \ 36 538 \ 40 425 \ 50 336 \ 60 269 \ 80 201 \ 100 162 \ 120 125 \ 150 100 \ 180 82 \ 220 68 \ 240 58.5 \ 280 52.2 \ 320 46.2 \ 360 40.5 \ 400 35 \ 500 30.2 \ 600 25.8 \ 800 21.8 \ 1000 18.3 \ 1200 15.3 \ 1500 12.6 \ 2000 10.3 \ 2500 8.4 # The F grit is the European standard for bonded abrasives such as # grinding wheels grit_F[micron] \ 4 4890 \ 5 4125 \ 6 3460 \ 7 2900 \ 8 2460 \ 10 2085 \ 12 1765 \ 14 1470 \ 16 1230 \ 20 1040 \ 22 885 \ 24 745 \ 30 625 \ 36 525 \ 40 438 \ 46 370 \ 54 310 \ 60 260 \ 70 218 \ 80 185 \ 90 154 \ 100 129 \ 120 109 \ 150 82 \ 180 69 \ 220 58 \ 230 53 \ 240 44.5 \ 280 36.5 \ 320 29.2 \ 360 22.8 \ 400 17.3 \ 500 12.8 \ 600 9.3 \ 800 6.5 \ 1000 4.5 \ 1200 3 \ 1500 2.0 \ 2000 1.2 # According to the UAMA web page, the ANSI bonded and ANSI coated standards # are identical to FEPA F in the macrogrit range (under 240 grit), so these # values are taken from the FEPA F table. The values for 240 and above are # from the UAMA web site and represent the average of the "d50" range # endpoints listed there. ansibonded[micron] \ 4 4890 \ 5 4125 \ 6 3460 \ 7 2900 \ 8 2460 \ 10 2085 \ 12 1765 \ 14 1470 \ 16 1230 \ 20 1040 \ 22 885 \ 24 745 \ 30 625 \ 36 525 \ 40 438 \ 46 370 \ 54 310 \ 60 260 \ 70 218 \ 80 185 \ 90 154 \ 100 129 \ 120 109 \ 150 82 \ 180 69 \ 220 58 \ 240 50 \ 280 39.5 \ 320 29.5 \ 360 23 \ 400 18.25 \ 500 13.9 \ 600 10.55 \ 800 7.65 \ 1000 5.8 \ 1200 3.8 grit_ansibonded() ansibonded # Like the bonded grit, the coated macrogrits below 240 are taken from the # FEPA F table. Data above this is from the UAMA site. Note that the coated # and bonded standards are evidently the same from 240 up to 600 grit, but # starting at 800 grit, the coated standard diverges. The data from UAMA show # that 800 grit coated has an average size slightly larger than the average # size of 600 grit coated/bonded. However, the 800 grit has a significantly # smaller particle size variation. # # Because of this non-monotonicity from 600 grit to 800 grit this definition # produces a warning about the lack of a unique inverse. ansicoated[micron] noerror \ 4 4890 \ 5 4125 \ 6 3460 \ 7 2900 \ 8 2460 \ 10 2085 \ 12 1765 \ 14 1470 \ 16 1230 \ 20 1040 \ 22 885 \ 24 745 \ 30 625 \ 36 525 \ 40 438 \ 46 370 \ 54 310 \ 60 260 \ 70 218 \ 80 185 \ 90 154 \ 100 129 \ 120 109 \ 150 82 \ 180 69 \ 220 58 \ 240 50 \ 280 39.5 \ 320 29.5 \ 360 23 \ 400 18.25 \ 500 13.9 \ 600 10.55 \ 800 11.5 \ 1000 9.5 \ 2000 7.2 \ 2500 5.5 \ 3000 4 \ 4000 3 \ 6000 2 \ 8000 1.2 grit_ansicoated() ansicoated # # Is this correct? This is the JIS Japanese standard used on waterstones # jisgrit[micron] \ 150 75 \ 180 63 \ 220 53 \ 280 48 \ 320 40 \ 360 35 \ 400 30 \ 600 20 \ 700 17 \ 800 14 \ 1000 11.5 \ 1200 9.5 \ 1500 8 \ 2000 6.7 \ 2500 5.5 \ 3000 4 \ 4000 3 \ 6000 2 \ 8000 1.2 # The "Finishing Scale" marked with an A (e.g. A75). This information # is from the web page of the sand paper manufacturer Klingspor # http://www.klingspor.com/gritgradingsystems.htm # # I have no information about what this scale is used for. grit_A[micron]\ 16 15.3 \ 25 21.8 \ 30 23.6 \ 35 25.75 \ 45 35 \ 60 46.2 \ 65 53.5 \ 75 58.5 \ 90 65 \ 110 78 \ 130 93 \ 160 127 \ 200 156 # # Grits for DMT brand diamond sharpening stones from # http://dmtsharp.com/products/colorcode.htm # dmtxxcoarse 120 micron # 120 mesh dmtsilver dmtxxcoarse dmtxx dmtxxcoarse dmtxcoarse 60 micron # 220 mesh dmtx dmtxcoarse dmtblack dmtxcoarse dmtcoarse 45 micron # 325 mesh dmtc dmtcoarse dmtblue dmtcoarse dmtfine 25 micron # 600 mesh dmtred dmtfine dmtf dmtfine dmtefine 9 micron # 1200 mesh dmte dmtefine dmtgreen dmtefine dmtceramic 7 micron # 2200 mesh dmtcer dmtceramic dmtwhite dmtceramic dmteefine 3 micron # 8000 mesh dmttan dmteefine dmtee dmteefine # # The following values come from a page in the Norton Stones catalog, # available at their web page, http://www.nortonstones.com. # hardtranslucentarkansas 6 micron # Natural novaculite (silicon quartz) softarkansas 22 micron # stones extrafineindia 22 micron # India stones are Norton's manufactured fineindia 35 micron # aluminum oxide product mediumindia 53.5 micron coarseindia 97 micron finecrystolon 45 micron # Crystolon stones are Norton's mediumcrystalon 78 micron # manufactured silicon carbide product coarsecrystalon 127 micron # The following are not from the Norton catalog hardblackarkansas 6 micron hardwhitearkansas 11 micron washita 35 micron # # Mesh systems for measuring particle sizes by sifting through a wire # mesh or sieve # # The Tyler system and US Sieve system are based on four steps for # each factor of 2 change in the size, so each size is 2^1|4 different # from the adjacent sizes. Unfortunately, the mesh numbers are # arbitrary, so the sizes cannot be expressed with a functional form. # Various references round the values differently. The mesh numbers # are supposed to correspond to the number of holes per inch, but this # correspondence is only approximate because it doesn't include the # wire size of the mesh. # The Tyler Mesh system was apparently introduced by the WS Tyler # company, but it appears that they no longer use it. They follow the # ASTM E11 standard. meshtyler[micron] \ 2.5 8000 \ 3 6727 \ 3.5 5657 \ 4 4757 \ 5 4000 \ 6 3364 \ 7 2828 \ 8 2378 \ 9 2000 \ 10 1682 \ 12 1414 \ 14 1189 \ 16 1000 \ 20 841 \ 24 707 \ 28 595 \ 32 500 \ 35 420 \ 42 354 \ 48 297 \ 60 250 \ 65 210 \ 80 177 \ 100 149 \ 115 125 \ 150 105 \ 170 88 \ 200 74 \ 250 63 \ 270 53 \ 325 44 \ 400 37 # US Sieve size, ASTM E11 # # The WS Tyler company prints the list from ASTM E11 in their catalog, # http://wstyler.com/wp-content/uploads/2015/11/Product-Catalog-2.pdf sieve[micron] \ 3.5 5600 \ 4 4750 \ 5 4000 \ 6 3350 \ 7 2800 \ 8 2360 \ 10 2000 \ 12 1700 \ 14 1400 \ 16 1180 \ 18 1000 \ 20 850 \ 25 710 \ 30 600 \ 35 500 \ 40 425 \ 45 355 \ 50 300 \ 60 250 \ 70 212 \ 80 180 \ 100 150 \ 120 125 \ 140 106 \ 170 90 \ 200 75 \ 230 63 \ 270 53 \ 325 45 \ 400 38 \ 450 32 \ 500 25 \ 625 20 # These last two values are not in the standard series # but were included in the ASTM standard because they meshUS() sieve # were in common usage. # British Mesh size, BS 410: 1986 # This system appears to correspond to the Tyler and US system, but # with different mesh numbers. # # http://www.panadyne.com/technical/panadyne_international_sieve_chart.pdf # meshbritish[micron] \ 3 5657 \ 3.5 4757 \ 4 4000 \ 5 3364 \ 6 2828 \ 7 2378 \ 8 2000 \ 10 1682 \ 12 1414 \ 14 1189 \ 16 1000 \ 18 841 \ 22 707 \ 25 595 \ 30 500 \ 36 420 \ 44 354 \ 52 297 \ 60 250 \ 72 210 \ 85 177 \ 100 149 \ 120 125 \ 150 105 \ 170 88 \ 200 74 \ 240 63 \ 300 53 \ 350 44 \ 400 37 # French system, AFNOR NFX11-501: 1970 # The system appears to be based on size doubling every 3 mesh # numbers, though the values have been agressively rounded. # It's not clear if the unrounded values would be considered # incorrect, so this is given as a table rather than a function. # Functional form: # meshtamis(mesh) units=[1;m] 5000 2^(1|3 (mesh-38)) micron # # http://www.panadyne.com/technical/panadyne_international_sieve_chart.pdf meshtamis[micron] \ 17 40 \ 18 50 \ 19 63 \ 20 80 \ 21 100 \ 22 125 \ 23 160 \ 24 200 \ 25 250 \ 26 315 \ 27 400 \ 28 500 \ 29 630 \ 30 800 \ 31 1000 \ 32 1250 \ 33 1600 \ 34 2000 \ 35 2500 \ 36 3150 \ 37 4000 \ 38 5000 # # Ring size. All ring sizes are given as the circumference of the ring. # # USA ring sizes. Several slightly different definitions seem to be in # circulation. According to [15], the interior diameter of size n ring in # inches is 0.32 n + 0.458 for n ranging from 3 to 13.5 by steps of 0.5. The # size 2 ring is inconsistently 0.538in and no 2.5 size is listed. # # However, other sources list 0.455 + 0.0326 n and 0.4525 + 0.0324 n as the # diameter and list no special case for size 2. (Or alternatively they are # 1.43 + .102 n and 1.4216+.1018 n for measuring circumference in inches.) One # reference claimed that the original system was that each size was 1|10 inch # circumference, but that source doesn't have an explanation for the modern # system which is somewhat different. ringsize(n) units=[1;in] domain=[2,) range=[1.6252,) \ (1.4216+.1018 n) in ; (ringsize/in + (-1.4216))/.1018 # Old practice in the UK measured rings using the "Wheatsheaf gauge" with sizes # specified alphabetically and based on the ring inside diameter in steps of # 1|64 inch. This system was replaced in 1987 by British Standard 6820 which # specifies sizes based on circumference. Each size is 1.25 mm different from # the preceding size. The baseline is size C which is 40 mm circumference. # The new sizes are close to the old ones. Sometimes it's necessary to go # beyond size Z to Z+1, Z+2, etc. sizeAring 37.50 mm sizeBring 38.75 mm sizeCring 40.00 mm sizeDring 41.25 mm sizeEring 42.50 mm sizeFring 43.75 mm sizeGring 45.00 mm sizeHring 46.25 mm sizeIring 47.50 mm sizeJring 48.75 mm sizeKring 50.00 mm sizeLring 51.25 mm sizeMring 52.50 mm sizeNring 53.75 mm sizeOring 55.00 mm sizePring 56.25 mm sizeQring 57.50 mm sizeRring 58.75 mm sizeSring 60.00 mm sizeTring 61.25 mm sizeUring 62.50 mm sizeVring 63.75 mm sizeWring 65.00 mm sizeXring 66.25 mm sizeYring 67.50 mm sizeZring 68.75 mm # Japanese sizes start with size 1 at a 13mm inside diameter and each size is # 1|3 mm larger in diameter than the previous one. They are multiplied by pi # to give circumference. jpringsize(n) units=[1;mm] domain=[1,) range=[0.040840704,) \ (38|3 + n/3) pi mm ; 3 jpringsize/ pi mm + (-38) # The European ring sizes are the length of the circumference in mm minus 40. euringsize(n) units=[1;mm] (n+40) mm ; euringsize/mm + (-40) # # Abbreviations # mph mile/hr brmpg mile/brgallon usmpg mile/usgallon mpg mile/gal kph km/hr fL footlambert fpm ft/min fps ft/s rpm rev/min rps rev/sec mi mile smi mile nmi nauticalmile mbh 1e3 btu/hour mcm 1e3 circularmil ipy inch/year # used for corrosion rates ccf 100 ft^3 # used for selling water [18] Mcf 1000 ft^3 # not million cubic feet [18] kp kilopond kpm kp meter Wh W hour hph hp hour plf lb / foot # pounds per linear foot # # Compatibility units with Unix version # pa Pa ev eV hg Hg oe Oe mh mH rd rod pf pF gr grain nt N hz Hz hd hogshead dry drygallon/gallon nmile nauticalmile beV GeV bev beV coul C # # Radioactivity units # becquerel /s # Activity of radioactive source Bq becquerel # curie 3.7e10 Bq # Defined in 1910 as the radioactivity Ci curie # emitted by the amount of radon that is # in equilibrium with 1 gram of radium. rutherford 1e6 Bq # RADIATION_DOSE gray gray J/kg # Absorbed dose of radiation Gy gray # rad 1e-2 Gy # From Radiation Absorbed Dose rep 8.38 mGy # Roentgen Equivalent Physical, the amount # of radiation which , absorbed in the # body, would liberate the same amount # of energy as 1 roentgen of X rays # would, or 97 ergs. sievert J/kg # Dose equivalent: dosage that has the Sv sievert # same effect on human tissues as 200 rem 1e-2 Sv # keV X-rays. Different types of # radiation are weighted by the # Relative Biological Effectiveness # (RBE). # # Radiation type RBE # X-ray, gamma ray 1 # beta rays, > 1 MeV 1 # beta rays, < 1 MeV 1.08 # neutrons, < 1 MeV 4-5 # neutrons, 1-10 MeV 10 # protons, 1 MeV 8.5 # protons, .1 MeV 10 # alpha, 5 MeV 15 # alpha, 1 MeV 20 # # The energies are the kinetic energy # of the particles. Slower particles # interact more, so they are more # effective ionizers, and hence have # higher RBE values. # # rem stands for Roentgen Equivalent # Mammal banana_dose 0.1e-6 sievert # Informal measure of the dose due to # eating one average sized banana roentgen 2.58e-4 C / kg # Ionizing radiation that produces # 1 statcoulomb of charge in 1 cc of # dry air at stp. rontgen roentgen # Sometimes it appears spelled this way sievertunit 8.38 rontgen # Unit of gamma ray dose delivered in one # hour at a distance of 1 cm from a # point source of 1 mg of radium # enclosed in platinum .5 mm thick. eman 1e-7 Ci/m^3 # radioactive concentration mache 3.7e-7 Ci/m^3 # # Atomic weights. The atomic weight of an element is the ratio of the mass of # a mole of the element to 1|12 of a mole of Carbon 12. The Standard Atomic # Weights apply to the elements as they occur naturally on Earth. Elements # which do not occur naturally or which occur with wide isotopic variability do # not have Standard Atomic Weights. For these elements, the atomic weight is # based on the longest lived isotope, as marked in the comments. In some # cases, the comment for these entries also gives a number which is an atomic # weight for a different isotope that may be of more interest than the longest # lived isotope. # actinium 227.0278 aluminum 26.981539 americium 243.0614 # Longest lived. 241.06 antimony 121.760 argon 39.948 arsenic 74.92159 astatine 209.9871 # Longest lived barium 137.327 berkelium 247.0703 # Longest lived. 249.08 beryllium 9.012182 bismuth 208.98037 boron 10.811 bromine 79.904 cadmium 112.411 calcium 40.078 californium 251.0796 # Longest lived. 252.08 carbon 12.011 cerium 140.115 cesium 132.90543 chlorine 35.4527 chromium 51.9961 cobalt 58.93320 copper 63.546 curium 247.0703 deuterium 2.0141017778 dysprosium 162.50 einsteinium 252.083 # Longest lived erbium 167.26 europium 151.965 fermium 257.0951 # Longest lived fluorine 18.9984032 francium 223.0197 # Longest lived gadolinium 157.25 gallium 69.723 germanium 72.61 gold 196.96654 hafnium 178.49 helium 4.002602 holmium 164.93032 hydrogen 1.00794 indium 114.818 iodine 126.90447 iridium 192.217 iron 55.845 krypton 83.80 lanthanum 138.9055 lawrencium 262.11 # Longest lived lead 207.2 lithium 6.941 lutetium 174.967 magnesium 24.3050 manganese 54.93805 mendelevium 258.10 # Longest lived mercury 200.59 molybdenum 95.94 neodymium 144.24 neon 20.1797 neptunium 237.0482 nickel 58.6934 niobium 92.90638 nitrogen 14.00674 nobelium 259.1009 # Longest lived osmium 190.23 oxygen 15.9994 palladium 106.42 phosphorus 30.973762 platinum 195.08 plutonium 244.0642 # Longest lived. 239.05 polonium 208.9824 # Longest lived. 209.98 potassium 39.0983 praseodymium 140.90765 promethium 144.9127 # Longest lived. 146.92 protactinium 231.03588 radium 226.0254 radon 222.0176 # Longest lived rhenium 186.207 rhodium 102.90550 rubidium 85.4678 ruthenium 101.07 samarium 150.36 scandium 44.955910 selenium 78.96 silicon 28.0855 silver 107.8682 sodium 22.989768 strontium 87.62 sulfur 32.066 tantalum 180.9479 technetium 97.9072 # Longest lived. 98.906 tellurium 127.60 terbium 158.92534 thallium 204.3833 thorium 232.0381 thullium 168.93421 tin 118.710 titanium 47.867 tungsten 183.84 uranium 238.0289 vanadium 50.9415 xenon 131.29 ytterbium 173.04 yttrium 88.90585 zinc 65.39 zirconium 91.224 # Average molecular weight of air # # The atmospheric composition listed is from NASA Earth Fact Sheet (accessed # 28 August 2015) # http://nssdc.gsfc.nasa.gov/planetary/factsheet/earthfact.html # Numbers do not add up to exactly 100% due to roundoff and uncertainty Water # is highly variable, typically makes up about 1% air 78.08% nitrogen 2 \ + 20.95% oxygen 2 \ + 9340 ppm argon \ + 400 ppm (carbon + oxygen 2) \ + 18.18 ppm neon \ + 5.24 ppm helium \ + 1.7 ppm (carbon + 4 hydrogen) \ + 1.14 ppm krypton \ + 0.55 ppm hydrogen 2 # Density of the elements # # Note some elements occur in multiple forms (allotropes) with different # densities, and they are accordingly listed multiple times. # Density of gas phase elements at STP hydrogendensity 0.08988 g/l heliumdensity 0.1786 g/l neondensity 0.9002 g/l nitrogendensity 1.2506 g/l oxygendensity 1.429 g/l fluorinedensity 1.696 g/l argondensity 1.784 g/l chlorinedensity 3.2 g/l kryptondensity 3.749 g/l xenondensity 5.894 g/l radondensity 9.73 g/l # Density of liquid phase elements near room temperature brominedensity 3.1028 g/cm^3 mercurydensity 13.534 g/cm^3 # Density of solid elements near room temperature lithiumdensity 0.534 g/cm^3 potassiumdensity 0.862 g/cm^3 sodiumdensity 0.968 g/cm^3 rubidiumdensity 1.532 g/cm^3 calciumdensity 1.55 g/cm^3 magnesiumdensity 1.738 g/cm^3 phosphorus_white_density 1.823 g/cm^3 berylliumdensity 1.85 g/cm^3 sulfur_gamma_density 1.92 g/cm^3 cesiumdensity 1.93 g/cm^3 carbon_amorphous_density 1.95 g/cm^3 # average value sulfur_betadensity 1.96 g/cm^3 sulfur_alpha_density 2.07 g/cm^3 carbon_graphite_density 2.267 g/cm^3 phosphorus_red_density 2.27 g/cm^3 # average value silicondensity 2.3290 g/cm^3 phosphorus_violet_density 2.36 g/cm^3 borondensity 2.37 g/cm^3 strontiumdensity 2.64 g/cm^3 phosphorus_black_density 2.69 g/cm^3 aluminumdensity 2.7 g/cm^3 bariumdensity 3.51 g/cm^3 carbon_diamond_density 3.515 g/cm^3 scandiumdensity 3.985 g/cm^3 selenium_vitreous_density 4.28 g/cm^3 selenium_alpha_density 4.39 g/cm^3 titaniumdensity 4.406 g/cm^3 yttriumdensity 4.472 g/cm^3 selenium_gray_density 4.81 g/cm^3 iodinedensity 4.933 g/cm^3 europiumdensity 5.264 g/cm^3 germaniumdensity 5.323 g/cm^3 radiumdensity 5.5 g/cm^3 arsenicdensity 5.727 g/cm^3 tin_alpha_density 5.769 g/cm^3 galliumdensity 5.91 g/cm^3 vanadiumdensity 6.11 g/cm^3 lanthanumdensity 6.162 g/cm^3 telluriumdensity 6.24 g/cm^3 zirconiumdensity 6.52 g/cm^3 antimonydensity 6.697 g/cm^3 ceriumdensity 6.77 g/cm^3 praseodymiumdensity 6.77 g/cm^3 ytterbiumdensity 6.9 g/cm^3 neodymiumdensity 7.01 g/cm^3 zincdensity 7.14 g/cm^3 chromiumdensity 7.19 g/cm^3 manganesedensity 7.21 g/cm^3 promethiumdensity 7.26 g/cm^3 tin_beta_density 7.265 g/cm^3 indiumdensity 7.31 g/cm^3 samariumdensity 7.52 g/cm^3 irondensity 7.874 g/cm^3 gadoliniumdensity 7.9 g/cm^3 terbiumdensity 8.23 g/cm^3 dysprosiumdensity 8.54 g/cm^3 niobiumdensity 8.57 g/cm^3 cadmiumdensity 8.65 g/cm^3 holmiumdensity 8.79 g/cm^3 cobaltdensity 8.9 g/cm^3 nickeldensity 8.908 g/cm^3 erbiumdensity 9.066 g/cm^3 polonium_alpha_density 9.196 g/cm^3 thuliumdensity 9.32 g/cm^3 polonium_beta_density 9.398 g/cm^3 bismuthdensity 9.78 g/cm^3 lutetiumdensity 9.841 g/cm^3 actiniumdensity 10 g/cm^3 molybdenumdensity 10.28 g/cm^3 silverdensity 10.49 g/cm^3 technetiumdensity 11 g/cm^3 leaddensity 11.34 g/cm^3 thoriumdensity 11.7 g/cm^3 thalliumdensity 11.85 g/cm^3 americiumdensity 12 g/cm^3 palladiumdensity 12.023 g/cm^3 rhodiumdensity 12.41 g/cm^3 rutheniumdensity 12.45 g/cm^3 berkelium_beta_density 13.25 g/cm^3 hafniumdensity 13.31 g/cm^3 curiumdensity 13.51 g/cm^3 berkelium_alphadensity 14.78 g/cm^3 californiumdensity 15.1 g/cm^3 protactiniumdensity 15.37 g/cm^3 tantalumdensity 16.69 g/cm^3 uraniumdensity 19.1 g/cm^3 tungstendensity 19.3 g/cm^3 golddensity 19.30 g/cm^3 plutoniumdensity 19.816 g/cm^3 neptuniumdensity 20.45 g/cm^3 # alpha form, only one at room temp rheniumdensity 21.02 g/cm^3 platinumdensity 21.45 g/cm^3 iridiumdensity 22.56 g/cm^3 osmiumdensity 22.59 g/cm^3 # A few alternate names tin_gray tin_alpha_density tin_white tin_beta_density graphitedensity carbon_graphite_density diamonddensity carbon_diamond_density # Predicted density of elements that have not been made in sufficient # quantities for measurement. franciumdensity 2.48 g/cm^3 # liquid, predicted melting point 8 degC astatinedensity 6.35 g/cm^3 einsteiniumdensity 8.84 g/cm^3 fermiumdensity 9.7 g/cm^3 nobeliumdensity 9.9 g/cm^3 mendeleviumdensity 10.3 g/cm^3 lawrenciumdensity 16 g/cm^3 rutherfordiumdensity 23.2 g/cm^3 roentgeniumdensity 28.7 g/cm^3 dubniumdensity 29.3 g/cm^3 darmstadtiumdensity 34.8 g/cm^3 seaborgiumdensity 35 g/cm^3 bohriumdensity 37.1 g/cm^3 meitneriumdensity 37.4 g/cm^3 hassiumdensity 41 g/cm^3 # # population units # people 1 person people death people capita people percapita per capita # TGM dozen based unit system listed on the "dozenal" forum # http://www.dozenalsociety.org.uk/apps/tgm.htm. These units are # proposed as an allegedly more rational alternative to the SI system. Tim 12^-4 hour # Time Grafut gravity Tim^2 # Length based on gravity Surf Grafut^2 # area Volm Grafut^3 # volume Vlos Grafut/Tim # speed Denz Maz/Volm # density Mag Maz gravity # force Maz Volm kg / oldliter # mass based on water Tm Tim # Abbreviations Gf Grafut Sf Surf Vm Volm Vl Vlos Mz Maz Dz Denz # Dozen based unit prefixes Zena- 12 Duna- 12^2 Trina- 12^3 Quedra- 12^4 Quena- 12^5 Hesa- 12^6 Seva- 12^7 Aka- 12^8 Neena- 12^9 Dexa- 12^10 Lefa- 12^11 Zennila- 12^12 Zeni- 12^-1 Duni- 12^-2 Trini- 12^-3 Quedri- 12^-4 Queni- 12^-5 Hesi- 12^-6 Sevi- 12^-7 Aki- 12^-8 Neeni- 12^-9 Dexi- 12^-10 Lefi- 12^-11 Zennili- 12^-12 # # Traditional Japanese units (shakkanhou) # # The traditional system of weights and measures is called shakkanhou from the # shaku and the ken. Japan accepted SI units in 1891 and legalized conversions # to the traditional system. In 1909 the inch-pound system was also legalized, # so Japan had three legally approved systems. A change to the metric system # started in 1921 but there was a lot of resistance. The Measurement Law of # October 1999 prohibits sales in anything but SI units. However, the old # units still live on in construction and as the basis for paper sizes of books # and tools used for handicrafts. # # Note that units below use the Hepburn romanization system. Some other # systems would render "mou", "jou", and "chou" as "mo", "jo" and "cho". # # # http://hiramatu-hifuka.com/onyak/onyindx.html # Japanese Proportions. These are still in everyday use. They also # get used as units to represent the proportion of the standard unit. wari_proportion 1|10 wari wari_proportion bu_proportion 1|100 # The character bu can also be read fun or bun # but usually "bu" is used for units. rin_proportion 1|1000 mou_proportion 1|10000 # Japanese Length Measures # # The length system is called kanejaku or # square and originated in China. It was # adopted as Japan's official measure in 701 # by the Taiho Code. This system is still in # common use in architecture and clothing. shaku 1|3.3 m mou 1|10000 shaku rin 1|1000 shaku bu_distance 1|100 shaku sun 1|10 shaku jou_distance 10 shaku jou jou_distance kanejakusun sun # Alias to emphasize architectural name kanejaku shaku kanejakujou jou # http://en.wikipedia.org/wiki/Taiwanese_units_of_measurement taichi shaku # http://zh.wikipedia.org/wiki/台尺 taicun sun # http://zh.wikipedia.org/wiki/台制 !utf8 台尺 taichi # via Hanyu Pinyin romanizations 台寸 taicun !endutf8 # In context of clothing, shaku is different from architecture # http://www.scinet.co.jp/sci/sanwa/kakizaki-essay54.html kujirajaku 10|8 shaku kujirajakusun 1|10 kujirajaku kujirajakubu 1|100 kujirajaku kujirajakujou 10 kujirajaku tan_distance 3 kujirajakujou ken 6 shaku # Also sometimes 6.3, 6.5, or 6.6 # http://www.homarewood.co.jp/syakusun.htm # mostly unused chou_distance 60 ken chou chou_distance ri 36 chou # Japanese Area Measures # Tsubo is still used for land size, though the others are more # recognized by their homonyms in the other measurements. gou_area 1|10 tsubo tsubo 36 shaku^2 # Size of two tatami = ken^2 ?? se 30 tsubo tan_area 10 se chou_area 10 tan_area # http://en.wikipedia.org/wiki/Taiwanese_units_of_measurement ping tsubo # http://zh.wikipedia.org/wiki/坪 jia 2934 ping # http://zh.wikipedia.org/wiki/甲_(单位) fen 1|10 jia # http://zh.wikipedia.org/wiki/分 fen_area 1|10 jia # Protection against future collisions !utf8 坪 ping # via Hanyu Pinyin romanizations 甲 jia 分 fen 分地 fen_area # Protection against future collisions !endutf8 # Japanese architecture is based on a "standard" size of tatami mat. # Room sizes today are given in number of tatami, and this number # determines the spacing between colums and hence sizes of sliding # doors and paper screens. However, every region has its own slightly # different tatami size. Edoma, used in and around Tokyo and # Hokkaido, is becoming a nationwide standard. Kyouma is used around # Kyoto, Osaka and Kyuushu, and Chuukyouma is used around Nagoya. # Note that the tatami all have the aspect ratio 2:1 so that the mats # can tile the room with some of them turned 90 degrees. # # http://www.moon2.net/tatami/infotatami/structure.html edoma (5.8*2.9) shaku^2 kyouma (6.3*3.15) shaku^2 chuukyouma (6*3) shaku^2 jou_area edoma tatami jou_area # Japanese Volume Measures # The "shou" is still used for such things as alcohol and seasonings. # Large quantities of paint are still purchased in terms of "to". shaku_volume 1|10 gou_volume gou_volume 1|10 shou gou gou_volume shou (4.9*4.9*2.7) sun^3 # The character shou which is # the same as masu refers to a # rectangular wooden cup used to # measure liquids and cereal. # Sake is sometimes served in a masu # Note that it happens to be # EXACTLY 7^4/11^3 liters. to 10 shou koku 10 to # No longer used; historically a measure of rice # Japanese Weight Measures # # http://wyoming.hp.infoseek.co.jp/zatugaku/zamoney.html # Not really used anymore. rin_weight 1|10 bu_weight bu_weight 1|10 monme fun 1|10 monme monme momme kin 160 monme kan 1000 monme kwan kan # This was the old pronounciation of the unit. # The old spelling persisted a few centuries # longer and was not changed until around # 1950. # http://en.wikipedia.org/wiki/Taiwanese_units_of_measurement # says: "Volume measure in Taiwan is largely metric". taijin kin # http://zh.wikipedia.org/wiki/台斤 tailiang 10 monme # http://zh.wikipedia.org/wiki/台斤 taiqian monme # http://zh.wikipedia.org/wiki/台制 !utf8 台斤 taijin # via Hanyu Pinyin romanizations 台兩 tailiang 台錢 taiqian !endutf8 # # Australian unit # australiasquare (10 ft)^2 # Used for house area # # A few German units as currently in use. # zentner 50 kg doppelzentner 2 zentner pfund 500 g # The klafter, which was used in central Europe, was derived from the span of # outstretched arms. # # https://en.wikipedia.org/wiki/Obsolete_Austrian_units_of_measurement # https://www.llv.li/files/abi/klafter-m2-en.pdf austriaklafter 1.89648384 m # Exact definition, 23 July 1871 austriafoot 1|6 austriaklafter prussiaklafter 1.88 m prussiafoot 1|6 prussiaklafter bavariaklafter 1.751155 m bavariafoot 1|6 bavariaklafter hesseklafter 2.5 m hessefoot 1|6 hesseklafter switzerlandklafter metricklafter switzerlandfoot 1|6 switzerlandklafter swissklafter switzerlandklafter swissfoot 1|6 swissklafter metricklafter 1.8 m austriayoke 8 austriaklafter * 200 austriaklafter liechtensteinsquareklafter 3.596652 m^2 # Used until 2017 to measure land area liechtensteinklafter sqrt(liechtensteinsquareklafter) # The klafter was also used to measure volume of wood, generally being a stack # of wood one klafter wide, one klafter long, with logs 3 feet (half a klafter) # in length prussiawoodklafter 0.5 prussiaklafter^3 austriawoodklafter 0.5 austriaklafter^3 festmeter m^3 # modern measure of wood, solid cube raummeter 0.7 festmeter # Air space between the logs, stacked schuettraummeter 0.65 raummeter # A cubic meter volume of split and cut schüttraummeter schuettraummeter# firewood in a loose, unordered # pile, not stacked. This is called # "tipped". # # Swedish (Sweden) pre-metric units of 1739. # The metric system was adopted in 1878. # https://sv.wikipedia.org/wiki/Verkm%C3%A5tt # verklinje 2.0618125 mm verktum 12 verklinje kvarter 6 verktum fot 2 kvarter aln 2 fot famn 3 aln # # Some traditional Russian measures # # If you would like to help expand this section and understand # cyrillic transliteration, let me know. These measures are meant to # reflect common usage, e.g. in translated literature. # dessiatine 2400 sazhen^2 # Land measure dessjatine dessiatine funt 409.51718 grams # similar to pound zolotnik 1|96 funt # used for precious metal measure pood 40 funt # common in agricultural measure arshin (2 + 1|3) feet sazhen 3 arshin # analogous to fathom verst 500 sazhen # of similar use to mile versta verst borderverst 1000 sazhen russianmile 7 verst # # Old French distance measures, from French Weights and Measures # Before the Revolution by Zupko # frenchfoot 144|443.296 m # pied de roi, the standard of Paris. pied frenchfoot # Half of the hashimicubit, frenchfeet frenchfoot # instituted by Charlemagne. frenchinch 1|12 frenchfoot # This exact definition comes from frenchthumb frenchinch # a law passed on 10 Dec 1799 which pouce frenchthumb # fixed the meter at # 3 frenchfeet + 11.296 lignes. frenchline 1|12 frenchinch # This is supposed to be the size ligne frenchline # of the average barleycorn frenchpoint 1|12 frenchline toise 6 frenchfeet arpent 180^2 pied^2 # The arpent is 100 square perches, # but the perche seems to vary a lot # and can be 18 feet, 20 feet, or 22 # feet. This measure was described # as being in common use in Canada in # 1934 (Websters 2nd). The value # given here is the Paris standard # arpent. frenchgrain 1|18827.15 kg # Weight of a wheat grain, hence # smaller than the British grain. frenchpound 9216 frenchgrain # # Before the Imperial Weights and Measures Act of 1824, various different # weights and measures were in use in different places. # # Scots linear measure scotsinch 1.00540054 UKinch scotslink 1|100 scotschain scotsfoot 12 scotsinch scotsfeet scotsfoot scotsell 37 scotsinch scotsfall 6 scotsell scotschain 4 scotsfall scotsfurlong 10 scotschain scotsmile 8 scotsfurlong # Scots area measure scotsrood 40 scotsfall^2 scotsacre 4 scotsrood # Irish linear measure irishinch UKinch irishpalm 3 irishinch irishspan 3 irishpalm irishfoot 12 irishinch irishfeet irishfoot irishcubit 18 irishinch irishyard 3 irishfeet irishpace 5 irishfeet irishfathom 6 irishfeet irishpole 7 irishyard # Only these values irishperch irishpole # are different from irishchain 4 irishperch # the British Imperial irishlink 1|100 irishchain # or English values for irishfurlong 10 irishchain # these lengths. irishmile 8 irishfurlong # # Irish area measure irishrood 40 irishpole^2 irishacre 4 irishrood # English wine capacity measures (Winchester measures) winepint 1|2 winequart winequart 1|4 winegallon winegallon 231 UKinch^3 # Sometimes called the Winchester Wine Gallon, # it was legalized in 1707 by Queen Anne, and # given the definition of 231 cubic inches. It # had been in use for a while as 8 pounds of wine # using a merchant's pound, but the definition of # the merchant's pound had become uncertain. A # pound of 15 tower ounces (6750 grains) had been # common, but then a pound of 15 troy ounces # (7200 grains) gained popularity. Because of # the switch in the value of the merchants pound, # the size of the wine gallon was uncertain in # the market, hence the official act in 1707. # The act allowed that a six inch tall cylinder # with a 7 inch diameter was a lawful wine # gallon. (This comes out to 230.9 in^3.) # Note also that in Britain a legal conversion # was established to the 1824 Imperial gallon # then taken as 277.274 in^3 so that the wine # gallon was 0.8331 imperial gallons. This is # 231.1 cubic inches (using the international # inch). winerundlet 18 winegallon winebarrel 31.5 winegallon winetierce 42 winegallon winehogshead 2 winebarrel winepuncheon 2 winetierce winebutt 2 winehogshead winepipe winebutt winetun 2 winebutt # English beer and ale measures used 1803-1824 and used for beer before 1688 beerpint 1|2 beerquart beerquart 1|4 beergallon beergallon 282 UKinch^3 beerbarrel 36 beergallon beerhogshead 1.5 beerbarrel # English ale measures used from 1688-1803 for both ale and beer alepint 1|2 alequart alequart 1|4 alegallon alegallon beergallon alebarrel 34 alegallon alehogshead 1.5 alebarrel # Scots capacity measure scotsgill 1|4 mutchkin mutchkin 1|2 choppin choppin 1|2 scotspint scotspint 1|2 scotsquart scotsquart 1|4 scotsgallon scotsgallon 827.232 UKinch^3 scotsbarrel 8 scotsgallon jug scotspint # Scots dry capacity measure scotswheatlippy 137.333 UKinch^3 # Also used for peas, beans, rye, salt scotswheatlippies scotswheatlippy scotswheatpeck 4 scotswheatlippy scotswheatfirlot 4 scotswheatpeck scotswheatboll 4 scotswheatfirlot scotswheatchalder 16 scotswheatboll scotsoatlippy 200.345 UKinch^3 # Also used for barley and malt scotsoatlippies scotsoatlippy scotsoatpeck 4 scotsoatlippy scotsoatfirlot 4 scotsoatpeck scotsoatboll 4 scotsoatfirlot scotsoatchalder 16 scotsoatboll # Scots Tron weight trondrop 1|16 tronounce tronounce 1|20 tronpound tronpound 9520 grain tronstone 16 tronpound # Irish liquid capacity measure irishnoggin 1|4 irishpint irishpint 1|2 irishquart irishquart 1|2 irishpottle irishpottle 1|2 irishgallon irishgallon 217.6 UKinch^3 irishrundlet 18 irishgallon irishbarrel 31.5 irishgallon irishtierce 42 irishgallon irishhogshead 2 irishbarrel irishpuncheon 2 irishtierce irishpipe 2 irishhogshead irishtun 2 irishpipe # Irish dry capacity measure irishpeck 2 irishgallon irishbushel 4 irishpeck irishstrike 2 irishbushel irishdrybarrel 2 irishstrike irishquarter 2 irishbarrel # English Tower weights, abolished in 1528 towerpound 5400 grain towerounce 1|12 towerpound towerpennyweight 1|20 towerounce towergrain 1|32 towerpennyweight # English Mercantile weights, used since the late 12th century mercpound 6750 grain mercounce 1|15 mercpound mercpennyweight 1|20 mercounce # English weights for lead leadstone 12.5 lb fotmal 70 lb leadwey 14 leadstone fothers 12 leadwey # English Hay measure newhaytruss 60 lb # New and old here seem to refer to "new" newhayload 36 newhaytruss # hay and "old" hay rather than a new unit oldhaytruss 56 lb # and an old unit. oldhayload 36 oldhaytruss # English wool measure woolclove 7 lb woolstone 2 woolclove wooltod 2 woolstone woolwey 13 woolstone woolsack 2 woolwey woolsarpler 2 woolsack woollast 6 woolsarpler # # Ancient history units: There tends to be uncertainty in the definitions # of the units in this section # These units are from [11] # Roman measure. The Romans had a well defined distance measure, but their # measures of weight were poor. They adopted local weights in different # regions without distinguishing among them so that there are half a dozen # different Roman "standard" weight systems. romanfoot 296 mm # There is some uncertainty in this definition romanfeet romanfoot # from which all the other units are derived. pes romanfoot # This value appears in numerous sources. In "The pedes romanfoot # Roman Land Surveyors", Dilke gives 295.7 mm. romaninch 1|12 romanfoot # The subdivisions of the Roman foot have the romandigit 1|16 romanfoot # same names as the subdivisions of the pound, romanpalm 1|4 romanfoot # but we can't have the names for different romancubit 18 romaninch # units. romanpace 5 romanfeet # Roman double pace (basic military unit) passus romanpace romanperch 10 romanfeet stade 125 romanpaces stadia stade stadium stade romanmile 8 stadia # 1000 paces romanleague 1.5 romanmile schoenus 4 romanmile # Other values for the Roman foot (from Dilke) earlyromanfoot 29.73 cm pesdrusianus 33.3 cm # or 33.35 cm, used in Gaul & Germany in 1st c BC lateromanfoot 29.42 cm # Roman areas actuslength 120 romanfeet # length of a Roman furrow actus 120*4 romanfeet^2 # area of the furrow squareactus 120^2 romanfeet^2 # actus quadratus acnua squareactus iugerum 2 squareactus iugera iugerum jugerum iugerum jugera iugerum heredium 2 iugera # heritable plot heredia heredium centuria 100 heredia centurium centuria # Roman volumes sextarius 35.4 in^3 # Basic unit of Roman volume. As always, sextarii sextarius # there is uncertainty. Six large Roman # measures survive with volumes ranging from # 34.4 in^3 to 39.55 in^3. Three of them # cluster around the size given here. # # But the values for this unit vary wildly # in other sources. One reference gives 0.547 # liters, but then says the amphora is a # cubic Roman foot. This gives a value for the # sextarius of 0.540 liters. And the # encyclopedia Britannica lists 0.53 liters for # this unit. Both [7] and [11], which were # written by scholars of weights and measures, # give the value of 35.4 cubic inches. cochlearia 1|48 sextarius cyathi 1|12 sextarius acetabula 1|8 sextarius quartaria 1|4 sextarius quartarius quartaria heminae 1|2 sextarius hemina heminae cheonix 1.5 sextarii # Dry volume measures (usually) semodius 8 sextarius semodii semodius modius 16 sextarius modii modius # Liquid volume measures (usually) congius 12 heminae congii congius amphora 8 congii amphorae amphora # Also a dry volume measure culleus 20 amphorae quadrantal amphora # Roman weights libra 5052 grain # The Roman pound varied significantly librae libra # from 4210 grains to 5232 grains. Most of romanpound libra # the standards were obtained from the weight uncia 1|12 libra # of particular coins. The one given here is unciae uncia # based on the Gold Aureus of Augustus which romanounce uncia # was in use from BC 27 to AD 296. deunx 11 uncia dextans 10 uncia dodrans 9 uncia bes 8 uncia seprunx 7 uncia semis 6 uncia quincunx 5 uncia triens 4 uncia quadrans 3 uncia sextans 2 uncia sescuncia 1.5 uncia semuncia 1|2 uncia siscilius 1|4 uncia sextula 1|6 uncia semisextula 1|12 uncia scriptulum 1|24 uncia scrupula scriptulum romanobol 1|2 scrupula romanaspound 4210 grain # Old pound based on bronze coinage, the # earliest money of Rome BC 338 to BC 268. # Egyptian length measure egyptianroyalcubit 20.63 in # plus or minus .2 in egyptianpalm 1|7 egyptianroyalcubit egyptiandigit 1|4 egyptianpalm egyptianshortcubit 6 egyptianpalm doubleremen 29.16 in # Length of the diagonal of a square with remendigit 1|40 doubleremen # side length of 1 royal egyptian cubit. # This is divided into 40 digits which are # not the same size as the digits based on # the royal cubit. # Greek length measures greekfoot 12.45 in # Listed as being derived from the greekfeet greekfoot # Egyptian Royal cubit in [11]. It is greekcubit 1.5 greekfoot # said to be 3|5 of a 20.75 in cubit. pous greekfoot podes greekfoot orguia 6 greekfoot greekfathom orguia stadion 100 orguia akaina 10 greekfeet plethron 10 akaina greekfinger 1|16 greekfoot homericcubit 20 greekfingers # Elbow to end of knuckles. shortgreekcubit 18 greekfingers # Elbow to start of fingers. ionicfoot 296 mm doricfoot 326 mm olympiccubit 25 remendigit # These olympic measures were not as olympicfoot 2|3 olympiccubit # common as the other greek measures. olympicfinger 1|16 olympicfoot # They were used in agriculture. olympicfeet olympicfoot olympicdakylos olympicfinger olympicpalm 1|4 olympicfoot olympicpalestra olympicpalm olympicspithame 3|4 foot olympicspan olympicspithame olympicbema 2.5 olympicfeet olympicpace olympicbema olympicorguia 6 olympicfeet olympicfathom olympicorguia olympiccord 60 olympicfeet olympicamma olympiccord olympicplethron 100 olympicfeet olympicstadion 600 olympicfeet # Greek capacity measure greekkotyle 270 ml # This approximate value is obtained xestes 2 greekkotyle # from two earthenware vessels that khous 12 greekkotyle # were reconstructed from fragments. metretes 12 khous # The kotyle is a day's corn ration choinix 4 greekkotyle # for one man. hekteos 8 choinix medimnos 6 hekteos # Greek weight. Two weight standards were used, an Aegina standard based # on the Beqa shekel and an Athens (attic) standard. aeginastater 192 grain # Varies up to 199 grain aeginadrachmae 1|2 aeginastater aeginaobol 1|6 aeginadrachmae aeginamina 50 aeginastaters aeginatalent 60 aeginamina # Supposedly the mass of a cubic foot # of water (whichever foot was in use) atticstater 135 grain # Varies 134-138 grain atticdrachmae 1|2 atticstater atticobol 1|6 atticdrachmae atticmina 50 atticstaters attictalent 60 atticmina # Supposedly the mass of a cubic foot # of water (whichever foot was in use) # "Northern" cubit and foot. This was used by the pre-Aryan civilization in # the Indus valley. It was used in Mesopotamia, Egypt, North Africa, China, # central and Western Europe until modern times when it was displaced by # the metric system. northerncubit 26.6 in # plus/minus .2 in northernfoot 1|2 northerncubit sumeriancubit 495 mm kus sumeriancubit sumerianfoot 2|3 sumeriancubit assyriancubit 21.6 in assyrianfoot 1|2 assyriancubit assyrianpalm 1|3 assyrianfoot assyriansusi 1|20 assyrianpalm susi assyriansusi persianroyalcubit 7 assyrianpalm # Arabic measures. The arabic standards were meticulously kept. Glass weights # accurate to .2 grains were made during AD 714-900. hashimicubit 25.56 in # Standard of linear measure used # in Persian dominions of the Arabic # empire 7-8th cent. Is equal to two # French feet. blackcubit 21.28 in arabicfeet 1|2 blackcubit arabicfoot arabicfeet arabicinch 1|12 arabicfoot arabicmile 4000 blackcubit silverdirhem 45 grain # The weights were derived from these two tradedirhem 48 grain # units with two identically named systems # used for silver and used for trade purposes silverkirat 1|16 silverdirhem silverwukiyeh 10 silverdirhem silverrotl 12 silverwukiyeh arabicsilverpound silverrotl tradekirat 1|16 tradedirhem tradewukiyeh 10 tradedirhem traderotl 12 tradewukiyeh arabictradepound traderotl # Miscellaneous ancient units parasang 3.5 mile # Persian unit of length usually thought # to be between 3 and 3.5 miles biblicalcubit 21.8 in hebrewcubit 17.58 in li 10|27.8 mile # Chinese unit of length # 100 li is considered a day's march liang 11|3 oz # Chinese weight unit # Medieval time units. According to the OED, these appear in Du Cange # by Papias. timepoint 1|5 hour # also given as 1|4 timeminute 1|10 hour timeostent 1|60 hour timeounce 1|8 timeostent timeatom 1|47 timeounce # Given in [15], these subdivisions of the grain were supposedly used # by jewelers. The mite may have been used but the blanc could not # have been accurately measured. mite 1|20 grain droit 1|24 mite periot 1|20 droit blanc 1|24 periot # # Localization # !var UNITS_ENGLISH US hundredweight ushundredweight ton uston scruple apscruple fluidounce usfluidounce gallon usgallon bushel usbushel quarter quarterweight cup uscup tablespoon ustablespoon teaspoon usteaspoon dollar US$ cent $ 0.01 penny cent minim minimvolume pony ponyvolume grand usgrand firkin usfirkin hogshead ushogshead !endvar !var UNITS_ENGLISH GB hundredweight brhundredweight ton brton scruple brscruple fluidounce brfluidounce gallon brgallon bushel brbushel quarter brquarter chaldron brchaldron cup brcup teacup brteacup tablespoon brtablespoon teaspoon brteaspoon dollar US$ cent $ 0.01 penny brpenny minim minimnote pony brpony grand brgrand firkin brfirkin hogshead brhogshead !endvar !varnot UNITS_ENGLISH GB US !message Unknown value for environment variable UNITS_ENGLISH. Should be GB or US. !endvar !utf8 ⅛- 1|8 ¼- 1|4 ⅜- 3|8 ½- 1|2 ⅝- 5|8 ¾- 3|4 ⅞- 7|8 ⅙- 1|6 ⅓- 1|3 ⅔- 2|3 ⅚- 5|6 ⅕- 1|5 ⅖- 2|5 ⅗- 3|5 ⅘- 4|5 # U+2150- 1|7 For some reason these characters are getting # U+2151- 1|9 flagged as invalid UTF8. # U+2152- 1|10 #⅐- 1|7 # fails under MacOS #⅑- 1|9 # fails under MacOS #⅒- 1|10 # fails under MacOS ℯ exp(1) # U+212F, base of natural log µ- micro # micro sign U+00B5 μ- micro # small mu U+03BC ångström angstrom Å angstrom # angstrom symbol U+212B Å angstrom # A with ring U+00C5 röntgen roentgen °C degC °F degF °K K # °K is incorrect notation °R degR ° degree ℃ degC ℉ degF K K # Kelvin symbol, U+212A ℓ liter # unofficial abbreviation used in some places Ω ohm # Ohm symbol U+2126 Ω ohm # Greek capital omega U+03A9 ℧ mho ʒ dram # U+0292 ℈ scruple ℥ ounce ℔ lb ℎ h ℏ hbar τ tau π pi # Greek letter pi 𝜋 pi # mathematical italic small pi α alpha σ sigma ‰ 1|1000 ‱ 1|10000 ′ ' # U+2032 ″ " # U+2033 # # Unicode currency symbols # ¢ cent £ britainpound ¥ japanyen € euro ₩ southkoreawon ₪ israelnewshekel ₤ lira # ₺ turkeylira # fails under MacOS ₨ rupee # unofficial legacy rupee sign # ₹ indiarupee # official rupee sign # MacOS fail #؋ afghanafghani # fails under MacOS ฿ thailandbaht ₡ elsalvadorcolon # Also costaricacolon ₣ francefranc ₦ nigerianaira ₧ spainpeseta ₫ vietnamdong ₭ laokip ₮ mongoliatugrik ₯ greecedrachma ₱ philippinepeso # ₲ paraguayguarani # fails under MacOS #₴ ukrainehryvnia # fails under MacOS #₵ ghanacedi # fails under MacOS #₸ kazakhstantenge # fails under MacOS #₼ azerbaijanmanat # fails under MacOS #₽ russiaruble # fails under MacOS #₾ georgialari # fails under MacOS ﷼ iranrial ﹩ $ ¢ ¢ £ £ ¥ ¥ ₩ ₩ # # Square Unicode symbols starting at U+3371 # ㍱ hPa ㍲ da ㍳ au ㍴ bar # ㍵ oV??? ㍶ pc #㍷ dm invalid on Mac #㍸ dm^2 invalid on Mac #㍹ dm^3 invalid on Mac ㎀ pA ㎁ nA ㎂ µA ㎃ mA ㎄ kA ㎅ kB ㎆ MB ㎇ GB ㎈ cal ㎉ kcal ㎊ pF ㎋ nF ㎌ µF ㎍ µg ㎎ mg ㎏ kg ㎐ Hz ㎑ kHz ㎒ MHz ㎓ GHz ㎔ THz ㎕ µL ㎖ mL ㎗ dL ㎘ kL ㎙ fm ㎚ nm ㎛ µm ㎜ mm ㎝ cm ㎞ km ㎟ mm^2 ㎠ cm^2 ㎡ m^2 ㎢ km^2 ㎣ mm^3 ㎤ cm^3 ㎥ m^3 ㎦ km^3 ㎧ m/s ㎨ m/s^2 ㎩ Pa ㎪ kPa ㎫ MPa ㎬ GPa ㎭ rad ㎮ rad/s ㎯ rad/s^2 ㎰ ps ㎱ ns ㎲ µs ㎳ ms ㎴ pV ㎵ nV ㎶ µV ㎷ mV ㎸ kV ㎹ MV ㎺ pW ㎻ nW ㎼ µW ㎽ mW ㎾ kW ㎿ MW ㏀ kΩ ㏁ MΩ ㏃ Bq ㏄ cc ㏅ cd ㏆ C/kg ㏈() dB ㏉ Gy ㏊ ha # ㏋ HP?? ㏌ in # ㏍ KK?? # ㏎ KM??? ㏏ kt ㏐ lm # ㏑ ln # ㏒ log ㏓ lx ㏔ mb ㏕ mil ㏖ mol ㏗() pH ㏙ ppm # ㏚ PR??? ㏛ sr ㏜ Sv ㏝ Wb #㏞ V/m Invalid on Mac #㏟ A/m Invalid on Mac #㏿ gal Invalid on Mac !endutf8 ############################################################################ # # Unit list aliases # # These provide a shorthand for conversions to unit lists. # ############################################################################ !unitlist hms hr;min;sec !unitlist time year;day;hr;min;sec !unitlist dms deg;arcmin;arcsec !unitlist ftin ft;in;1|8 in !unitlist inchfine in;1|8 in;1|16 in;1|32 in;1|64 in !unitlist usvol cup;3|4 cup;2|3 cup;1|2 cup;1|3 cup;1|4 cup;\ tbsp;tsp;1|2 tsp;1|4 tsp;1|8 tsp ############################################################################ # # The following units were in the Unix units database but do not appear in # this file: # # wey used for cheese, salt and other goods. Measured mass or # waymass volume depending on what was measured and where the measuring # took place. A wey of cheese ranged from 200 to 324 pounds. # # sack No precise definition # # spindle The length depends on the type of yarn # # block Defined variously on different computer systems # # erlang A unit of telephone traffic defined variously. # Omitted because there are no other units for this # dimension. Is this true? What about CCS = 1/36 erlang? # Erlang is supposed to be dimensionless. One erlang means # a single channel occupied for one hour. # ############################################################################ # # The following have been suggested or considered and deemed out of scope. # They will not be added to GNU units. # # Conversions between different calendar systems used in different countries or # different historical periods are out of scope for units and will not be added. # # Wind chill and heat index cannot be handled because they are bivarite, # with dependence on both the temperature and wind speed or humidity. # # Plain english text output like "one hectare is equivalent to one hundred # million square centimeters" is out of scope. # postgresql-unit-7.8/definitions.units.patch000066400000000000000000000302011450213077700212470ustar00rootroot00000000000000--- definitions.units 2023-01-04 18:22:06.602713513 +0200 +++ definitions.units.patched 2023-01-04 19:54:54.681679346 +0200 @@ -230,7 +230,7 @@ # equator to a pole. h_SI 6.62607015e-34 -h 6.62607015e-34 J s # Planck constant (exact) +h 6.62607015e-34 (m^2*kg/s^2) s # Planck constant (exact) kg ! # The kilogram, symbol kg, is the SI unit of mass. It is kilogram kg # defined by taking the fixed numerical value of the Planck @@ -279,7 +279,7 @@ # https://en.wikipedia.org/wiki/Kibble_balance k_SI 1.380649e-23 -boltzmann 1.380649e-23 J/K # Boltzmann constant (exact) +boltzmann 1.380649e-23 (m^2*kg/s^2)/K # Boltzmann constant (exact) k boltzmann K ! # The kelvin, symbol K, is the SI unit of thermodynamic @@ -322,7 +322,7 @@ # depend directly on temperature. e_SI 1.602176634e-19 -e 1.602176634e-19 C # electron charge (exact) +e 1.602176634e-19 A s # electron charge (exact) A ! # The ampere, symbol A, is the SI unit of electric current. ampere A # It is defined by taking the fixed numerical value of the @@ -425,7 +425,9 @@ # A primitive non-SI unit # -bit ! # Basic unit of information (entropy). The entropy in bits +B ! +byte B +bit 1|8 B # Basic unit of information (entropy). The entropy in bits # of a random variable over a finite alphabet is defined # to be the sum of -p(i)*log2(p(i)) over the alphabet where # p(i) is the probability that the random variable takes @@ -442,6 +444,8 @@ # # ########################################################################### +quetta- 1e30 +ronna- 1e27 yotta- 1e24 # Greek or Latin octo, "eight" zetta- 1e21 # Latin septem, "seven" exa- 1e18 # Greek hex, "six" @@ -464,6 +468,8 @@ atto- 1e-18 # Danish-Norwegian atten, "eighteen" zepto- 1e-21 # Latin septem, "seven" yocto- 1e-24 # Greek or Latin octo, "eight" +ronto- 1e-27 +quecto- 1e-30 quarter- 1|4 semi- 0.5 @@ -482,6 +488,8 @@ exbi- 2^60 zebi- 2^70 # Zebi- and yobi- were added in the 2005 ed., yobi- 2^80 # later superseded by ISO/IEC 80000-13:2008. +robi- 2^90 +quebi- 2^100 Ki- kibi Mi- mebi Gi- gibi @@ -490,7 +498,11 @@ Ei- exbi Zi- zebi Yi- yobi +Ri- robi +Qi- quebi +Q- quetta +R- ronna Y- yotta Z- zetta E- exa @@ -505,12 +517,15 @@ c- centi m- milli u- micro # it should be a mu but u is easy to type +mu- micro n- nano p- pico f- femto a- atto z- zepto y- yocto +r- ronto +q- quecto # # Names of some numbers @@ -683,6 +698,14 @@ padm 1e15 shankh 1e17 +# postgresql-unit: Define some units before they are used elsewhere before their original definition +pi 3.14159265358979323846 +π pi +astronomicalunit 149597870700 m # IAU definition from 2012, exact +au astronomicalunit # ephemeris for the above described +m2 m^2 + + ############################################################################# # # # Derived units which can be reduced to the primitive units # @@ -962,7 +985,7 @@ pointangle 1|32 circle # Used for reporting compass readings centrad 0.01 radian # Used for angular deviation of light # through a prism. -mas milli arcsec # Used by astronomers +mas milliarcsec # Used by astronomers seclongitude circle (seconds/day) # Astronomers measure longitude # (which they call right ascension) in # time units by dividing the equator into @@ -1083,8 +1106,8 @@ tempF(x) units=[1;K] domain=[-459.67,) range=[0,) \ (x+(-32)) degF + stdtemp ; (tempF+(-stdtemp))/degF + 32 tempfahrenheit() tempF -degfahrenheit 5|9 degC -degF 5|9 degC +degfahrenheit 5|9 * degC +degF 5|9 * degC degreesrankine degF # The Rankine scale has the @@ -1096,7 +1119,7 @@ tempreaumur(x) units=[1;K] domain=[-218.52,) range=[0,) \ x degreaumur+stdtemp ; (tempreaumur+(-stdtemp))/degreaumur -degreaumur 10|8 degC # The Reaumur scale was used in Europe and +degreaumur 10|8 * degC # The Reaumur scale was used in Europe and # particularly in France. It is defined # to be 0 at the freezing point of water # and 80 at the boiling point. Reaumur @@ -1184,7 +1207,7 @@ # Basic constants -pi 3.14159265358979323846 +#pi 3.14159265358979323846 tau 2 pi phi (sqrt(5)+1)/2 light c @@ -1341,6 +1364,15 @@ H2O50C 0.98807 force gram / cm^3 H2O100C 0.95838 force gram / cm^3 +# moved because ft is used before being defined (and otherwise parsed as femtotonne) +inch 2.54 cm +in inch +inches inch +foot 12 inch +feet foot +ft foot +ft3 ft^3 + # Atomic constants hartree 4.3597447222071e-18 J # Approximate electric potential energy @@ -1715,7 +1747,7 @@ abampere 10 A # Current which produces a force of abamp abampere # 2 dyne/cm between two infinitely -aA abampere # long wires that are 1 cm apart +#aA abampere # long wires that are 1 cm apart abA abampere biot abampere Bi biot @@ -2668,8 +2700,8 @@ # gravitational constant. This is a # fictional year, and doesn't # correspond to any celestial event. -astronomicalunit 149597870700 m # IAU definition from 2012, exact -au astronomicalunit # ephemeris for the above described +#astronomicalunit 149597870700 m # IAU definition from 2012, exact +#au astronomicalunit # ephemeris for the above described # astronomical unit. (See the NASA # site listed above.) GMsun 132712440041.279419 km^3 / s^2 # heliocentric gravitational constant @@ -3003,11 +3035,6 @@ int 3937|1200 ft/m # Convert US Survey measures to int- int # international measures -inch 2.54 cm -in inch -foot 12 inch -feet foot -ft foot yard 3 ft yd yard mile 5280 ft # The mile was enlarged from 5000 ft @@ -3155,6 +3182,7 @@ # Liquid measure usgallon 231 in^3 # US liquid measure is derived from +gallon usgallon gal gallon # the British wine gallon of 1707. quart 1|4 gallon # See the "winegallon" entry below pint 1|2 quart # more historical information. @@ -3656,7 +3684,7 @@ number1can 10 usfloz number2can 19 usfloz -number2.5can 3.5 uscups +number2_5can 3.5 uscups number3can 4 uscups number5can 7 uscups number10can 105 usfloz @@ -4618,10 +4646,10 @@ btu btu_IT # International Table BTU is the default britishthermalunit btu -btu_IT cal_IT lb degF / gram K -btu_th cal_th lb degF / gram K -btu_mean cal_mean lb degF / gram K -btu_15 cal_15 lb degF / gram K +btu_IT cal_IT lb (degF) / gram K +btu_th cal_th lb (degF) / gram K +btu_mean cal_mean lb (degF) / gram K +btu_15 cal_15 lb (degF) / gram K btu_ISO 1055.06 J # Exact, rounded ISO definition based # on the IT calorie quad quadrillion btu @@ -4784,7 +4812,7 @@ # Celsius heat unit: energy to raise a pound of water 1 degC -celsiusheatunit cal lb degC / gram K +celsiusheatunit cal lb (degC) / gram K chu celsiusheatunit # "Apparent" average power in an AC circuit, the product of rms voltage @@ -4842,13 +4870,13 @@ Uvalue 1/Rvalue europeanUvalue watt / m^2 K RSI degC m^2 / W -clo 0.155 degC m^2 / W # Supposed to be the insulance +clo 0.155 * degC m^2 / W # Supposed to be the insulance # required to keep a resting person # comfortable indoors. The value # given is from NIST and the CRC, # but [5] gives a slightly different # value of 0.875 ft^2 degF hr / btu. -tog 0.1 degC m^2 / W # Also used for clothing. +tog 0.1 * degC m^2 / W # Also used for clothing. # Thermal Conductivity of a few materials @@ -5352,8 +5380,8 @@ # to symbols per second. Modern # modems transmit several bits # per symbol. -byte 8 bit # Not all machines had 8 bit -B byte # bytes, but these days most of +#byte 8 bit # Not all machines had 8 bit +#B byte # bytes, but these days most of # them do. But beware: for # transmission over modems, a # few extra bits are used so @@ -6800,7 +6828,7 @@ pa Pa ev eV -hg Hg +#hg Hg oe Oe mh mH rd rod @@ -7182,7 +7210,8 @@ Mag Maz gravity # force Maz Volm kg / oldliter # mass based on water -Tm Tim # Abbreviations +#gross conflict with terameter +#Tm Tim # Abbreviations Gf Grafut Sf Surf Vm Volm @@ -7972,7 +8001,7 @@ ton uston scruple apscruple fluidounce usfluidounce -gallon usgallon +#gallon usgallon bushel usbushel quarter quarterweight cup uscup postgresql-unit-7.8/definitions.units.patched000066400000000000000000012643321450213077700215770ustar00rootroot00000000000000# # This file is the units database for use with GNU units, a units conversion # program by Adrian Mariano adrianm@gnu.org # # September 2022 Version 3.15 # # Copyright (C) 1996-2002, 2004-2020, 2022 # Free Software Foundation, Inc # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, # Boston, MA 02110-1301 USA # ############################################################################ # # Improvements and corrections are welcome. # # See the end of this file for a list of items we have chosen to exclude # or have decided are out of scope for GNU units. # # Fundamental constants in this file are the 2018 CODATA recommended values. # # Most units data was drawn from # 1. NIST Special Publication 811, Guide for the # Use of the International System of Units (SI). # Barry N. Taylor. 2008 # https://www.nist.gov/pml/special-publication-811 # 2. CRC Handbook of Chemistry and Physics 70th edition # 3. Oxford English Dictionary # 4. Webster's New Universal Unabridged Dictionary # 5. Units of Measure by Stephen Dresner # 6. A Dictionary of English Weights and Measures by Ronald Zupko # 7. British Weights and Measures by Ronald Zupko # 8. Realm of Measure by Isaac Asimov # 9. United States standards of weights and measures, their # creation and creators by Arthur H. Frazier. # 10. French weights and measures before the Revolution: a # dictionary of provincial and local units by Ronald Zupko # 11. Weights and Measures: their ancient origins and their # development in Great Britain up to AD 1855 by FG Skinner # 12. The World of Measurements by H. Arthur Klein # 13. For Good Measure by William Johnstone # 14. NTC's Encyclopedia of International Weights and Measures # by William Johnstone # 15. Sizes by John Lord # 16. Sizesaurus by Stephen Strauss # 17. CODATA Recommended Values of Physical Constants available at # http://physics.nist.gov/cuu/Constants/index.html # 18. How Many? A Dictionary of Units of Measurement. Available at # http://www.ibiblio.org/units/ # 19. Numericana. http://www.numericana.com # 20. UK history of measurement # http://www.ukmetrication.com/history.htm # 21. NIST Handbook 44, Specifications, Tolerances, and # Other Technical Requirements for Weighing and Measuring # Devices. 2011 # 22. NIST Special Publication 447, Weights and Measures Standards # of the the United States: a brief history. Lewis V. Judson. # 1963; rev. 1976 # 23. CRC Handbook of Chemistry and Physics, 96th edition # 24. Dictionary of Scientific Units, 6th ed. H.G. Jerrard and D.B. # McNeill. 1992 # 25. NIST Special Publication 330, The International System of # Units (SI). ed. Barry N. Taylor and Ambler Thompson. 2008 # https://www.nist.gov/pml/special-publication-330 # 26. BIPM Brochure, The International System of Units (SI). # 9th ed., 2019 # https://www.bipm.org/en/publications/si-brochure/ # ########################################################################### # # If units you use are missing or defined incorrectly, please contact me. # If your country's local units are missing and you are willing to supply # them, please send me a list. # ########################################################################### ########################################################################### # # Brief Philosophy of this file # # Most unit definitions are made in terms of integers or simple fractions of # other definitions. The typical exceptions are when converting between two # different unit systems, or the values of measured physical constants. In # this file definitions are given in the most natural and revealing way in # terms of integer factors. # # If you make changes be sure to run 'units --check' to check your work. # # The file is USA-centric, but there is some modest effort to support other # countries. This file is now coded in UTF-8. To support environments where # UTF-8 is not available, definitions that require this character set are # wrapped in !utf8 directives. # # When a unit name is used in different countries with the different meanings # the system should be as follows: # # Suppose countries ABC and XYZ both use the "foo". Then globally define # # ABCfoo # XYZfoo # # Then, using the !locale directive, define the "foo" appropriately for each of # the two countries with a definition like # # !locale ABC # foo ABCfoo # !endlocale # ########################################################################### !locale en_US ! set UNITS_ENGLISH US !endlocale !locale en_GB ! set UNITS_ENGLISH GB !endlocale !set UNITS_ENGLISH US # Default setting for English units !set UNITS_SYSTEM default # Set a default value !varnot UNITS_SYSTEM si emu esu gaussian gauss hlu natural natural-gauss hartree planck planck-red default !message Unknown unit system given with -u or UNITS_SYSTEM environment variable !message Valid systems: si, emu, esu, gauss[ian], hlu, natural, natural-gauss !message planck, planck-red, hartree !message Using SI !prompt (SI) !endvar !var UNITS_SYSTEM si !message SI units selected !prompt (SI) !endvar ########################################################################### # # # Primitive units. Any unit defined to contain a '!' character is a # # primitive unit which will not be reduced any further. All units should # # reduce to primitive units. # # # ########################################################################### # # SI units # # On 20 May 2019, the SI was revised to define the units by fixing the # values of physical constants that depend on those units. # # https://www.nist.gov/si-redefinition/ # # The BIPM--the International Bureau of Weights and Measures--provides a # succinct description of the new SI in its Concise Summary: # # https://www.bipm.org/utils/common/pdf/si-brochure/SI-Brochure-9-concise-EN.pdf # # The SI is the system of units in which: # # * the unperturbed ground state hyperfine transition frequency of the # caesium 133 atom is delta nu_Cs = 9 192 631 770 Hz, # * the speed of light in vacuum, c, is 299 792 458 m/s, # * the Planck constant, h, is 6.626 070 15 * 10^-34 J s, # * the elementary charge, e, is 1.602 176 634 * 10^-19 C, # * the Boltzmann constant, k, is 1.380 649 * 10^-23 J/K, # * the Avogadro constant, N_A, is 6.022 140 76 * 10^23 mol^-1, # * the luminous efficacy of monochromatic radiation of frequency # 540 * 10^12 Hz, K_cd, is 683 lm/W, # # where the hertz, joule, coulomb, lumen, and watt, with unit symbols Hz, # J, C, lm, and W, respectively, are related to the units second, metre, # kilogram, ampere, kelvin, mole, and candela, with unit symbols s, m, kg, # A, K, mol, and cd, respectively, according to Hz = s^–1, J = kg m^2 s^–2, # C = A s, lm = cd m^2 m^–2 = cd sr, and W = kg m^2 s^–3. # # These definitions specify the exact numerical value of each constant when # its value is expressed in the corresponding SI unit. By fixing the exact # numerical value the unit becomes defined, since the product of the # numerical value and the unit has to equal the value of the constant, # which is invariant. # # The defining constants have been chosen such that, when taken together, # their units cover all of the units of the SI. In general, there is no # one-to-one correspondence between the defining constants and the SI base # units. Any SI unit is a product of powers of these seven constants and a # dimensionless factor. # # Until 2018, the SI was defined in terms of base units and derived units. # These categories are no longer essential in the SI, but they are maintained # in view of their convenience and widespread use. They are arguably more # intuitive than the new definitions. (They are also essential to the # operation of GNU units.) The definitions of the base units, which follow # from the definition of the SI in terms of the seven defining constants, are # given below. # s ! # The second, symbol s, is the SI unit of time. It is defined second s # by taking the fixed numerical value of the unperturbed # ground-state hyperfine transition frequency of the # cesium-133 atom to be 9 192 631 770 when expressed in the # unit Hz, which is equal to 1/s. # # This definition is a restatement of the previous one, the # duration of 9192631770 periods of the radiation corresponding # to the cesium-133 transition. c_SI 299792458 c 299792458 m/s # speed of light in vacuum (exact) m ! # The metre, symbol m, is the SI unit of length. It is meter m # defined by taking the fixed numerical value of the speed metre m # of light in vacuum, c, to be 299 792 458 when expressed in # units of m/s. # # This definition is a rewording of the previous one and is # equivalent to defining the meter as the distance light # travels in 1|299792458 seconds. The meter was originally # intended to be 1e-7 of the length along a meridian from the # equator to a pole. h_SI 6.62607015e-34 h 6.62607015e-34 (m^2*kg/s^2) s # Planck constant (exact) kg ! # The kilogram, symbol kg, is the SI unit of mass. It is kilogram kg # defined by taking the fixed numerical value of the Planck # constant, h, to be 6.626 070 15 * 10^-34 when expressed in # the unit J s which is equal to kg m^2 / s. # # One advantage of fixing h to define the kilogram is that this # affects constants used to define the ampere. If the kg were # defined by directly fixing the mass of something, then h # would be subject to error. # # The previous definition of the kilogram was the mass of the # international prototype kilogram. The kilogram was the last # unit whose definition relied on reference to an artifact. # # It is not obvious what this new definition means, or # intuitively how fixing Planck's constant defines the # kilogram. To define the kilogram we need to give the mass # of some reference in kilograms. Previously the prototype in # France served as this reference, and it weighed exactly 1 # kg. But the reference can have any weight as long as you # know the weight of the reference. The new definition uses # the "mass" of a photon, or more accurately, the mass # equivalent of the energy of a photon. The energy of a # photon depends on its frequency. If you pick a frequency, # f, then the energy of the photon is hf, and hence the mass # equivalent is hf/c^2. If we reduce this expression using # the constant defined values for h and c the result is a # value in kilograms for the mass-equivalent of a photon of # frequency f, which can therefore define the size of the # kilogram. # # For more on the relationship between mass an Planck's # constant: # # https://www.nist.gov/si-redefinition/kilogram-mass-and-plancks-constant # This definition may still seem rather abstract: you can't # place a "kilogram of radiation" on one side of a balance. # Metrologists realize the kilogram using a Kibble Balance, a # device which relates mechanical energy to electrical energy # and can measure mass with extreme accuracy if h is known. # # For more on the Kibble Balance see # # https://www.nist.gov/si-redefinition/kilogram-kibble-balance # https://en.wikipedia.org/wiki/Kibble_balance k_SI 1.380649e-23 boltzmann 1.380649e-23 (m^2*kg/s^2)/K # Boltzmann constant (exact) k boltzmann K ! # The kelvin, symbol K, is the SI unit of thermodynamic kelvin K # temperature. It is defined by taking the fixed numerical # value of the Boltzmann constant, k, to be 1.380 649 * 10^-23 # when expressed in the unit J/K, which is equal to # kg m^2/s^2 K. # # The boltzmann constant establishes the relationship between # energy and temperature. The average thermal energy carried # by each degree of freedom is kT/2. A monatomic ideal gas # has three degrees of freedom corresponding to the three # spatial directions, which means its thermal energy is # (3/2) k T. # # The previous definition of the kelvin was based on the # triple point of water. The change in the definition of the # kelvin will not have much effect on measurement practice. # Practical temperature calibration makes use of two scales, # the International Temperature Scale of 1990 (ITS-90), which # covers the range of 0.65 K to 1357.77K and the Provisional # Low Temperature Scale of 2000 (PLTS-2000), which covers the # range of 0.9 mK to 1 K. # https://www.bipm.org/en/committees/cc/cct/publications-cc.html # # The ITS-90 contains 17 reference points including things # like the triple point of hydrogen (13.8033 K) or the # freezing point of gold (1337.33 K), and of course the triple # point of water. The PLTS-2000 specifies four reference # points, all based on properties of helium-3. # # The redefinition of the kelvin will not affect the values of # these reference points, which have been determined by # primary thermometry, using thermometers that rely only on # relationships that allow temperature to be calculated # directly without using any unknown quantities. Examples # include acoustic thermometers, which measure the speed of # sound in a gas, or electronic thermometers, which measure # tiny voltage fluctuations in resistors. Both variables # depend directly on temperature. e_SI 1.602176634e-19 e 1.602176634e-19 A s # electron charge (exact) A ! # The ampere, symbol A, is the SI unit of electric current. ampere A # It is defined by taking the fixed numerical value of the amp ampere # elementary charge, e, to be 1.602 176 634 * 10^-19 when # expressed in the unit C, which is equal to A*s. # # The previous definition was the current which produces a # force of 2e-7 N/m between two infinitely long wires a meter # apart. This definition was difficult to realize accurately. # # The ampere is actually realized by establishing the volt and # the ohm, since A = V / ohm. These measurements can be done # using the Josephson effect and the quantum Hall effect, # which accurately measure voltage and resistance, respectively, # with reference to two fixed constants, the Josephson # constant, K_J=2e/h and the von Klitzing constant, R_K=h/e^2. # Under the previous SI system, these constants had official # fixed values, defined in 1990. This created a situation # where the standard values for the volt and ohm were in some # sense outside of SI because they depended primarily on # constants different from the ones used to define SI. After # the revision, since e and h have exact definitions, the # Josephson and von Klitzing constants will also have exact # definitions that derive from SI instead of the conventional # 1990 values. # # In fact we know that there is a small offset between the # conventional values of the electrical units based on the # conventional 1990 values and the SI values. The new # definition, which brings the practical electrical units back # into SI, will lead to a one time change of +0.1ppm for # voltage values and +0.02ppm for resistance values. # # The previous definition resulted in fixed exact values for # the vacuum permeability (mu0), the impedance of free space # (Z0), the vacuum permittivity (epsilon0), and the Coulomb # constant. With the new definition, these four values are # subject to experimental error. avogadro 6.02214076e23 / mol # Size of a mole (exact) N_A avogadro mol ! # The mole, symbol mol, is the SI unit of amount of mole mol # substance. One mole contains exactly 6.022 140 76 * 10^23 # elementary entities. This number is the fixed numerical # value of the Avogadro constant, N_A, when expressed in the # unit 1/mol and is called the Avogadro number. The amount of # substance, symbol n, of a system is a measure of the number # of specified elementary entities. An elementary entity may # be an atom, a molecule, an ion, an electron, any other # particle or specified group of particles. # # The atomic mass unit (u) is defined as 1/12 the mass of # carbon-12. Previously the mole was defined so that a mole # of carbon-12 weighed exactly 12g, or N_A u = 1 g/mol # exactly. This relationship is now an experimental, # approximate relationship. # # To determine the size of the mole, researchers used spheres # of very pure silicon-28 that weighed a kilogram. They # measured the molar mass of Si-28 using mass spectrometry and # used X-ray diffraction interferometry to determine the # spacing of the silicon atoms in the sphere. Using the # sphere's volume it was then possible to determine the number # of silicon atoms in the sphere, and hence determine the # Avogadro constant. The results of this experiment were used to # define N_A, which is henceforth a fixed, unchanging quantity. cd ! # The candela, symbol cd, is the SI unit of luminous intensity candela cd # in a given direction. It is defined by taking the fixed # numerical value of the luminous efficacy of monochromatic # radiation of the frequency 540e12 Hz to be 683 when # expressed in the unit lumen/watt, which is equal to # cd sr/W, or cd sr s^3/kg m^2 # # This definition is a rewording of the previous definition. # Luminous intensity differs from radiant intensity (W/sr) in # that it is adjusted for human perceptual dependence on # wavelength. The frequency of 540e12 Hz (yellow; # wavelength approximately 555 nm in vacuum) is where human # perception is most efficient. # # The radian and steradian are defined as dimensionless primitive units. # The radian is equal to m/m and the steradian to m^2/m^2 so these units are # dimensionless. Retaining them as named units is useful because it allows # clarity in expressions and makes the meaning of unit definitions more clear. # These units will reduce to 1 in conversions but not for sums of units or for # arguments to functions. # radian !dimensionless # The angle subtended at the center of a circle by # an arc equal in length to the radius of the # circle sr !dimensionless # Solid angle which cuts off an area of the surface steradian sr # of the sphere equal to that of a square with # sides of length equal to the radius of the # sphere # # A primitive non-SI unit # B ! byte B bit 1|8 B # Basic unit of information (entropy). The entropy in bits # of a random variable over a finite alphabet is defined # to be the sum of -p(i)*log2(p(i)) over the alphabet where # p(i) is the probability that the random variable takes # on the value i. # # Currency: the primitive unit of currency is defined in currency.units. # It is usually the US$ or the euro, but it is user selectable. # ########################################################################### # # # Prefixes (longer names must come first) # # # ########################################################################### quetta- 1e30 ronna- 1e27 yotta- 1e24 # Greek or Latin octo, "eight" zetta- 1e21 # Latin septem, "seven" exa- 1e18 # Greek hex, "six" peta- 1e15 # Greek pente, "five" tera- 1e12 # Greek teras, "monster" giga- 1e9 # Greek gigas, "giant" mega- 1e6 # Greek megas, "large" myria- 1e4 # Not an official SI prefix kilo- 1e3 # Greek chilioi, "thousand" hecto- 1e2 # Greek hekaton, "hundred" deca- 1e1 # Greek deka, "ten" deka- deca deci- 1e-1 # Latin decimus, "tenth" centi- 1e-2 # Latin centum, "hundred" milli- 1e-3 # Latin mille, "thousand" micro- 1e-6 # Latin micro or Greek mikros, "small" nano- 1e-9 # Latin nanus or Greek nanos, "dwarf" pico- 1e-12 # Spanish pico, "a bit" femto- 1e-15 # Danish-Norwegian femten, "fifteen" atto- 1e-18 # Danish-Norwegian atten, "eighteen" zepto- 1e-21 # Latin septem, "seven" yocto- 1e-24 # Greek or Latin octo, "eight" ronto- 1e-27 quecto- 1e-30 quarter- 1|4 semi- 0.5 demi- 0.5 hemi- 0.5 half- 0.5 double- 2 triple- 3 treble- 3 kibi- 2^10 # In response to the improper and confusing mebi- 2^20 # use of SI prefixes for powers of two, gibi- 2^30 # the International Electrotechnical tebi- 2^40 # Commission aproved these binary prefixes pebi- 2^50 # in IEC 60027-2 Amendment 2 (1999). exbi- 2^60 zebi- 2^70 # Zebi- and yobi- were added in the 2005 ed., yobi- 2^80 # later superseded by ISO/IEC 80000-13:2008. robi- 2^90 quebi- 2^100 Ki- kibi Mi- mebi Gi- gibi Ti- tebi Pi- pebi Ei- exbi Zi- zebi Yi- yobi Ri- robi Qi- quebi Q- quetta R- ronna Y- yotta Z- zetta E- exa P- peta T- tera G- giga M- mega k- kilo h- hecto da- deka d- deci c- centi m- milli u- micro # it should be a mu but u is easy to type mu- micro n- nano p- pico f- femto a- atto z- zepto y- yocto r- ronto q- quecto # # Names of some numbers # one 1 two 2 double 2 couple 2 three 3 triple 3 four 4 quadruple 4 five 5 quintuple 5 six 6 seven 7 eight 8 nine 9 ten 10 eleven 11 twelve 12 thirteen 13 fourteen 14 fifteen 15 sixteen 16 seventeen 17 eighteen 18 nineteen 19 twenty 20 thirty 30 forty 40 fifty 50 sixty 60 seventy 70 eighty 80 ninety 90 hundred 100 thousand 1000 million 1e6 twoscore two score threescore three score fourscore four score fivescore five score sixscore six score sevenscore seven score eightscore eight score ninescore nine score tenscore ten score twelvescore twelve score # These number terms were described by N. Chuquet and De la Roche in the 16th # century as being successive powers of a million. These definitions are still # used in most European countries. The current US definitions for these # numbers arose in the 17th century and don't make nearly as much sense. These # numbers are listed in the CRC Concise Encyclopedia of Mathematics by Eric # W. Weisstein. shortbillion 1e9 shorttrillion 1e12 shortquadrillion 1e15 shortquintillion 1e18 shortsextillion 1e21 shortseptillion 1e24 shortoctillion 1e27 shortnonillion 1e30 shortnoventillion shortnonillion shortdecillion 1e33 shortundecillion 1e36 shortduodecillion 1e39 shorttredecillion 1e42 shortquattuordecillion 1e45 shortquindecillion 1e48 shortsexdecillion 1e51 shortseptendecillion 1e54 shortoctodecillion 1e57 shortnovemdecillion 1e60 shortvigintillion 1e63 centillion 1e303 googol 1e100 longbillion million^2 longtrillion million^3 longquadrillion million^4 longquintillion million^5 longsextillion million^6 longseptillion million^7 longoctillion million^8 longnonillion million^9 longnoventillion longnonillion longdecillion million^10 longundecillion million^11 longduodecillion million^12 longtredecillion million^13 longquattuordecillion million^14 longquindecillion million^15 longsexdecillion million^16 longseptdecillion million^17 longoctodecillion million^18 longnovemdecillion million^19 longvigintillion million^20 # These numbers fill the gaps left by the long system above. milliard 1000 million billiard 1000 million^2 trilliard 1000 million^3 quadrilliard 1000 million^4 quintilliard 1000 million^5 sextilliard 1000 million^6 septilliard 1000 million^7 octilliard 1000 million^8 nonilliard 1000 million^9 noventilliard nonilliard decilliard 1000 million^10 # For consistency longmilliard milliard longbilliard billiard longtrilliard trilliard longquadrilliard quadrilliard longquintilliard quintilliard longsextilliard sextilliard longseptilliard septilliard longoctilliard octilliard longnonilliard nonilliard longnoventilliard noventilliard longdecilliard decilliard # The long centillion would be 1e600. The googolplex is another # familiar large number equal to 10^googol. These numbers give overflows. # # The short system prevails in English speaking countries # billion shortbillion trillion shorttrillion quadrillion shortquadrillion quintillion shortquintillion sextillion shortsextillion septillion shortseptillion octillion shortoctillion nonillion shortnonillion noventillion shortnoventillion decillion shortdecillion undecillion shortundecillion duodecillion shortduodecillion tredecillion shorttredecillion quattuordecillion shortquattuordecillion quindecillion shortquindecillion sexdecillion shortsexdecillion septendecillion shortseptendecillion octodecillion shortoctodecillion novemdecillion shortnovemdecillion vigintillion shortvigintillion # # Numbers used in India # lakh 1e5 crore 1e7 arab 1e9 kharab 1e11 neel 1e13 padm 1e15 shankh 1e17 # postgresql-unit: Define some units before they are used elsewhere before their original definition pi 3.14159265358979323846 π pi astronomicalunit 149597870700 m # IAU definition from 2012, exact au astronomicalunit # ephemeris for the above described m2 m^2 ############################################################################# # # # Derived units which can be reduced to the primitive units # # # ############################################################################# # # Named SI derived units (officially accepted) # newton kg m / s^2 # force N newton pascal N/m^2 # pressure or stress Pa pascal joule N m # energy J joule watt J/s # power W watt coulomb A s # charge C coulomb volt W/A # potential difference V volt ohm V/A # electrical resistance siemens A/V # electrical conductance S siemens farad C/V # capacitance F farad weber V s # magnetic flux Wb weber henry V s / A # inductance H henry tesla Wb/m^2 # magnetic flux density T tesla hertz /s # frequency Hz hertz # # Dimensions. These are here to help with dimensional analysis and # because they will appear in the list produced by hitting '?' at the # "You want:" prompt to tell the user the dimension of the unit. # LENGTH meter AREA LENGTH^2 VOLUME LENGTH^3 MASS kilogram AMOUNT mole ANGLE radian SOLID_ANGLE steradian MONEY US$ FORCE newton PRESSURE FORCE / AREA STRESS FORCE / AREA FREQUENCY hertz VELOCITY LENGTH / TIME ACCELERATION VELOCITY / TIME MOMENTUM MASS VELOCITY IMPULSE FORCE TIME DISPLACEMENT LENGTH DISTANCE LENGTH ELONGATION LENGTH STRAIN ELONGATION / LENGTH ENERGY joule POWER watt WORK FORCE DISTANCE DENSITY MASS / VOLUME LINEAR_DENSITY MASS / LENGTH VISCOSITY FORCE TIME / AREA KINEMATIC_VISCOSITY VISCOSITY / DENSITY CURRENT ampere CHARGE coulomb CAPACITANCE farad RESISTANCE ohm CONDUCTANCE siemens # It may be easier to understand the relationship by considering # an object with specified dimensions and resistivity, whose # resistance is given by the resistivity * length / area. RESISTIVITY RESISTANCE AREA / LENGTH CONDUCTIVITY CONDUCTANCE LENGTH / AREA INDUCTANCE henry E_FIELD ELECTRIC_POTENTIAL / LENGTH B_FIELD tesla # The D and H fields are related to the E and B fields by factors of # epsilon and mu respectively, so their units can be found by # multiplying/dividing by the epsilon0 and mu0. The more complex # definitions below make it possible to use D_FIELD and E_FIELD to # convert between SI and CGS units for these dimensions. D_FIELD E_FIELD epsilon0 / epsilon0_SI # mu0_SI c^2 F / m H_FIELD B_FIELD / (mu0/mu0_SI) ELECTRIC_DIPOLE_MOMENT C m MAGNETIC_DIPOLE_MOMENT J / T POLARIZATION ELECTRIC_DIPOLE_MOMENT / VOLUME MAGNETIZATION MAGNETIC_DIPOLE_MOMENT / VOLUME ELECTRIC_POTENTIAL ENERGY / CHARGE #volt VOLTAGE ELECTRIC_POTENTIAL E_FLUX E_FIELD AREA D_FLUX D_FIELD AREA B_FLUX B_FIELD AREA H_FLUX H_FIELD AREA # # units derived easily from SI units # gram millikg gm gram g gram tonne 1000 kg t tonne metricton tonne sthene tonne m / s^2 funal sthene pieze sthene / m^2 quintal 100 kg bar 1e5 Pa # About 1 atm b bar vac millibar micron micrometer # One millionth of a meter bicron picometer # One brbillionth of a meter cc cm^3 are 100 m^2 a are liter 1000 cc # The liter was defined in 1901 as the oldliter 1.000028 dm^3 # space occupied by 1 kg of pure water at L liter # the temperature of its maximum density l liter # under a pressure of 1 atm. This was # supposed to be 1000 cubic cm, but it # was discovered that the original # measurement was off. In 1964, the # liter was redefined to be exactly 1000 # cubic centimeters. Ah amp hour # Unit of charge mho siemens # Inverse of ohm, hence ohm spelled backward galvat ampere # Named after Luigi Galvani angstrom 1e-10 m # Convenient for describing molecular sizes xunit xunit_cu # Used for measuring x-ray wavelengths. siegbahn xunit # Originally defined to be 1|3029.45 of xunit_cu 1.00207697e-13 m # the spacing of calcite planes at 18 xunit_mo 1.00209952e-13 m # degC. It was intended to be exactly # 1e-13 m, but was later found to be # slightly off. Current usage is with # reference to common x-ray lines, either # the K-alpha 1 line of copper or the # same line of molybdenum. angstromstar 1.00001495 angstrom # Defined by JA Bearden in 1965 to replace # the X unit. The wavelength of the # tungsten K alpha1 line was defined as # exactly 0.20901 angstrom star, with the # valule chosen to try to make the new # unit close to the angstrom. silicon_d220 1.920155716e-10 m # Silicon lattice spacing siliconlattice sqrt(8) silicon_d220# Silicon lattice parameter, (a), the side # length of the unit cell for the diamond # centered cubic structure of silicon. fermi 1e-15 m # Convenient for describing nuclear sizes # Nuclear radius is from 1 to 10 fermis barn 1e-28 m^2 # Used to measure cross section for # particle physics collision, said to # have originated in the phrase "big as # a barn". shed 1e-24 barn # Defined to be a smaller companion to the # barn, but it's too small to be of # much use. brewster micron^2/N # measures stress-optical coef diopter /m # measures reciprocal of lens focal length fresnel 1e12 Hz # occasionally used in spectroscopy shake 1e-8 sec svedberg 1e-13 s # Used for measuring the sedimentation # coefficient for centrifuging. gamma microgram # Also used for 1e-9 tesla lambda microliter spat 1e12 m # Rarely used for astronomical measurements preece 1e13 ohm m # resistivity planck J s # action of one joule over one second sturgeon /henry # magnetic reluctance daraf 1/farad # elastance (farad spelled backwards) leo 10 m/s^2 poiseuille N s / m^2 # viscosity mayer J/g K # specific heat mired / microK # reciprocal color temperature. The name # abbreviates micro reciprocal degree. crocodile megavolt # used informally in UK physics labs metricounce 25 g mounce metricounce finsenunit 1e5 W/m^2 # Measures intensity of ultraviolet light # with wavelength 296.7 nm. fluxunit 1e-26 W/m^2 Hz # Used in radio astronomy to measure # the energy incident on the receiving # body across a specified frequency # bandwidth. [12] jansky fluxunit # K. G. Jansky identified radio waves coming Jy jansky # from outer space in 1931. flick W / cm^2 sr micrometer # Spectral radiance or irradiance pfu / cm^2 sr s # particle flux unit -- Used to measure # rate at which particles are received by # a spacecraft as particles per solid # angle per detector area per second. [18] pyron cal_IT / cm^2 min # Measures heat flow from solar radiation, # from Greek work "pyr" for fire. katal mol/sec # Measure of the amount of a catalyst. One kat katal # katal of catalyst enables the reaction # to consume or produce one mol/sec. solarluminosity 382.8e24 W # A common yardstick for comparing the # output of different stars. # http://nssdc.gsfc.nasa.gov/planetary/factsheet/sunfact.html # at mean Earth-Sun distance solarirradiance solarluminosity / (4 pi sundist^2) solarconstant solarirradiance TSI solarirradiance # total solar irradiance # # time # sec s minute 60 s min minute hour 60 min hr hour day 24 hr d day da day week 7 day wk week sennight 7 day fortnight 14 day blink 1e-5 day # Actual human blink takes 1|3 second ce 1e-2 day cron 1e6 years watch 4 hours # time a sentry stands watch or a ship's # crew is on duty. bell 1|8 watch # Bell would be sounded every 30 minutes. # French Revolutionary Time or Decimal Time. It was Proposed during # the French Revolution. A few clocks were made, but it never caught # on. In 1998 Swatch defined a time measurement called ".beat" and # sold some watches that displayed time in this unit. decimalhour 1|10 day decimalminute 1|100 decimalhour decimalsecond 1|100 decimalminute beat decimalminute # Swatch Internet Time # # angular measure # circle 2 pi radian degree 1|360 circle deg degree arcdeg degree arcmin 1|60 degree arcminute arcmin ' arcmin arcsec 1|60 arcmin arcsecond arcsec " arcsec '' " rightangle 90 degrees quadrant 1|4 circle quintant 1|5 circle sextant 1|6 circle sign 1|12 circle # Angular extent of one sign of the zodiac turn circle revolution turn rev turn pulsatance radian / sec gon 1|100 rightangle # measure of grade grade gon centesimalminute 1|100 grade centesimalsecond 1|100 centesimalminute milangle 1|6400 circle # Official NIST definition. # Another choice is 1e-3 radian. pointangle 1|32 circle # Used for reporting compass readings centrad 0.01 radian # Used for angular deviation of light # through a prism. mas milliarcsec # Used by astronomers seclongitude circle (seconds/day) # Astronomers measure longitude # (which they call right ascension) in # time units by dividing the equator into # 24 hours instead of 360 degrees. # # Some geometric formulas # circlearea(r) units=[m;m^2] range=[0,) pi r^2 ; sqrt(circlearea/pi) spherevolume(r) units=[m;m^3] range=[0,) 4|3 pi r^3 ; \ cuberoot(spherevolume/4|3 pi) spherevol() spherevolume square(x) range=[0,) x^2 ; sqrt(square) # # Solid angle measure # sphere 4 pi sr squaredegree 1|180^2 pi^2 sr squareminute 1|60^2 squaredegree squaresecond 1|60^2 squareminute squarearcmin squareminute squarearcsec squaresecond sphericalrightangle 0.5 pi sr octant 0.5 pi sr # # Concentration measures # percent 0.01 % percent mill 0.001 # Originally established by Congress in 1791 # as a unit of money equal to 0.001 dollars, # it has come to refer to 0.001 in general. # Used by some towns to set their property # tax rate, and written with a symbol similar # to the % symbol but with two 0's in the # denominator. [18] proof 1|200 # Alcohol content measured by volume at # 60 degrees Fahrenheit. This is a USA # measure. In Europe proof=percent. ppm 1e-6 partspermillion ppm ppb 1e-9 partsperbillion ppb # USA billion ppt 1e-12 partspertrillion ppt # USA trillion karat 1|24 # measure of gold purity caratgold karat gammil mg/l basispoint 0.01 % # Used in finance fine 1|1000 # Measure of gold purity # The pH scale is used to measure the concentration of hydronium (H3O+) ions in # a solution. A neutral solution has a pH of 7 as a result of dissociated # water molecules. pH(x) units=[1;mol/liter] range=(0,) 10^(-x) mol/liter ; (-log(pH liters/mol)) # # Temperature # # Two types of units are defined: units for converting temperature differences # and functions for converting absolute temperatures. Conversions for # differences start with "deg" and conversions for absolute temperature start # with "temp". # # If the temperature inside is 72 degrees Fahrenheit and you want to # convert this to degrees Celsius then you need absolute temperature: # # You have: tempF(72) # You want: tempC # 22.222222 # # If the temperature rose 72 degrees Fahrenheit during the chemical reaction # then this is a temperature difference: # # You have: 72 degF # You want: degC # * 40 # / 0.025 # TEMPERATURE kelvin TEMPERATURE_DIFFERENCE kelvin # In 1741 Anders Celsius introduced a temperature scale with water boiling at # 0 degrees and freezing at 100 degrees at standard pressure. After his death # the fixed points were reversed and the scale was called the centigrade # scale. Due to the difficulty of accurately measuring the temperature of # melting ice at standard pressure, the centigrade scale was replaced in 1954 # by the Celsius scale which is defined by subtracting 273.15 from the # temperature in Kelvins. This definition differed slightly from the old # centigrade definition, but the Kelvin scale depends on the triple point of # water rather than a melting point, so it can be measured accurately. tempC(x) units=[1;K] domain=[-273.15,) range=[0,) \ x K + stdtemp ; (tempC +(-stdtemp))/K tempcelsius() tempC degcelsius K degC K # Fahrenheit defined his temperature scale by setting 0 to the coldest # temperature he could produce in his lab with a salt water solution and by # setting 96 degrees to body heat. In Fahrenheit's words: # # Placing the thermometer in a mixture of sal ammoniac or sea # salt, ice, and water a point on the scale will be found which # is denoted as zero. A second point is obtained if the same # mixture is used without salt. Denote this position as 30. A # third point, designated as 96, is obtained if the thermometer # is placed in the mouth so as to acquire the heat of a healthy # man." (D. G. Fahrenheit, Phil. Trans. (London) 33, 78, 1724) tempF(x) units=[1;K] domain=[-459.67,) range=[0,) \ (x+(-32)) degF + stdtemp ; (tempF+(-stdtemp))/degF + 32 tempfahrenheit() tempF degfahrenheit 5|9 * degC degF 5|9 * degC degreesrankine degF # The Rankine scale has the degrankine degreesrankine # Fahrenheit degree, but its zero degreerankine degF # is at absolute zero. degR degrankine tempR degrankine temprankine degrankine tempreaumur(x) units=[1;K] domain=[-218.52,) range=[0,) \ x degreaumur+stdtemp ; (tempreaumur+(-stdtemp))/degreaumur degreaumur 10|8 * degC # The Reaumur scale was used in Europe and # particularly in France. It is defined # to be 0 at the freezing point of water # and 80 at the boiling point. Reaumur # apparently selected 80 because it is # divisible by many numbers. degK K # "Degrees Kelvin" is forbidden usage. tempK K # For consistency # Gas mark is implemented below but in a terribly ugly way. There is # a simple formula, but it requires a conditional which is not # presently supported. # # The formula to convert to degrees Fahrenheit is: # # 25 log2(gasmark) + k_f gasmark<=1 # 25 (gasmark-1) + k_f gasmark>=1 # # k_f = 275 # gasmark[degR] \ .0625 634.67 \ .125 659.67 \ .25 684.67 \ .5 709.67 \ 1 734.67 \ 2 759.67 \ 3 784.67 \ 4 809.67 \ 5 834.67 \ 6 859.67 \ 7 884.67 \ 8 909.67 \ 9 934.67 \ 10 959.67 # The Beaufort wind force scale was developed from 1805-1807 by Sir Francis # Beaufort to categorize wind conditions at sea. It is normally defined from # Beaufort 0, also called "Force 0," through Beaufort 12. Beaufort numbers # 13-17 were later defined for tropical cyclones but are rarely used. The # original Beaufort scale was qualitative and did not relate directly to wind # speed. In 1906, George Simpson of the British Met Office fit wind-speed # measurements to visual Beaufort estimates made from five coastal and inland # stations in Britain. Simpson's formula was adopted by the World Meterological # Organization in 1946 to produce a table, known as WMO Code 1100, giving mean # (and min/max) wind speed equivalents at a height of 10 meters for each # Beaufort number. This is the "operational" Beaufort scale that mariners # use. Meterological and climatic researchers typically use a "scientific" # Beaufort scale based on more recent and comprehensive fits. See Wallbrink and # Cook, Historical Wind Speed Equivalents Of The Beaufort Scale, 1850-1950, at # https://icoads.noaa.gov/reclaim/pdf/Hisklim13.pdf # beaufort_WMO1100(B) units=[1;m/s] domain=[0,17] range=[0,) \ 0.836 B^3|2 m/s; (beaufort_WMO1100 s / 0.836 m)^2|3 beaufort(B) units=[1;m/s] domain=[0,17] range=[0,) \ beaufort_WMO1100(B); ~beaufort_WMO1100(beaufort) # Units cannot handle wind chill or heat index because they are two-variable # functions, but they are included here for your edification. Clearly these # equations are the result of a model fitting operation. # # wind chill index (WCI) a measurement of the combined cooling effect of low # air temperature and wind on the human body. The index was first defined # by the American Antarctic explorer Paul Siple in 1939. As currently used # by U.S. meteorologists, the wind chill index is computed from the # temperature T (in °F) and wind speed V (in mi/hr) using the formula: # WCI = 0.0817(3.71 sqrt(V) + 5.81 - 0.25V)(T - 91.4) + 91.4. # For very low wind speeds, below 4 mi/hr, the WCI is actually higher than # the air temperature, but for higher wind speeds it is lower than the air # temperature. # # heat index (HI or HX) a measure of the combined effect of heat and # humidity on the human body. U.S. meteorologists compute the index # from the temperature T (in °F) and the relative humidity H (as a # value from 0 to 1). # HI = -42.379 + 2.04901523 T + 1014.333127 H - 22.475541 TH # - .00683783 T^2 - 548.1717 H^2 + 0.122874 T^2 H + 8.5282 T H^2 # - 0.0199 T^2 H^2. # # Physical constants # # Basic constants #pi 3.14159265358979323846 tau 2 pi phi (sqrt(5)+1)/2 light c mu0_SI 2 alpha h_SI / e_SI^2 c_SI # Vacuum magnetic permeability mu0 2 alpha h / e^2 c # Gets overridden in CGS modes epsilon0_SI 1/mu0_SI c_SI^2 # Vacuum electric permittivity epsilon0 1/mu0 c^2 # Also overridden in CGS modes Z0 mu0 c # Free space impedance energy c^2 # Convert mass to energy hbar h / 2 pi hbar_SI h_SI / 2 pi spin hbar G_SI 6.67430e-11 G 6.67430e-11 N m^2 / kg^2 # Newtonian gravitational constant coulombconst 1/4 pi epsilon0 # Listed as k or k_C sometimes k_C coulombconst # Physico-chemical constants atomicmassunit_SI 1.66053906660e-27 # Unified atomic mass unit, defined as atomicmassunit 1.66053906660e-27 kg # Unified atomic mass unit, defined as u atomicmassunit # 1|12 of the mass of carbon 12. amu atomicmassunit # The relationship N_A u = 1 g/mol dalton u # is approximately, but not exactly Da dalton # true (with the 2019 SI). # Previously the mole was defined to # make this relationship exact. amu_chem 1.66026e-27 kg # 1|16 of the weighted average mass of # the 3 naturally occuring neutral # isotopes of oxygen amu_phys 1.65981e-27 kg # 1|16 of the mass of a neutral # oxygen 16 atom gasconstant k N_A # Molar gas constant (exact) R gasconstant kboltzmann boltzmann molarvolume mol R stdtemp / atm # Volume occupied by one mole of an # ideal gas at STP. loschmidt avogadro mol / molarvolume # Molecules per cubic meter of an # ideal gas at STP. Loschmidt did # work similar to Avogadro. molarvolume_si N_A siliconlattice^3 / 8 # Volume of a mole of crystalline # silicon. The unit cell contains 8 # silicon atoms and has a side # length of siliconlattice. stefanboltzmann pi^2 k^4 / 60 hbar^3 c^2 # The power per area radiated by a sigma stefanboltzmann # blackbody at temperature T is # given by sigma T^4. (exact) wiendisplacement (h c/k)/4.9651142317442763 # Wien's Displacement Law gives # the frequency at which the the # Planck spectrum has maximum # intensity. The relation is lambda # T = b where lambda is wavelength, # T is temperature and b is the Wien # displacement. This relation is # used to determine the temperature # of stars. The constant is the # solution to x=5(1-exp(-x)). # This expression has no experimental # error, and x is defined exactly # by the equation above, so it is # an exact definition. K_J90 483597.9 GHz/V # Direct measurement of the volt is difficult. Until K_J 2e/h # recently, laboratories kept Weston cadmium cells as # a reference, but they could drift. In 1987 the # CGPM officially recommended the use of the # Josephson effect as a laboratory representation of # the volt. The Josephson effect occurs when two # superconductors are separated by a thin insulating # layer. A "supercurrent" flows across the insulator # with a frequency that depends on the potential # applied across the superconductors. This frequency # can be very accurately measured. The Josephson # constant K_J relates the measured frequency to the # potential. Two values given, the conventional # (exact) value from 1990, which was used until the # 2019 SI revision, and the current exact value. R_K90 25812.807 ohm # Measurement of the ohm also presents difficulties. R_K h/e^2 # The old approach involved maintaining resistances # that were subject to drift. The new standard is # based on the Hall effect. When a current carrying # ribbon is placed in a magnetic field, a potential # difference develops across the ribbon. The ratio # of the potential difference to the current is # called the Hall resistance. Klaus von Klitzing # discovered in 1980 that the Hall resistance varies # in discrete jumps when the magnetic field is very # large and the temperature very low. This enables # accurate realization of the resistance h/e^2 in the # lab. The 1990 value was an exact conventional # value used until the SI revision in 2019. This value # did not agree with measurements. The new value # is exact. # The 2019 update to SI gives exact definitions for R_K and K_J. Previously # the electromagnetic units were realized using the 1990 conventional values # for these constants, and as a result, the standard definitions were in some # sense outside of SI. The revision corrects this problem. The definitions # below give the 1990 conventional values for the electromagnetic units in # terms of 2019 SI. ampere90 (K_J90 R_K90 / K_J R_K) A coulomb90 (K_J90 R_K90 / K_J R_K) C farad90 (R_K90/R_K) F henry90 (R_K/R_K90) H ohm90 (R_K/R_K90) ohm volt90 (K_J90/K_J) V watt90 (K_J90^2 R_K90 / K_J^2 R_K) W # Various conventional values gravity 9.80665 m/s^2 # std acceleration of gravity (exact) # Established by the 3rd CGPM in # 1901. This is a nominal midrange # value, originally based on the # acceleration of a body at sea # level at 45 degrees latitude. # The value was actually determined # by measuring at the International # Bureau and correcting the # measurement by a theoretical # cofficient to get the 45 deg # latitude sea level value. # (Wikipedia: Standard gravity) force gravity # use to turn masses into forces atm 101325 Pa # Standard atmospheric pressure atmosphere atm Hg 13.5951 gram force / cm^3 # Standard weight of mercury (exact) water gram force/cm^3 # Standard weight of water (exact) waterdensity gram / cm^3 # Density of water H2O water wc water # water column mach 331.46 m/s # speed of sound in dry air at STP standardtemp 273.15 K # standard temperature stdtemp standardtemp normaltemp tempF(70) # for gas density, from NIST normtemp normaltemp # Handbook 44 # Weight of mercury and water at different temperatures using the standard # force of gravity. Hg10C 13.5708 force gram / cm^3 # These units, when used to form Hg20C 13.5462 force gram / cm^3 # pressure measures, are not accurate Hg23C 13.5386 force gram / cm^3 # because of considerations of the Hg30C 13.5217 force gram / cm^3 # revised practical temperature scale. Hg40C 13.4973 force gram / cm^3 Hg60F 13.5574 force gram / cm^3 H2O0C 0.99987 force gram / cm^3 H2O5C 0.99999 force gram / cm^3 H2O10C 0.99973 force gram / cm^3 H2O15C 0.99913 force gram / cm^3 H2O18C 0.99862 force gram / cm^3 H2O20C 0.99823 force gram / cm^3 H2O25C 0.99707 force gram / cm^3 H2O50C 0.98807 force gram / cm^3 H2O100C 0.95838 force gram / cm^3 # moved because ft is used before being defined (and otherwise parsed as femtotonne) inch 2.54 cm in inch inches inch foot 12 inch feet foot ft foot ft3 ft^3 # Atomic constants hartree 4.3597447222071e-18 J # Approximate electric potential energy E_h hartree # of the hydrogen atom in its ground # state, and approximately twice its # ionization energy. The hartree # energy is traditionally defined as # coulombconst^2 m_e e^4 / hbar^2, # but it can be measured to greater # precision using the relationship # hartree = 2 h c Rinfinity # because Rinfinity is one of the # most accurately measured physical # constants. Because h and c are # exact we can choose either hartree # or Rinfinity from CODATA to use as # the primary value without # affecting the precision. Rinfinity hartree / 2 h c # The wavelengths of a spectral series R_H Rinfinity m_p / (m_e + m_p) # can be expressed as # 1/lambda = R (1/m^2 - 1/n^2). # where R is a number that various # slightly from element to element. # For hydrogen, R_H is the value, # and for heavy elements, the value # approaches Rinfinity, which can be # computed from # Rinfinity = m_e c alpha^2 / 2 h # with loss of precision. Rinfinity # is one of the most accurately # measured physical constants and is # known to higher precision than m_e # or alpha. alpha 7.2973525693e-3 # The fine structure constant was # introduced to explain fine # structure visible in spectral # lines. bohrradius alpha / 4 pi Rinfinity prout 185.5 keV # nuclear binding energy equal to 1|12 # binding energy of the deuteron conductancequantum 2 e^2 / h # Particle radius electronradius coulombconst e^2 / electronmass c^2 # Classical deuteronchargeradius 2.12799e-15 m protonchargeradius 0.8751e-15 m # Masses of elementary particles electronmass_SI electronmass_u atomicmassunit_SI electronmass_u 5.48579909065e-4 electronmass 5.48579909065e-4 u m_e electronmass muonmass 0.1134289259 u m_mu muonmass taumass 1.90754 u m_tau taumass protonmass 1.007276466621 u m_p protonmass neutronmass 1.00866491595 u m_n neutronmass deuteronmass 2.013553212745 u # Nucleus of deuterium, one m_d deuteronmass # proton and one neutron alphaparticlemass 4.001506179127 u # Nucleus of He, two protons m_alpha alphaparticlemass # and two neutrons tritonmass 3.01550071621 u # Nucleius of H3, one proton m_t tritonmass # and two neutrons helionmass 3.014932247175 u # Nucleus of He3, two protons m_h helionmass # and one neutron # particle wavelengths: the compton wavelength of a particle is # defined as h / m c where m is the mass of the particle. electronwavelength h / m_e c lambda_C electronwavelength protonwavelength h / m_p c lambda_C,p protonwavelength neutronwavelength h / m_n c lambda_C,n neutronwavelength muonwavelength h / m_mu c lambda_C,mu muonwavelength # The g-factor or dimensionless magnetic moment is a quantity that # characterizes the magnetic moment of a particle. The electron g-factor is # one of the most precisely measured values in physics, with a relative # uncertainty of 1.7e-13. g_d 0.8574382338 # Deuteron g-factor g_e -2.00231930436256 # Electron g-factor g_h -4.255250615 # Helion g-factor g_mu -2.0023318418 # Muon g-factor g_n -3.82608545 # Neutron g-factor g_p 5.5856946893 # Proton g-factor g_t 5.957924931 # Triton g-factor fermicoupling 1.1663787e-5 / GeV^2 # Magnetic moments (derived from the more accurate g-factors) # # The magnetic moment is g * mu_ref * spin where in most cases # the reference is the nuclear magneton, and all of the particles # except the deuteron have spin 1/2. bohrmagneton e hbar / 2 electronmass # Reference magnetic moment for mu_B bohrmagneton # the electron nuclearmagneton e hbar / 2 protonmass # Convenient reference magnetic mu_N nuclearmagneton # moment for heavy particles mu_e g_e mu_B / 2 # Electron spin magnet moment mu_mu g_mu e hbar / 4 muonmass # Muon spin magnetic moment mu_p g_p mu_N / 2 # Proton magnetic moment mu_n g_n mu_N / 2 # Neutron magnetic moment mu_t g_t mu_N / 2 # Triton magnetic moment mu_d g_d mu_N # Deuteron magnetic moment, spin 1 mu_h g_h mu_N / 2 # Helion magnetic moment # # Units derived from physical constants # kgf kg force technicalatmosphere kgf / cm^2 at technicalatmosphere hyl kgf s^2 / m # Also gram-force s^2/m according to [15] mmHg mm Hg torr atm / 760 # The torr, named after Evangelista # Torricelli, and is very close to the mm Hg tor Pa # Suggested in 1913 but seldom used [24]. # Eventually renamed the Pascal. Don't # confuse the tor with the torr. inHg inch Hg inH2O inch water mmH2O mm water eV e V # Energy acquired by a particle with charge e electronvolt eV # when it is accelerated through 1 V lightyear c julianyear # The 365.25 day year is specified in ly lightyear # NIST publication 811 lightsecond c s lightminute c min parsec au / tan(arcsec) # Unit of length equal to distance pc parsec # from the Sun to a point having # heliocentric parallax of 1 # arcsec (derived from parallax # second). A distant object with # parallax theta will be about # (arcsec/theta) parsecs from the # Sun (using the approximation # that tan(theta) = theta). rydberg 1|2 hartree # Rydberg energy crith 0.089885 gram # The crith is the mass of one # liter of hydrogen at standard # temperature and pressure. amagatvolume molarvolume amagat mol/amagatvolume # Used to measure gas densities lorentz bohrmagneton / h c # Used to measure the extent # that the frequency of light # is shifted by a magnetic field. cminv h c / cm # Unit of energy used in infrared invcm cminv # spectroscopy. wavenumber cminv kcal_mol kcal_th / mol N_A # kcal/mol is used as a unit of # energy by physical chemists. # # CGS system based on centimeter, gram and second # dyne cm gram / s^2 # force dyn dyne erg cm dyne # energy poise gram / cm s # viscosity, honors Jean Poiseuille P poise rhe /poise # reciprocal viscosity stokes cm^2 / s # kinematic viscosity St stokes stoke stokes lentor stokes # old name Gal cm / s^2 # acceleration, used in geophysics galileo Gal # for Earth's gravitational field # (note that "gal" is for gallon # but "Gal" is the standard symbol # for the gal which is evidently a # shortened form of "galileo".) barye dyne/cm^2 # pressure barad barye # old name kayser 1/cm # Proposed as a unit for wavenumber balmer kayser # Even less common name than "kayser" kine cm/s # velocity bole g cm / s # momentum pond gram force glug gram force s^2 / cm # Mass which is accelerated at # 1 cm/s^2 by 1 gram force darcy centipoise cm^2 / s atm # Measures permeability to fluid flow. # One darcy is the permeability of a # medium that allows a flow of cc/s # of a liquid of centipoise viscosity # under a pressure gradient of # atm/cm. Named for H. Darcy. mobileohm cm / dyn s # mobile ohm, measure of mechanical # mobility mechanicalohm dyn s / cm # mechanical resistance acousticalohm dyn s / cm^5 # ratio of the sound pressure of # 1 dyn/cm^2 to a source of strength # 1 cm^3/s ray acousticalohm rayl dyn s / cm^3 # Specific acoustical resistance eotvos 1e-9 Gal/cm # Change in gravitational acceleration # over horizontal distance # # Electromagnetic CGS Units # # For measuring electromagnetic quantities in SI, we introduce the new base # dimension of current, define the ampere to measure current, and derive the # other electromagnetic units from the ampere. With the CGS units one approach # is to use the basic equations of electromagnetism to define units that # eliminate constants from those equations. Coulomb's law has the form # # F = k_C q1 q2 / r^2 # # where k_C is the Coulomb constant equal to 1|4 pi epsilon0 in SI units. # Ampere's force law takes the form # # dF/dl = 2 k_A I1 I2 / r # # where k_A is the ampere constant. In the CGS system we force either k_C or # k_A to 1 which then defines either a unit for charge or a unit for current. # The other unit then becomes a derived unit. When k_C is 1 the ESU system # results. When k_A is 1 the EMU system results. Note that these parameters # are not independent of each other: Maxwell's equations indicate that # # k_C / k_A = c^2 # # where c is the speed of light. # # One more choice is needed to define a complete system. Using Coulomb's law # we define the electric field as the force per unit charge # # E = k_C 1 / r^2. # # But what about the magnetic field? It is derived from Ampere's law but we # have the option of adding a proportionality constant, k_B, that may have # dimensions: # # B = 2 k_A k_B I / r # # We can choose k_B = 1, which is done in the SI, ESU and EMU systems. But if # instead we give k_B units of length/time then the magnetic field has # the same units as the electric field. This choice leads to the Gaussian # and Heaviside-Lorentz systems. # # The relations above are used to determine the dimensions, but the units are # derived from the base units of CGS, not directly from those formulas. We # will use the notation [unit] to refer to the dimension of the unit in # brackets. This same process gives rise to the SI units such as the tesla, # which is defined by # # [tesla] = [2 (1/4 pi c^2 epsilon0) amp / m] = [(mu0 / 2) amp / m] # # which gives kg / A s^2 as expected. # # References: # # Classical Electrodynamics by John David Jackson, 3rd edition. # Cardarelli, Francois. 1999. Scientific Unit Conversion. 2nd ed. Trans. # M.J. Shields. London: Springer-Verlag. ISBN 1-85233-043-0 # # # All of the CGS systems result in electromagnetic units that involve the square # roots of the centimeter and gram. This requires a change in the primitive # units. # !var UNITS_SYSTEM esu emu gaussian gauss hlu sqrt_cm ! sqrt_centimeter sqrt_cm +m 100 sqrt_cm^2 sqrt_g ! sqrt_gram sqrt_g +kg kilo sqrt_g^2 !endvar # Electrostatic CGS (ESU) # # This system uses the statcoulomb as the fundamental unit of charge, with # derived units that parallel the conventional terminology but use the stat- # prefix. The statcoulomb is designed by setting k_C=1, which means # # dyne = statcoulomb^2 / cm^2. # # The statcoulomb is also called the franklin or esu. # # The ESU system was specified by a committee report in 1873 and rarely used. statcoulomb 10 coulomb cm / s c # Charge such that two charges esu statcoulomb # of 1 statC separated by 1 cm statcoul statcoulomb # exert a force of 1 dyne statC statcoulomb stC statcoulomb franklin statcoulomb Fr franklin !var UNITS_SYSTEM esu !message CGS-ESU units selected !prompt (ESU) +statcoulomb sqrt(dyne) cm +A 10 c_SI statamp +mu0 1/c^2 +coulombconst 1 !endvar statampere statcoulomb / s statamp statampere statA statampere stA statampere statvolt dyne cm / statamp sec statV statvolt stV statvolt statfarad statamp sec / statvolt statF statfarad stF statfarad cmcapacitance statfarad stathenry statvolt sec / statamp statH stathenry stH stathenry statohm statvolt / statamp stohm statohm statmho /statohm stmho statmho statweber statvolt sec statWb statweber stWb statweber stattesla statWb/cm^2 # Defined by analogy with SI; rarely statT stattesla # if ever used stT stattesla debye 1e-10 statC angstrom # unit of electrical dipole moment helmholtz debye/angstrom^2 # Dipole moment per area jar 1000 statfarad # approx capacitance of Leyden jar # Electromagnetic CGS (EMU) # # The abampere is the fundamental unit of this system, with the derived units # using the ab- prefix. The dimensions of the abampere are defined by assuming # that k_A=1, which # # [dyne / cm] = [2 abampere^2 / cm] # # where the brackets indicate taking the dimension of the unit in base units # and discarding any constant factors. This results in the definition from # base CGS units of: # # abampere = sqrt(dyne). # # The abampere is also called the biot. The magnetic field unit (the gauss) # follows from the assumption that k_B=1, which means # # B = 2 I / r, # # and hence the dimensions of the gauss are given by # # [gauss] = [2 abampere / cm] # # or rewriting in terms of the base units # # gauss = abampere / cm. # # The definition given below is different because it is in a form that # gives a valid reduction for SI and ESU and still gives the correct # result in EMU. (It can be derived from Faraday's law.) # # The EMU system was developed by Gauss and Weber and formalized as a system in # a committee report by the British Association for the Advancement of Science # in 1873. abampere 10 A # Current which produces a force of abamp abampere # 2 dyne/cm between two infinitely #aA abampere # long wires that are 1 cm apart abA abampere biot abampere Bi biot !var UNITS_SYSTEM emu !message CGS-EMU units selected !prompt (EMU) +abampere sqrt(dyne) +A 0.1 abamp +mu0 1 +coulombconst c^2 !endvar abcoulomb abamp sec abcoul abcoulomb abC abcoulomb abfarad abampere sec / abvolt abF abfarad abhenry abvolt sec / abamp abH abhenry abvolt dyne cm / abamp sec abV abvolt abohm abvolt / abamp abmho /abohm gauss abvolt sec / cm^2 # The magnetic field 2 cm from a wire Gs gauss # carrying a current of 1 abampere maxwell gauss cm^2 # Also called the "line" Mx maxwell oersted gauss / mu0 # From the relation H = B / mu Oe oersted gilbert gauss cm / mu0 Gb gilbert Gi gilbert unitpole 4 pi maxwell # unit magnetic pole emu erg/gauss # "electro-magnetic unit", a measure of # magnetic moment, often used as emu/cm^3 # to specify magnetic moment density. # Electromagnetic CGS (Gaussian) # # The Gaussian system uses the statcoulomb and statamp from the ESU system # derived by setting k_C=1, but it defines the magnetic field unit differently # by taking k_B=c instead of k_B=1. As noted above, k_C and k_A are not # independent. With k_C=1 we must have k_A=c^-2. This results in the magnetic # field unit, the gauss, having dimensions give by: # # [gauss] = [2 (c^-2) c statamp / cm] = [statamp / c cm] # # We then define the gauss using base CGS units to obtain # # gauss = statamp / ((cm/s) cm) = statcoulomb / cm^2. # # Note that this definition happens to give the same result as the definition # for the EMU system, so the definitions of the gauss are consistent. # # This definition gives the same dimensions for the E and B fields and was also # known as the "symmetric system". This system was proposed by Hertz in 1888. !var UNITS_SYSTEM gaussian gauss !message CGS-Gaussian units selected !prompt (Gaussian) !endvar !var UNITS_SYSTEM gaussian gauss natural-gauss +statcoulomb sqrt(dyne) cm +A 10 c_SI statamp +mu0 1 +epsilon0 1 +coulombconst 1 # The gauss is the B field produced +gauss statcoulomb / cm^2 # 1 cm from a wire carrying a current +weber 1e8 maxwell # of 0.5*(c/(cm/s)) stA = 1.5e10 stA +bohrmagneton e hbar / 2 electronmass c +nuclearmagneton e hbar / 2 protonmass c !endvar # Electromagnetic CGS (Heaviside-Lorentz) # The Heaviside-Lorentz system is similar to the Gaussian system, but it is # "rationalized" so that factors of 4 pi do not appear in Maxwell's equations. # The SI system is similarly rationalized, but the other CGS systems are not. # # The factor of 4 pi appears instead in Coulomb's law, so in this system # k_C = 1 / 4 pi, which means the charge unit is defined by # # dyne = (1 / 4 pi) hlu_charge^2 / cm^2. # # Since we have the leading constant of (1 / 4pi) the numerical value of the # charge number is larger by sqrt(4pi), which in turns means that the HLU # charge unit is smaller by this multiple. But note that the dimensions of the # charge unit are the same as the Gaussian system, so both systems measure # charge with cm^(3/2) g^(1/2) / s, but the amount of charge for this dimension # differs by a factor of sqrt(4pi) between the two systems. # # Ampere's law for the Heaviside-Lorentz system has the form # # B = 1/(2 pi c) * I/r # The Heaviside-Lorentz system does not appear to have any named units, so we # use "hlu" for "Heaviside-Lorentz unit" so we can define values for the basic # units in this system. hlu_charge statcoulomb / sqrt(4 pi) hlu_current hlu_charge / sec hlu_volt erg / hlu_charge hlu_efield hlu_volt / cm hlu_bfield sqrt(4 pi) gauss !var UNITS_SYSTEM hlu !message CGS-Heaviside-Lorentz Units selected !prompt (HLU) !endvar !var UNITS_SYSTEM hlu natural planck planck-red +statcoulomb sqrt(dyne) cm sqrt(4 pi) +A 10 c_SI statamp +mu0 1 +epsilon0 1 # The gauss is the B field produced 1 cm from a wire carrying # a current of 0.5*(c/(cm/s)) stA, derived from Ampere's law +gauss (1/2 pi c) (0.5 c/(cm/s)) statamp / cm +weber 1e8 maxwell +bohrmagneton e hbar / 2 electronmass c +nuclearmagneton e hbar / 2 protonmass c !endvar # "Natural units" (high energy physics and cosmology) # # In particle physics "natural units" (which don't seem to have a more specific # name) are defined by setting hbar = c = boltzmann = 1. In this system the # electron volt is the only base unit. The electromagnetic units can be # derived from the rationalized Heaviside-Lorentz units or from Gaussian units. # The default form is the rationalized HLU derived version. # # The basic mechanical and thermodynamic definitions for the natural # units are identical in both systems. These appear below. The # natural-gauss system has additional electromagnetic redefinitions # that appear above in the "Electromagnetic CGS (Gaussian)" Section. # These are the Heaviside-Lorentz natural units natural_energy eV natural_charge e / sqrt(4 pi alpha) natural_time hbar / natural_energy natural_length natural_time c natural_mass natural_energy / c^2 natural_temp natural_energy / boltzmann natural_force natural_energy / natural_length natural_power natural_energy / natural_time natural_volt natural_energy / natural_charge natural_Efield natural_volt / natural_length natural_Bfield natural_Efield / c natural_current natural_charge / natural_time !var UNITS_SYSTEM natural !message Natural units selected (Heavyside-Lorentz based) !prompt (natural) !endvar !var UNITS_SYSTEM natural-gauss !message Natural units selected (Gaussian based) !prompt (natgauss) !endvar # These definitions are the same in both natural unit systems !var UNITS_SYSTEM natural natural-gauss +eV ! +h 2 pi +c 1 +boltzmann 1 +m e_SI / hbar_SI c_SI eV +kg (c_SI^2 / e_SI) eV +s e_SI / hbar_SI eV +K (k_SI / e_SI) eV !endvar # # Planck units # # Planck units are a set of "natural" units based on physical constants c, G, # hbar, boltzmann's constant, and epsilon0, often used when working with # gravitational theory. In planck units, all quantities are dimensionless. # Some variations are possible for exactly how the units are defined. We # provide two variations, the rationalized planck units and the # rationalized-reduced planck units. # # In both forms the units are defined by c = hbar = boltzmann = 1. # But the choice of rationalized and reduced affects how epsilon0 and G # are treated. # # In the "rationalized" units, factors of 4 pi do not appear in Maxwell's # equation, and Coulomb's law bears a factor of 1/4 pi. See the section on # the Heaviside-Lorentz units for more about this. The choice of rationalized # units means that epsilon0 = 1. (In the unrationalized case, which is not # supported, 1/(4 pi epsilon0) = 1.) # # The "reduced" units similarly are defined to eliminate factors of 8 pi # from the Einstein field equations for gravitation. With reduced units # we set 8 pi G = 1 and with the unreduced units, simply G = 1. # Rationalized, unreduced planck units planckmass sqrt(hbar c / G) m_P planckmass planckenergy planckmass c^2 E_P planckenergy plancktime hbar / planckenergy t_P plancktime plancklength plancktime c l_P plancklength plancktemperature planckenergy / k T_P plancktemperature planckforce planckenergy / plancklength planckcharge sqrt(epsilon0 hbar c) planckcurrent planckcharge / plancktime planckvolt planckenergy / planckcharge planckEfield planckvolt / plancklength planckBfield planckEfield / c # Rationalized, reduced planck units planckmass_red sqrt(hbar c / 8 pi G) planckenergy_red planckmass_red c^2 plancktime_red hbar / planckenergy_red plancklength_red plancktime_red c plancktemperature_red planckenergy_red / k planckforce_red planckenergy_red / plancklength_red planckcharge_red sqrt(epsilon0 hbar c) planckcurrent_red planckcharge_red / plancktime_red planckvolt_red planckenergy_red / planckcharge_red planckEfield_red planckvolt_red / plancklength_red planckBfield_red planckEfield_red /c !var UNITS_SYSTEM planck !message Planck units selected !prompt (planck) +c 1 +h 2 pi +G 1 +boltzmann 1 +kg sqrt(G_SI / hbar_SI c_SI) +s c_SI^2 / hbar_SI kg +m s / c_SI +K k_SI / hbar_SI s !endvar !var UNITS_SYSTEM planck-red !message Reduced planck units selected !prompt (planck reduced) +c 1 +h 2 pi +G 1/8 pi +boltzmann 1 +kg sqrt(8 pi G_SI / hbar_SI c_SI) +s c_SI^2 / hbar_SI kg +m s / c_SI +K k_SI / hbar_SI s !endvar # # Some historical electromagnetic units # intampere 0.999835 A # Defined as the current which in one intamp intampere # second deposits .001118 gram of # silver from an aqueous solution of # silver nitrate. intfarad 0.999505 F intvolt 1.00033 V intohm 1.000495 ohm # Defined as the resistance of a # uniform column of mercury containing # 14.4521 gram in a column 1.063 m # long and maintained at 0 degC. daniell 1.042 V # Meant to be electromotive force of a # Daniell cell, but in error by .04 V faraday N_A e mol # Charge that must flow to deposit or faraday_phys 96521.9 C # liberate one gram equivalent of any faraday_chem 96495.7 C # element. (The chemical and physical # values are off slightly from what is # obtained by multiplying by amu_chem # or amu_phys. These values are from # a 1991 NIST publication.) Note that # there is a Faraday constant which is # equal to N_A e and hence has units of # C/mol. kappline 6000 maxwell # Named by and for Gisbert Kapp siemensunit 0.9534 ohm # Resistance of a meter long column of # mercury with a 1 mm cross section. # # Printed circuit board units. # # http://www.ndt-ed.org/GeneralResources/IACS/IACS.htm. # # Conductivity is often expressed as a percentage of IACS. A copper wire a # meter long with a 1 mm^2 cross section has a resistance of 1|58 ohm at # 20 deg C. Copper density also has a standard IACS value at that temperature. # copperconductivity 58 siemens m / mm^2 # A wire a meter long with IACS copperconductivity # a 1 mm^2 cross section copperdensity 8.89 g/cm^3 # The "ounce" measures the ouncecopper oz / ft^2 copperdensity # thickness of copper used ozcu ouncecopper # in circuitboard fabrication # # Photometric units # LUMINOUS_INTENSITY candela LUMINOUS_FLUX lumen LUMINOUS_ENERGY talbot ILLUMINANCE lux EXITANCE lux candle 1.02 candela # Standard unit for luminous intensity hefnerunit 0.9 candle # in use before candela hefnercandle hefnerunit # violle 20.17 cd # luminous intensity of 1 cm^2 of # platinum at its temperature of # solidification (2045 K) lumen cd sr # Luminous flux (luminous energy per lm lumen # time unit) talbot lumen s # Luminous energy lumberg talbot # References give these values for lumerg talbot # lumerg and lumberg both. Note that # a paper from 1948 suggests that # lumerg should be 1e-7 talbots so # that lumergs/erg = talbots/joule. # lumerg = luminous erg lux lm/m^2 # Illuminance or exitance (luminous lx lux # flux incident on or coming from phot lumen / cm^2 # a surface) ph phot # footcandle lumen/ft^2 # Illuminance from a 1 candela source # at a distance of one foot metercandle lumen/m^2 # Illuminance from a 1 candela source # at a distance of one meter mcs metercandle s # luminous energy per area, used to # measure photographic exposure nox 1e-3 lux # These two units were proposed for skot 1e-3 apostilb # measurements relating to dark adapted # eyes. # Luminance measures LUMINANCE nit nit cd/m^2 # Luminance: the intensity per projected stilb cd / cm^2 # area of an extended luminous source. sb stilb # (nit is from latin nitere = to shine.) apostilb cd/pi m^2 asb apostilb blondel apostilb # Named after a French scientist. # Equivalent luminance measures. These units are units which measure # the luminance of a surface with a specified exitance which obeys # Lambert's law. (Lambert's law specifies that luminous intensity of # a perfectly diffuse luminous surface is proportional to the cosine # of the angle at which you view the luminous surface.) equivalentlux cd / pi m^2 # luminance of a 1 lux surface equivalentphot cd / pi cm^2 # luminance of a 1 phot surface lambert cd / pi cm^2 footlambert cd / pi ft^2 # The bril is used to express "brilliance" of a source of light on a # logarithmic scale to correspond to subjective perception. An increase of 1 # bril means doubling the luminance. A luminance of 1 lambert is defined to # have a brilliance of 1 bril. bril(x) units=[1;lambert] 2^(x+-100) lamberts ;log2(bril/lambert)+100 # Some luminance data from the IES Lighting Handbook, 8th ed, 1993 sunlum 1.6e9 cd/m^2 # at zenith sunillum 100e3 lux # clear sky sunillum_o 10e3 lux # overcast sky sunlum_h 6e6 cd/m^2 # value at horizon skylum 8000 cd/m^2 # average, clear sky skylum_o 2000 cd/m^2 # average, overcast sky moonlum 2500 cd/m^2 # # Photographic Exposure Value # This section by Jeff Conrad (jeff_conrad@msn.com) # # The Additive system of Photographic EXposure (APEX) proposed in ASA # PH2.5-1960 was an attempt to simplify exposure determination for people who # relied on exposure tables rather than exposure meters. Shortly thereafter, # nearly all cameras incorporated exposure meters, so the APEX system never # caught on, but the concept of exposure value remains in use. Though given as # 'Ev' in ASA PH2.5-1960, it is now more commonly indicated by 'EV'. EV is # related to exposure parameters by # # A^2 LS ES # 2^EV = --- = -- = -- # t K C # # Where # A = Relative aperture (f-number) # t = Exposure time in seconds # L = Scene luminance in cd/m2 # E = Scene illuminance in lux # S = Arithmetic ISO speed # K = Reflected-light meter calibration constant # C = Incident-light meter calibration constant # # Strictly, an exposure value is a combination of aperture and exposure time, # but it's also commonly used to indicate luminance (or illuminance). # Conversion to luminance or illuminance units depends on the ISO speed and the # meter calibration constant. Common practice is to use an ISO speed of 100. # Calibration constants vary among camera and meter manufacturers: Canon, # Nikon, and Sekonic use a value of 12.5 for reflected-light meters, while # Kenko (formerly Minolta) and Pentax use a value of 14. Kenko and Sekonic use # a value of 250 for incident-light meters with flat receptors. # # The values for in-camera meters apply only averaging, weighted-averaging, or # spot metering--the multi-segment metering incorporated in most current # cameras uses proprietary algorithms that evaluate many factors related to the # luminance distribution of what is being metered; they are not amenable to # simple conversions, and are usually not disclosed by the manufacturers. s100 100 / lx s # ISO 100 speed iso100 s100 # Reflected-light meter calibration constant with ISO 100 speed k1250 12.5 (cd/m2) / lx s # For Canon, Nikon, and Sekonic k1400 14 (cd/m2) / lx s # For Kenko (Minolta) and Pentax # Incident-light meter calibration constant with ISO 100 film c250 250 lx / lx s # flat-disc receptor # Exposure value to scene luminance with ISO 100 imaging media # For Kenko (Minolta) or Pentax #ev100(x) units=[;cd/m^2] range=(0,) 2^x k1400 / s100; log2(ev100 s100/k1400) # For Canon, Nikon, or Sekonic ev100(x) units=[1;cd/m^2] range=(0,) 2^x k1250 / s100; log2(ev100 s100/k1250) EV100() ev100 # Exposure value to scene illuminance with ISO 100 imaging media iv100(x) units=[1;lx] range=(0,) 2^x c250 / s100; log2(iv100 s100 / c250) # Other Photographic Exposure Conversions # # As part of APEX, ASA PH2.5-1960 proposed several logarithmic quantities # related by # # Ev = Av + Tv = Bv + Sv # # where # Av = log2(A^2) Aperture value # Tv = log2(1/t) Time value # Sv = log2(N Sx) Speed value # Bv = log2(B S / K) Luminance ("brightness") value # Iv = log2(I S / C) Illuminance value # # and # A = Relative aperture (f-number) # t = Exposure time in seconds # Sx = Arithmetic ISO speed in 1/lux s # B = luminance in cd/m2 # I = luminance in lux # The constant N derives from the arcane relationship between arithmetic # and logarithmic speed given in ASA PH2.5-1960. That relationship # apparently was not obvious--so much so that it was thought necessary # to explain it in PH2.12-1961. The constant has had several values # over the years, usually without explanation for the changes. Although # APEX had little impact on consumer cameras, it has seen a partial # resurrection in the Exif standards published by the Camera & Imaging # Products Association of Japan. #N_apex 2^-1.75 lx s # precise value implied in ASA PH2.12-1961, # derived from ASA PH2.5-1960. #N_apex 0.30 lx s # rounded value in ASA PH2.5-1960, # ASA PH2.12-1961, and ANSI PH2.7-1986 #N_apex 0.3162 lx s # value in ANSI PH2.7-1973 N_exif 1|3.125 lx s # value in Exif 2.3 (2010), making Sv(5) = 100 K_apex1961 11.4 (cd/m2) / lx s # value in ASA PH2.12-1961 K_apex1971 12.5 (cd/m2) / lx s # value in ANSI PH3.49-1971; more common C_apex1961 224 lx / lx s # value in PH2.12-1961 (20.83 for I in # footcandles; flat sensor?) C_apex1971 322 lx / lx s # mean value in PH3.49-1971 (30 +/- 5 for I in # footcandles; hemispherical sensor?) N_speed N_exif K_lum K_apex1971 C_illum C_apex1961 # Units for Photographic Exposure Variables # # Practical photography sometimes pays scant attention to units for exposure # variables. In particular, the "speed" of the imaging medium is treated as if # it were dimensionless when it should have units of reciprocal lux seconds; # this practice works only because "speed" is almost invariably given in # accordance with international standards (or similar ones used by camera # manufacturers)--so the assumed units are invariant. In calculating # logarithmic quantities--especially the time value Tv and the exposure value # EV--the units for exposure time ("shutter speed") are often ignored; this # practice works only because the units of exposure time are assumed to be in # seconds, and the missing units that make the argument to the logarithmic # function dimensionless are silently provided. # # In keeping with common practice, the definitions that follow treat "speeds" # as dimensionless, so ISO 100 speed is given simply as '100'. When # calculating the logarithmic APEX quantities Av and Tv, the definitions # provide the missing units, so the times can be given with any appropriate # units. For example, giving an exposure time of 1 minute as either '1 min' or # '60 s' will result in Tv of -5.9068906. # # Exposure Value from f-number and Exposure Time # # Because nonlinear unit conversions only accept a single quantity, # there is no direct conversion from f-number and exposure time to # exposure value EV. But the EV can be obtained from a combination of # Av and Tv. For example, the "sunny 16" rule states that correct # exposure for a sunlit scene can achieved by using f/16 and an exposure # time equal to the reciprocal of the ISO speed in seconds; this can be # calculated as # # ~Av(16) + ~Tv(1|100 s), # # which gives 14.643856. These conversions may be combined with the # ev100 conversion: # # ev100(~Av(16) + ~Tv(1|100 s)) # # to yield the assumed average scene luminance of 3200 cd/m^2. # convert relative aperture (f-number) to aperture value Av(A) units=[1;1] domain=[-2,) range=[0.5,) 2^(A/2); 2 log2(Av) # convert exposure time to time value Tv(t) units=[1;s] range=(0,) 2^(-t) s; log2(s / Tv) # convert logarithmic speed Sv in ASA PH2.5-1960 to ASA/ISO arithmetic speed; # make arithmetic speed dimensionless # 'Sv' conflicts with the symbol for sievert; you can uncomment this function # definition if you don't need that symbol #Sv(S) units=[1;1] range=(0,) 2^S / (N_speed/lx s); log2((N_speed/lx s) Sv) Sval(S) units=[1;1] range=(0,) 2^S / (N_speed/lx s); log2((N_speed/lx s) Sval) # convert luminance value Bv in ASA PH2.12-1961 to luminance Bv(x) units=[1;cd/m^2] range=(0,) \ 2^x K_lum N_speed ; log2(Bv / (K_lum N_speed)) # convert illuminance value Iv in ASA PH2.12-1961 to illuminance Iv(x) units=[1;lx] range=(0,) \ 2^x C_illum N_speed ; log2(Iv / (C_illum N_speed)) # convert ASA/ISO arithmetic speed Sx to ASA logarithmic speed in # ASA PH2.5-1960; make arithmetic speed dimensionless Sx(S) units=[1;1] domain=(0,) \ log2((N_speed/lx s) S); 2^Sx / (N_speed/lx s) # convert DIN speed/ISO logarithmic speed in ISO 6:1993 to arithmetic speed # for convenience, speed is treated here as if it were dimensionless Sdeg(S) units=[1;1] range=(0,) 10^((S - 1) / 10) ; (1 + 10 log(Sdeg)) Sdin() Sdeg # Numerical Aperture and f-Number of a Lens # # The numerical aperture (NA) is given by # # NA = n sin(theta) # # where n is the index of refraction of the medium and theta is half # of the angle subtended by the aperture stop from a point in the image # or object plane. For a lens in air, n = 1, and # # NA = 0.5 / f-number # # convert NA to f-number numericalaperture(x) units=[1;1] domain=(0,1] range=[0.5,) \ 0.5 / x ; 0.5 / numericalaperture NA() numericalaperture # # convert f-number to itself; restrict values to those possible fnumber(x) units=[1;1] domain=[0.5,) range=[0.5,) x ; fnumber # Referenced Photographic Standards # # ASA PH-2.5-1960. USA Standard, Method for Determining (Monochrome, # Continuous-Tone) Speed of Photographic Negative Materials. # ASA PH2.12-1961. American Standard, General-Purpose Photographic # Exposure Meters (photoelectric type). # ANSI PH3.49-1971. American National Standard for general-purpose # photographic exposure meters (photoelectric type). # ANSI PH2.7-1973. American National Standard Photographic Exposure Guide. # ANSI PH2.7-1986. American National Standard for Photography -- # Photographic Exposure Guide. # CIPA DC-008-2010. Exchangeable image file format for digital still # cameras: Exif Version 2.3 # ISO 6:1993. International Standard, Photography -- Black-and-white # pictorial still camera negative film/process systems -- # Determination of ISO Speed. # # Astronomical time measurements # # Astronomical time measurement is a complicated matter. The length of the # true day at a given place can be 21 seconds less than 24 hours or 30 seconds # over 24 hours. The two main reasons for this are the varying speed of # Earth in its elliptical orbit and the fact that the Sun moves on the ecliptic # instead of along the celestial equator. To devise a workable system for time # measurement, Simon Newcomb (1835-1909) used a fictitious "mean Sun". # Consider a first fictitious Sun traveling along the ecliptic at a constant # speed and coinciding with the true Sun at perigee and apogee. Then # considering a second fictitious Sun traveling along the celestial equator at # a constant speed and coinciding with the first fictitious Sun at the # equinoxes. The second fictitious Sun is the "mean Sun". From this equations # can be written out to determine the length of the mean day, and the tropical # year. The length of the second was determined based on the tropical year # from such a calculation and was officially used from 1960-1967 until atomic # clocks replaced astronomical measurements for a standard of time. All of the # values below give the mean time for the specified interval. # # See "Mathematical Astronomy Morsels" by Jean Meeus for more details # and a description of how to compute the correction to mean time. # TIME second anomalisticyear 365.2596 days # The time between successive # perihelion passages of # Earth. siderealyear 365.256360417 day # The time for Earth to make # one revolution around the Sun # relative to the stars. tropicalyear 365.242198781 day # The time needed for the mean Sun # as defined above to increase # its longitude by 360 degrees. # Most references defined the # tropical year as the interval # between vernal equinoxes, but # this is misleading. The length # of the season changes over time # because of the eccentricity of # Earth's orbit. The time # between vernal equinoxes is # approximately 365.24237 days # around the year 2000. See # "Mathematical Astronomy # Morsels" for more details. eclipseyear 346.62 days # The line of nodes is the # intersection of the plane of # Earth's orbit around the Sun # with the plane of the Moon's # orbit around Earth. Eclipses # can only occur when the Moon # and Sun are close to this # line. The line rotates and # appearances of the Sun on the # line of nodes occur every # eclipse year. saros 223 synodicmonth # The Earth, Moon and Sun appear in # the same arrangement every # saros, so if an eclipse occurs, # then one saros later, a similar # eclipse will occur. (The saros # is close to 19 eclipse years.) # The eclipse will occur about # 120 degrees west of the # preceding one because the # saros is not an even number of # days. After 3 saros, an # eclipse will occur at # approximately the same place. solarday day # Time from noon to noon siderealday 86164.09054 s # The sidereal day is the interval siderealhour 1|24 siderealday # between two successive transits siderealminute 1|60 siderealhour # of a star over the meridian, siderealsecond 1|60 siderealminute # or the time required for # Earth to make one rotation # relative to the stars. Another # way to think about it is to # imagine looking down at the # solar system and noting when # Earth has made a rotation. # The more usual solar day is the # time required to make a # rotation relative to the Sun, # which means the same point on # Earth faces the Sun again. # Because Earth moves in its # orbit, it has to rotate a bit # more to face the Sun again, # hence the solar day is slightly # longer than the sidereal day. # The value given here is the # mean day length taken from # ssd.jpl.nasa.gov/astro_par.html # which in turn cites the # "Explanatory Supplement to the # Astronomical Almanac", 1992. anomalisticmonth 27.55454977 day # Time for the Moon to travel from # perigee to perigee nodicalmonth 27.2122199 day # The nodes are the points where draconicmonth nodicalmonth # an orbit crosses the ecliptic. draconiticmonth nodicalmonth # This is the time required to # travel from the ascending node # to the next ascending node. siderealmonth 27.321661 day # Time required for the Moon to # orbit the Earth lunarmonth 29 days + 12 hours + 44 minutes + 2.8 seconds # Mean time between full moons. synodicmonth lunarmonth # Full moons occur when the Sun lunation synodicmonth # and Moon are on opposite sides lune 1|30 lunation # of the Earth. Since the Earth lunour 1|24 lune # moves around the Sun, the Moon # has to move a bit further in its # orbit to return to the full moon # configuration. year tropicalyear yr year month 1|12 year mo month lustrum 5 years # The Lustrum was a Roman # purification ceremony that took # place every five years. # Classically educated Englishmen # used this term. decade 10 years century 100 years millennium 1000 years millennia millennium solaryear year lunaryear 12 lunarmonth calendaryear 365 day commonyear 365 day leapyear 366 day julianyear 365.25 day gregorianyear 365.2425 day islamicyear 354 day # A year of 12 lunar months. They islamicleapyear 355 day # began counting on July 16, AD 622 # when Muhammad emigrated to Medina # (the year of the Hegira). They need # 11 leap days in 30 years to stay in # sync with the lunar year which is a # bit longer than the 29.5 days of the # average month. The months do not # keep to the same seasons, but # regress through the seasons every # 32.5 years. islamicmonth 1|12 islamicyear # They have 29 day and 30 day months. # The Hebrew year is also based on lunar months, but synchronized to the solar # calendar. The months vary irregularly between 29 and 30 days in length, and # the years likewise vary. The regular year is 353, 354, or 355 days long. To # keep up with the solar calendar, a leap month of 30 days is inserted every # 3rd, 6th, 8th, 11th, 14th, 17th, and 19th years of a 19 year cycle. This # gives leap years that last 383, 384, or 385 days. # # Planetary data from JPL's planet fact sheets. Each planet has its # own sheet at https://nssdc.gsfc.nasa.gov/planetary/factsheet/fact.html # The source for data on the fact sheets is described at # https://nssdc.gsfc.nasa.gov/planetary/factsheet/fact_notes.html # and they also indicate that the values listed are not "official" values: # there is no no single set of agreed upon values. # Sidereal days. The sidereal day is the time required for a planet to make a # revolution relative to the stars. This is the default day value. mercuryday mercuryday_sidereal venusday venusday_sidereal earthday earthday_sidereal marsday marsday_sidereal jupiterday jupiterday_sidereal saturnday saturnday_sidereal uranusday uranusday_sidereal neptuneday neptuneday_sidereal plutoday plutoday_sidereal mercuryday_sidereal 1407.6 hr # Mercury is in a 3:2 resonance lock # where it makes 3 rotations per 2 orbits # so 3 sidereal days = 2 years venusday_sidereal 5832.6 hr # Retrograde earthday_sidereal siderealday marsday_sidereal 24.6229 hr jupiterday_sidereal 9.9250 hr saturnday_sidereal 10.656 hr uranusday_sidereal 17.24 hr # Retrograde neptuneday_sidereal 16.11 hr plutoday_sidereal 153.2928 hr # Retrograde # In astronomy, an object's rotation is "prograde" if it rotates in # the same direction as the primary object it orbits. Prograde # rotation is the more common case: in Earth's solar system, Mercury, # Earth, Mars, Jupiter, Saturn, and Neptune have prograde rotation. # When an object rotates opposite the direction of its primary object, # the object's rotation is "retrograde". Venus, Uranus, and Pluto have # retrograde rotation. # # The solar (or synodic) day is the time from noon to noon on a planet. This # is different from the sidereal day because the planet has moved in its orbit, # so (if its rotation is prograde) it needs additional rotation to return to # the same orientation relative to the Sun. In one orbital period (a year), # this amounts to one additional complete rotation, so the number of sidereal # days in a year is one greater than the number of solar days. # # If the planet's rotation is retrograde, less rotation is needed to return to # the same orientation relative to the Sun, and the number of sidereal days in # a year is one fewer than the number of solar days. # # The solar day can be computed from the sidereal day in the typical prograde # case by: # solar_day = sidereal_day year / (year - sidereal_day) # If the planet's rotation is retrograde like Venus then the formula is # solar_day = sidereal_day year / (year + sidereal_day) # If the sidereal day and year are the same length then the same face of the # planet faces the Sun and there is no solar day. mercuryday_solar 4222.6 hr venusday_solar 2802.0 hr earthday_solar 24 hr marsday_solar 24.6597 hr jupiterday_solar 9.9259 hr saturnday_solar 10.656 hr uranusday_solar 17.24 hr neptuneday_solar 16.11 hr plutoday_solar 153.2820 hr # Sidereal years mercuryyear 87.969 day venusyear 224.701 day earthyear siderealyear marsyear 686.980 day jupiteryear 4332.589 day saturnyear 10759.22 day uranusyear 30685.4 day neptuneyear 60189 day plutoyear 90560 day # Equatorial radii for the planets from JPL fact sheets mercuryradius 2440.5 km venusradius 6051.8 km earthradius 6371.01 km marsradius 3396.2 km jupiterradius 71492 km # 1 bar level saturnradius 60268 km # 1 bar level uranusradius 25559 km # 1 bar level neptuneradius 24764 km # 1 bar level plutoradius 1188 km mercurysundist_min 46.000 Gm mercurysundist_max 69.818 Gm venussundist_min 107.480 Gm venussundist_max 108.941 Gm earthsundist_min sundist_min earthsundist_max sundist_max marssundist_min 206.650 Gm marssundist_max 249.261 Gm jupitersundist_min 740.595 Gm jupitersundist_max 816.363 Gm saturnsundist_min 1357.554 Gm saturnsundist_max 1506.527 Gm uranussundist_min 2732.696 Gm uranussundist_max 3001.390 Gm neptunesundist_min 4471.050 Gm neptunesundist_max 4558.857 Gm plutosundist_min 4434.987 Gm plutosundist_max 7304.326 Gm sundist 1.0000010178 au # mean Earth-Sun distance moondist 3.844e8 m # mean Earth-Moon distance sundist_near 147.095 Gm # Earth-Sun distance at perihelion sundist_min sundist_near sundist_far 152.100 Gm # Earth-Sun distance at aphelion sundist_max sundist_far # The Earth-Moon distances at perigee and apogee are different for every # lunation. The values here are the extremes for 1500-2500 according to # Jean Meeus's Astronomical Algorithms (1991, 332). moondist_min 356.371 km # minimum distance at perigee 1500-2500 moondist_max 406.720 km # maximum distance at apogee 1500-2500 # Objects on Earth are charted relative to a perfect ellipsoid whose # dimensions are specified by different organizations. The ellipsoid is # specified by an equatorial radius and a flattening value which defines the # polar radius. These values are the 1996 values given by the International # Earth Rotation Service (IERS) whose reference documents can be found at # http://maia.usno.navy.mil/ earthflattening IERS_earthflattening earthradius_equatorial IERS_earthradius_equatorial earthradius_polar (1-earthflattening) earthradius_equatorial # The World Geodetic System maintains a standard, WGS84, which is used by the # the GPS system. This system uses a conventional ellipsoid that was fixed in # 1984 and has remained constant so that data collected at different times is # referenced to the same ellipsoid. https://epsg.io/4326 WGS84_earthflattening 1|298.257223563 WGS84_earthradius_equatorial 6378137 m WGS84_earthradius_polar (1-WGS84_earthflattening) WGS84_earthradius_equatorial # The International Earth Rotation Service (IERS) attempts to # maintain an accurate model of Earth, with updates to maintain the highest # possible accuracy, even though this makes it more difficult to relate geodetic # mesurements made at different times. Values below are from the 2017 standard. # https://iers-conventions.obspm.fr/content/chapter1/icc1.pdf IERS_earthflattening 1|298.25642 IERS_earthradius_equatorial 6378136.6 m IERS_earthradius_polar (1-IERS_earthflattening) IERS_earthradius_equatorial landarea 148.847e6 km^2 oceanarea 361.254e6 km^2 moonradius 1738 km # mean value sunradius 6.96e8 m # Many astronomical values can be measured most accurately in a system of units # using the astronomical unit and the mass of the Sun as base units. The # uncertainty in the gravitational constant makes conversion to SI units # significantly less accurate. # The astronomical unit was defined to be the length of the of the semimajor # axis of a massless object with the same year as Earth. With such a # definition in force, and with the mass of the Sun set equal to one, Kepler's # third law can be used to solve for the value of the gravitational constant. # Kepler's third law says that (2 pi / T)^2 a^3 = G M where T is the orbital # period, a is the size of the semimajor axis, G is the gravitational constant # and M is the mass. With M = 1 and T and a chosen for Earth's orbit, we # find sqrt(G) = (2 pi / T) sqrt(AU^3). This constant is called the Gaussian # gravitational constant, apparently because Gauss originally did the # calculations. However, when the original calculation was done, the value # for the length of Earth's year was inaccurate. The value used is called # the Gaussian year. Changing the astronomical unit to bring it into # agreement with more accurate values for the year would have invalidated a # lot of previous work, so instead the astronomical unit has been kept equal # to this original value. This is accomplished by using a standard value for # the Gaussian gravitational constant. This constant is called k. gauss_k 0.01720209895 # This beast has dimensions of # au^(3|2) / day and is exact. gaussianyear (2 pi / gauss_k) days # Year that corresponds to the Gaussian # gravitational constant. This is a # fictional year, and doesn't # correspond to any celestial event. #astronomicalunit 149597870700 m # IAU definition from 2012, exact #au astronomicalunit # ephemeris for the above described # astronomical unit. (See the NASA # site listed above.) GMsun 132712440041.279419 km^3 / s^2 # heliocentric gravitational constant solarmass GMsun/G # is known more accurately than G. sunmass solarmass # Estimated from DE440 # The following are masses for planetary systems, not just the planet itself, # except for the case of Earth, where the Moon is excluded. Masses are # relative to G because they are known much more accurately than G. # # See https://ssd.jpl.nasa.gov/astro_par.html. Values are from # the DE440 Ephermeris: https://ssd.jpl.nasa.gov/doc/Park.2021.AJ.DE440.pdf mercurymass 22031.868551 km^3 / s^2 G venusmass 324858.592000 km^3 / s^2 G marsmass 42828.375816 km^3 / s^2 G jupitermass 126712764.100000 km^3 / s^2 G saturnmass 37940584.841800 km^3 / s^2 G uranusmass 5794556.400000 km^3 / s^2 G neptunemass 6836527.100580 km^3 / s^2 G plutomass 975.500000 km^3 / s^2 G ceresmass 62.62890 km^3 / s^2 G vestamass 17.288245 km^3 / s^2 G earthmass 398600.435507 km^3 / s^2 G # Earth alone moonmass 4902.800118 km^3 / s^2 G moonearthmassratio moonmass/earthmass earthmoonmass earthmass+moonmass moongravity 1.62 m/s^2 # Earth gravity values at the equator and poles. These values are # obtained from the WGS84 model. gravity_equatorial 9.7803263359 m / s^2 gravity_polar 9.8321849378 m / s^2 # The Hubble constant gives the speed at which distance galaxies are moving # away from Earth according to v = H0*d, where H0 is the hubble constant # and d is the distance to the galaxy. hubble 70 km/s/Mpc # approximate H0 hubble # Parallax is the angular difference between the topocentric (on Earth's # surface) and geocentric (at Earth's center) direction toward a celestial body # when the body is at a given altitude. When the body is on the horizon, the # parallax is the horizontal parallax; when the body is on the horizon and the # observer is on the equator, the parallax is the equatorial horizontal # parallax. When the body is at zenith, the parallax is zero. lunarparallax asin(earthradius_equatorial / moondist) # Moon equatorial moonhp lunarparallax # horizontal parallax # at mean distance # Light from celestial objects is attenuated by passage through Earth's # atmosphere. A body near the horizon passes through much more air than an # object at zenith, and is consequently less bright. Air mass is the ratio of # the length of the optical path at a given altitude (angle above the horizon) # to the length at zenith. Air mass at zenith is by definition unity; at the # horizon, air mass is approximately 38, though the latter value can vary # considerably with atmospheric conditions. The general formula is # E = E0 # exp(-c X), where E0 is the value outside Earth's atmosphere, E is the value # seen by an observer, X is the air mass and c is the extinction coefficient. # A common value for c in reasonably clear air is 0.21, but values can be # considerably greater in urban areas. Apparent altitude is that perceived by # an observer; it includes the effect of atmospheric refraction. There is no # shortage of formulas for air mass # (https://en.wikipedia.org/wiki/Air_mass_(astronomy)); all are subject to # variations in local atmospheric conditions. The formula used here is simple # and is in good agreement with rigorously calculated values under standard # conditions. # # Extraterrestrial illuminance or luminance of an object at a given altitude # determined with vmag() or SB_xxx() below can be multiplied by # atm_transmission() or atm_transmissionz() to estimate the terrestrial value. # # Kasten and Young (1989) air mass formula. alt is apparent altitude # Reference: # Kasten, F., and A.T. Young. 1989. "Revised Optical Air Mass Tables # and Approximation Formula." Applied Optics. Vol. 28, 4735–4738. # Bibcode:1989ApOpt..28.4735K. doi:10.1364/AO.28.004735. airmass(alt) units=[degree;1] domain=[0,90] noerror \ 1 / (sin(alt) + 0.50572 (alt / degree + 6.07995)^-1.6364) # zenith is apparent zenith angle (zenith = 90 deg - alt) airmassz(zenith) units=[degree;1] domain=[0,90] noerror \ 1 / (cos(zenith) + 0.50572 (96.07995 - zenith / degree)^-1.6364) # For reasonably clear air at sea level; values may need adjustment for # elevation and local atmospheric conditions # for scotopic vision (510 nm), appropriate for the dark-adapted eye # extinction_coeff 0.26 # for photopic vision, appropriate for observing brighter objects such # as the full moon extinction_coeff 0.21 atm_transmission(alt) units=[degree;1] domain=[0,90] noerror \ exp(-extinction_coeff airmass(alt)) # in terms of zenith angle (zenith = 90 deg - alt) atm_transmissionz(zenith) units=[degree;1] domain=[0,90] noerror \ exp(-extinction_coeff airmassz(zenith)) # Moon and Sun data at mean distances moonvmag -12.74 # Moon apparent visual magnitude at mean distance sunvmag -26.74 # Sun apparent visual magnitude at mean distance moonsd asin(moonradius / moondist) # Moon angular semidiameter at mean distance sunsd asin(sunradius / sundist) # Sun angular semidiameter at mean distance # Visual magnitude of star or other celestial object. The system of stellar # magnitudes, developed in ancient Greece, assigned magnitudes from 1 # (brightest) to 6 (faintest visible to the naked eye). In 1856, British # astronomer Norman Pogson made the system precise, with a magnitude 1 object # 100 times as bright as a magnitude 6 object, and each magnitude differing # from the next by a constant ratio; the ratio, sometimes known as Pogson's # ratio, is thus 100^0.2, or approximately 2.5119. The logarithm of 100^0.2 is # 0.4, hence the common use of powers of 10 and base-10 logarithms. # # Reference: # Allen, C.W. 1976. Astrophysical Quantities, 3rd ed. 1973, reprinted # with corrections, 1976. London: Athlone. # # The function argument is the (dimensionless) visual magnitude; reference # illuminance of 2.54e-6 lx is from Allen (2000, 21), and is for outside # Earth's atmosphere. Illuminance values can be adjusted to terrestrial values # by multiplying by one of the atm_transmission functions above. # Illuminance from apparent visual magnitude vmag(mag) units=[1;lx] domain=[,] range=(0,] \ 2.54e-6 lx 10^(-0.4 mag); -2.5 log(vmag / (2.54e-6 lx)) # Surface brightness of a celestial object of a given visual magnitude # is a logarithmic measure of the luminance the object would have if its # light were emitted by an object of specified solid angle; it is # expressed in magnitudes per solid angle. Surface brightness can be # obtained from the visual magnitude by # S = m + 2.5 log(pi pi k a b), # where k is the phase (fraction illuminated), a is the equatorial # radius, and b is the polar radius. For 100% illumination (e.g., full # moon), this is often simplified to # S = m + 2.5 log(pi k s^2), # where s is the object's angular semidiameter; the units of s determine # the units of solid angle. The visual magnitude and semidiameter must # be appropriate for the object's distance; for other than 100% # illumination, the visual magnitude must be appropriate for the phase. # Luminance values are for outside Earth's atmosphere; they can be # adjusted to terrestrial values by multiplying by one of the atm_transmission # functions above. # luminance from surface brightness in magnitudes per square degree SB_degree(sb) units=[1;cd/m^2] domain=[,] range=(0,] \ vmag(sb) / squaredegree ; \ ~vmag(SB_degree squaredegree) # luminance from surface brightness in magnitudes per square minute SB_minute(sb) units=[1;cd/m^2] domain=[,] range=(0,] \ vmag(sb) / squareminute ; \ ~vmag(SB_minute squareminute) # luminance from surface brightness in magnitudes per square second SB_second(sb) units=[1;cd/m^2] domain=[,] range=(0,] \ vmag(sb) / squaresecond ; \ ~vmag(SB_second squaresecond) # luminance from surface brightness in magnitudes per steradian SB_sr(sb) units=[1;cd/m^2] domain=[,] range=(0,] \ vmag(sb) / sr ; \ ~vmag(SB_sr sr) SB() SB_second SB_sec() SB_second SB_min() SB_minute SB_deg() SB_degree # The brightness of one tenth-magnitude star per square degree outside # Earth's atmosphere; often used for night sky brightness. S10 SB_degree(10) # Examples for magnitude and surface brightness functions # Sun illuminance from visual magnitude # You have: sunvmag # You want: # Definition: -26.74 = -26.74 # You have: vmag(sunvmag) # You want: lx # * 126134.45 # / 7.9280482e-06 # # Moon surface brightness from visual magnitude and semidiameter at 100% # illumination (full moon): # You have: moonvmag # You want: # Definition: -12.74 = -12.74 # You have: moonsd # You want: arcsec # * 932.59484 # / 0.001072277 # You have: moonvmag + 2.5 log(pi 932.59484^2) # You want: # Definition: 3.3513397 # # Similar example with specific data obtained from another source (JPL # Horizons, https://ssd.jpl.nasa.gov/horizons.cgi); semidiameter is in # arcseconds # # You have: -12.9 + 2.5 log(pi 2023.201|2^2) # You want: # Definition: 3.3679199 # You have: SB_second(-12.9 + 2.5 log(pi 2023.201|2^2)) # You want: # Definition: 4858.6547 cd / m^2 # # If surface brightness is provided by another source (e.g., Horizons), # it can simply be used directly: # You have: SB_second(3.3679199) # You want: cd/m^2 # * 4858.6546 # / 0.0002058183 # The illuminance and luminance values are extraterrestrial (outside # Earth's atmosphere). The values at Earth's surface are less than these # because of atmospheric extinction. For example, in the last example # above, if the Moon were at an altitude of 55 degrees, the terrestrial # luminance could be calculated with # You have: SB_second(3.3679199) # You want: cd/m^2 # * 4858.6546 # / 0.0002058183 # You have: _ atm_transmission(55 deg) # You want: cd/m^2 # * 3760.6356 # / 0.0002659125 # If desired, photographic exposure can be determined with EV100(), # leading to acceptable combinations of aperture and exposure time. # For the example above, but with the Moon at 10 degrees, # You have: SB_second(3.3679199) atm_transmission(10 deg) # You want: EV100 # 13.553962 # # The Hartree system of atomic units, derived from fundamental units # of mass (of the electron), action (Planck's constant), charge, and # the Coulomb constant. This system is used in the fields of physical # chemistry and condensed matter physics. # # Fundamental units atomicmass electronmass atomiccharge e atomicaction hbar atomicenergy hartree # Derived units atomicvelocity sqrt(atomicenergy / atomicmass) atomictime atomicaction / atomicenergy atomiclength atomicvelocity atomictime atomicforce atomicenergy / atomiclength atomicmomentum atomicenergy / atomicvelocity atomiccurrent atomiccharge / atomictime atomicpotential atomicenergy / atomiccharge # electrical potential atomicvolt atomicpotential atomicEfield atomicpotential / atomiclength atomicBfield atomicEfield / atomicvelocity atomictemperature atomicenergy / boltzmann # # In Hartree units, m_e = hbar = e = coulombconst = bohrradius = alpha*c = 1 # !var UNITS_SYSTEM hartree !message Hartree units selected !prompt (hartree) +hartree 1 +kg 1/electronmass_SI +K k_SI / hbar_SI s +m alpha c_SI electronmass_SI / hbar_SI +s alpha c_SI m +A 1 / s e_SI !endvar # # These thermal units treat entropy as charge, from [5] # thermalcoulomb J/K # entropy thermalampere W/K # entropy flow thermalfarad J/K^2 thermalohm K^2/W # thermal resistance fourier thermalohm thermalhenry J K^2/W^2 # thermal inductance thermalvolt K # thermal potential difference # # United States units # # linear measure # The US Metric Law of 1866 legalized the metric system in the USA and # defined the meter in terms of the British system with the exact # 1 meter = 39.37 inches. On April 5, 1893 Thomas Corwin Mendenhall, # Superintendent of Weights and Measures, decided, in what has become # known as the "Mendenhall Order" that the meter and kilogram would be the # fundamental standards in the USA. The definition from 1866 was turned # around to give an exact definition of the yard as 3600|3937 meters This # definition was used until July of 1959 when the definition was changed # to bring the US and other English-speaking countries into agreement; the # Canadian value of 1 yard = 0.9144 meter (exactly) was chosen because it # was approximately halfway between the British and US values; it had the # added advantage of making 1 inch = 25.4 mm (exactly). Since 1959, the # "international" foot has been exactly 0.3048 meters. At the same time, # it was decided that any data expressed in feet derived from geodetic # surveys within the US would continue to use the old definition and call # the old unit the "survey foot." The US continues to define the statute # mile, furlong, chain, rod, link, and fathom in terms of the US survey # foot. # Sources: # NIST Special Publication 447, Sects. 5, 7, and 8. # NIST Handbook 44, 2011 ed., Appendix C. # Canadian Journal of Physics, 1959, 37:(1) 84, 10.1139/p59-014. US 1200|3937 m/ft # These four values will convert US- US # international measures to survey- US # US Survey measures geodetic- US int 3937|1200 ft/m # Convert US Survey measures to int- int # international measures yard 3 ft yd yard mile 5280 ft # The mile was enlarged from 5000 ft # to this number in order to make # it an even number of furlongs. # (The Roman mile is 5000 romanfeet.) line 1|12 inch # Also defined as '.1 in' or as '1e-8 Wb' rod 5.5 yard perch rod furlong 40 rod # From "furrow long" statutemile mile league 3 mile # Intended to be an an hour's walk # surveyor's measure surveyorschain 66 surveyft surveychain surveyorschain surveyorspole 1|4 surveyorschain surveyorslink 1|100 surveyorschain chain 66 ft link 1|100 chain ch chain USacre 10 surveychain^2 intacre 10 chain^2 # Acre based on international ft intacrefoot acre foot USacrefoot USacre surveyfoot acrefoot intacrefoot acre intacre section mile^2 township 36 section homestead 160 acre # Area of land granted by the 1862 Homestead # Act of the United States Congress gunterschain surveyorschain engineerschain 100 ft engineerslink 1|100 engineerschain ramsdenschain engineerschain ramsdenslink engineerslink gurleychain 33 feet # Andrew Ellicott chain is the gurleylink 1|50 gurleychain # same length wingchain 66 feet # Chain from 1664, introduced by winglink 1|80 wingchain # Vincent Wing, also found in a # 33 foot length with 40 links. # early US length standards # The US has had four standards for the yard: one by Troughton of London # (1815); bronze yard #11 (1856); the Mendhall yard (1893), consistent # with the definition of the meter in the metric joint resolution of # Congress in 1866, but defining the yard in terms of the meter; and the # international yard (1959), which standardized definitions for Australia, # Canada, New Zealand, South Africa, the UK, and the US. # Sources: Pat Naughtin (2009), Which Inch?, www.metricationmatters.com; # Lewis E. Barbrow and Lewis V. Judson (1976). NBS Special Publication # 447, Weights and Measures Standards of the United States: A Brief # History. troughtonyard 914.42190 mm bronzeyard11 914.39980 mm mendenhallyard surveyyard internationalyard yard # nautical measure fathom 6 ft # Originally defined as the distance from # fingertip to fingertip with arms fully # extended. nauticalmile 1852 m # Supposed to be one minute of latitude at # the equator. That value is about 1855 m. # Early estimates of Earth's circumference # were a bit off. The value of 1852 m was # made the international standard in 1929. # The US did not accept this value until # 1954. The UK switched in 1970. cable 1|10 nauticalmile intcable cable # international cable cablelength cable UScable 100 USfathom navycablelength 720 USft # used for depth in water marineleague 3 nauticalmile geographicalmile brnauticalmile knot nauticalmile / hr click km # US military slang klick click # Avoirdupois weight pound 0.45359237 kg # The one normally used lb pound # From the latin libra grain 1|7000 pound # The grain is the same in all three # weight systems. It was originally # defined as the weight of a barley # corn taken from the middle of the # ear. ounce 1|16 pound oz ounce dram 1|16 ounce dr dram ushundredweight 100 pounds cwt hundredweight shorthundredweight ushundredweight uston shortton shortton 2000 lb quarterweight 1|4 uston shortquarterweight 1|4 shortton shortquarter shortquarterweight # Troy Weight. In 1828 the troy pound was made the first United States # standard weight. It was to be used to regulate coinage. troypound 5760 grain troyounce 1|12 troypound ozt troyounce pennyweight 1|20 troyounce # Abbreviated "d" in reference to a dwt pennyweight # Frankish coin called the "denier" # minted in the late 700's. There # were 240 deniers to the pound. assayton mg ton / troyounce # mg / assayton = troyounce / ton usassayton mg uston / troyounce brassayton mg brton / troyounce fineounce troyounce # A troy ounce of 99.5% pure gold # Some other jewelers units metriccarat 0.2 gram # Defined in 1907 metricgrain 50 mg carat metriccarat ct carat jewelerspoint 1|100 carat silversmithpoint 1|4000 inch momme 3.75 grams # Traditional Japanese unit based # on the chinese mace. It is used for # pearls in modern times and also for # silk density. The definition here # was adopted in 1891. # Apothecaries' weight appound troypound apounce troyounce apdram 1|8 apounce apscruple 1|3 apdram # Liquid measure usgallon 231 in^3 # US liquid measure is derived from gallon usgallon gal gallon # the British wine gallon of 1707. quart 1|4 gallon # See the "winegallon" entry below pint 1|2 quart # more historical information. gill 1|4 pint usquart 1|4 usgallon uspint 1|2 usquart usgill 1|4 uspint usfluidounce 1|16 uspint fluiddram 1|8 usfloz minimvolume 1|60 fluiddram qt quart pt pint floz fluidounce usfloz usfluidounce fldr fluiddram liquidbarrel 31.5 usgallon usbeerbarrel 2 beerkegs beerkeg 15.5 usgallon # Various among brewers ponykeg 1|2 beerkeg winekeg 12 usgallon petroleumbarrel 42 usgallon # Originated in Pennsylvania oil barrel petroleumbarrel # fields, from the winetierce bbl barrel ushogshead 2 liquidbarrel usfirkin 9 usgallon # Dry measures: The Winchester Bushel was defined by William III in 1702 and # legally adopted in the US in 1836. usbushel 2150.42 in^3 # Volume of 8 inch cylinder with 18.5 bu bushel # inch diameter (rounded) peck 1|4 bushel uspeck 1|4 usbushel brpeck 1|4 brbushel pk peck drygallon 1|2 uspeck dryquart 1|4 drygallon drypint 1|2 dryquart drybarrel 7056 in^3 # Used in US for fruits, vegetables, # and other dry commodities except for # cranberries. cranberrybarrel 5826 in^3 # US cranberry barrel heapedbushel 1.278 usbushel# The following explanation for this # value was provided by Wendy Krieger # based on # guesswork. The cylindrical vessel is # 18.5 inches in diameter and 1|2 inch # thick. A heaped bushel includes the # contents of this cylinder plus a heap # on top. The heap is a cone 19.5 # inches in diameter and 6 inches # high. With these values, the volume # of the bushel is 684.5 pi in^3 and # the heap occupies 190.125 pi in^3. # Therefore, the heaped bushel is # 874.625|684.5 bushels. This value is # approximately 1.2777575 and it rounds # to the value listed for the size of # the heaped bushel. Sometimes the # heaped bushel is reported as 1.25 # bushels. This same explanation gives # that value if the heap is taken to # have an 18.5 inch diameter. # Grain measures. The bushel as it is used by farmers in the USA is actually # a measure of mass which varies for different commodities. Canada uses the # same bushel masses for most commodities, but not for oats. wheatbushel 60 lb soybeanbushel 60 lb cornbushel 56 lb ryebushel 56 lb barleybushel 48 lb oatbushel 32 lb ricebushel 45 lb canada_oatbushel 34 lb # Wine and Spirits measure ponyvolume 1 usfloz jigger 1.5 usfloz # Can vary between 1 and 2 usfloz shot jigger # Sometimes 1 usfloz eushot 25 ml # EU standard spirits measure fifth 1|5 usgallon winebottle 750 ml # US industry standard, 1979 winesplit 1|4 winebottle magnum 1.5 liter # Standardized in 1979, but given # as 2 qt in some references metrictenth 375 ml metricfifth 750 ml metricquart 1 liter # Old British bottle size reputedquart 1|6 brgallon reputedpint 1|2 reputedquart brwinebottle reputedquart # Very close to 1|5 winegallon # French champagne bottle sizes split 200 ml jeroboam 2 magnum rehoboam 3 magnum methuselah 4 magnum imperialbottle 4 magnum salmanazar 6 magnum balthazar 8 magnum nebuchadnezzar 10 magnum solomon 12 magnum melchior 12 magnum sovereign 17.5 magnum primat 18 magnum goliath 18 magnum melchizedek 20 magnum midas 20 magnum # The wine glass doesn't seem to have an official standard, but the same value # is suggested by several organization. # https://www.rethinkingdrinking.niaaa.nih.gov/ # http://www.rethinkyourdrinking.ca/what-is-a-standard-drink/ # https://www.drinkaware.co.uk/ # https://www.gov.uk/government/uploads/system/uploads/attachment_data/file/545937/UK_CMOs__report.pdf # http://www.alcohol.gov.au/internet/alcohol/publishing.nsf/content/drinksguide-cnt wineglass 150 mL # the size of a "typical" serving # A unit of alcohol is a specified mass of pure ethyl alcohol. # The term is used officially in the UK, but other countries use the same # concept but with different values. For example, the UK value of 8 g is # nominally the amount of alcohol that a typical adult can metabolize in # one hour. Values for several countries, converted to a volumetric basis: alcoholunitus 14 g / ethanoldensity alcoholunitca 13.6 g / ethanoldensity alcoholunituk 8 g / ethanoldensity alcoholunitau 10 g / ethanoldensity # Example: for 12% ABV (alcohol by volume) # alcoholunitus / 12% = 147.8 mL, close to the “standard” serving of 150 mL. # Coffee # # The recommended ratio of coffee to water. Values vary considerably; # one is from the Specialty Coffee Association of America # http://scaa.org/?page=resources&d=brewing-best-practices coffeeratio 55 g/L # ± 10% # other recommendations are more loose, e.g., # http://www.ncausa.org/About-Coffee/How-to-Brew-Coffee # # Water is "hard" if it contains various minerals, expecially calcium # carbonate. # clarkdegree grains/brgallon # Content by weigh of calcium carbonate gpg grains/usgallon # Divide by water's density to convert to # a dimensionless concentration measure # # Shoe measures # shoeiron 1|48 inch # Used to measure leather in soles shoeounce 1|64 inch # Used to measure non-sole shoe leather # USA shoe sizes. These express the length of the shoe or the length # of the "last", the form that the shoe is made on. But note that # this only captures the length. It appears that widths change 1/4 # inch for each letter within the same size, and if you change the # length by half a size then the width changes between 1/8 inch and # 1/4 inch. But this may not be standard. If you know better, please # contact me. shoesize_delta 1|3 inch # USA shoe sizes differ by this amount shoe_men0 8.25 inch shoe_women0 (7+11|12) inch shoe_boys0 (3+11|12) inch shoe_girls0 (3+7|12) inch shoesize_men(n) units=[1;inch] shoe_men0 + n shoesize_delta ; \ (shoesize_men+(-shoe_men0))/shoesize_delta shoesize_women(n) units=[1;inch] shoe_women0 + n shoesize_delta ; \ (shoesize_women+(-shoe_women0))/shoesize_delta shoesize_boys(n) units=[1;inch] shoe_boys0 + n shoesize_delta ; \ (shoesize_boys+(-shoe_boys0))/shoesize_delta shoesize_girls(n) units=[1;inch] shoe_girls0 + n shoesize_delta ; \ (shoesize_girls+(-shoe_girls0))/shoesize_delta # European shoe size. According to # http://www.shoeline.com/footnotes/shoeterm.shtml # shoe sizes in Europe are measured with Paris points which simply measure # the length of the shoe. europeshoesize 2|3 cm # # USA slang units # buck US$ fin 5 US$ sawbuck 10 US$ usgrand 1000 US$ greenback US$ key kg # usually of marijuana, 60's lid 1 oz # Another 60's weed unit footballfield usfootballfield usfootballfield 100 yards canadafootballfield 110 yards # And 65 yards wide marathon 26 miles + 385 yards # # British # # The length measure in the UK was defined by a bronze bar manufactured in # 1844. Various conversions were sanctioned for convenience at different # times, which makes conversions before 1963 a confusing matter. Apparently # previous conversions were never explicitly revoked. Four different # conversion factors appear below. Multiply them times an imperial length # units as desired. The Weights and Measures Act of 1963 switched the UK away # from their bronze standard and onto a definition of the yard in terms of the # meter. This happened after an international agreement in 1959 to align the # world's measurement systems. UK UKlength_SJJ UK- UK british- UK UKlength_B 0.9143992 meter / yard # Benoit found the yard to be # 0.9143992 m at a weights and # measures conference around # 1896. Legally sanctioned # in 1898. UKlength_SJJ 0.91439841 meter / yard # In 1922, Seers, Jolly and # Johnson found the yard to be # 0.91439841 meters. # Used starting in the 1930's. UKlength_K meter / 39.37079 inch # In 1816 Kater found this ratio # for the meter and inch. This # value was used as the legal # conversion ratio when the # metric system was legalized # for contract in 1864. UKlength_C meter / 1.09362311 yard # In 1866 Clarke found the meter # to be 1.09362311 yards. This # conversion was legalized # around 1878. brnauticalmile 6080 ft # Used until 1970 when the UK brknot brnauticalmile / hr # switched to the international brcable 1|10 brnauticalmile # nautical mile. admiraltymile brnauticalmile admiraltyknot brknot admiraltycable brcable seamile 6000 ft shackle 15 fathoms # Adopted 1949 by British navy # British Imperial weight is mostly the same as US weight. A few extra # units are added here. clove 7 lb stone 14 lb tod 28 lb brquarterweight 1|4 brhundredweight brhundredweight 8 stone longhundredweight brhundredweight longton 20 brhundredweight brton longton # British Imperial volume measures brminim 1|60 brdram brscruple 1|3 brdram fluidscruple brscruple brdram 1|8 brfloz brfluidounce 1|20 brpint brfloz brfluidounce brgill 1|4 brpint brpint 1|2 brquart brquart 1|4 brgallon brgallon 4.54609 l # The British Imperial gallon was # defined in 1824 to be the volume of # water which weighed 10 pounds at 62 # deg F with a pressure of 30 inHg. # It was also defined as 277.274 in^3, # Which is slightly in error. In # 1963 it was defined to be the volume # occupied by 10 pounds of distilled # water of density 0.998859 g/ml weighed # in air of density 0.001217 g/ml # against weights of density 8.136 g/ml. # This gives a value of approximately # 4.5459645 liters, but the old liter # was in force at this time. In 1976 # the definition was changed to exactly # 4.54609 liters using the new # definition of the liter (1 dm^3). brbarrel 36 brgallon # Used for beer brbushel 8 brgallon brheapedbushel 1.278 brbushel brquarter 8 brbushel brchaldron 36 brbushel # Obscure British volume measures. These units are generally traditional # measures whose definitions have fluctuated over the years. Often they # depended on the quantity being measured. They are given here in terms of # British Imperial measures. For example, the puncheon may have historically # been defined relative to the wine gallon or beer gallon or ale gallon # rather than the British Imperial gallon. bag 4 brbushel bucket 4 brgallon kilderkin 2 brfirkin last 40 brbushel noggin brgill pottle 0.5 brgallon pin 4.5 brgallon puncheon 72 brgallon seam 8 brbushel coomb 4 brbushel boll 6 brbushel firlot 1|4 boll brfirkin 9 brgallon # Used for ale and beer cran 37.5 brgallon # measures herring, about 750 fish brwinehogshead 52.5 brgallon # This value is approximately equal brhogshead brwinehogshead # to the old wine hogshead of 63 # wine gallons. This adjustment # is listed in the OED and in # "The Weights and Measures of # England" by R. D. Connor brbeerhogshead 54 brgallon brbeerbutt 2 brbeerhogshead registerton 100 ft^3 # Used for internal capacity of ships shippington 40 ft^3 # Used for ship's cargo freight or timber brshippington 42 ft^3 # freightton shippington # Both register ton and shipping ton derive # from the "tun cask" of wine. displacementton 35 ft^3 # Approximate volume of a longton weight of # sea water. Measures water displaced by # ships. waterton 224 brgallon strike 70.5 l # 16th century unit, sometimes # defined as .5, 2, or 4 bushels # depending on the location. It # probably doesn't make a lot of # sense to define in terms of imperial # bushels. Zupko gives a value of # 2 Winchester grain bushels or about # 70.5 liters. amber 4 brbushel# Used for dry and liquid capacity [18] # British volume measures with "imperial" imperialminim brminim imperialscruple brscruple imperialdram brdram imperialfluidounce brfluidounce imperialfloz brfloz imperialgill brgill imperialpint brpint imperialquart brquart imperialgallon brgallon imperialbarrel brbarrel imperialbushel brbushel imperialheapedbushel brheapedbushel imperialquarter brquarter imperialchaldron brchaldron imperialwinehogshead brwinehogshead imperialhogshead brhogshead imperialbeerhogshead brbeerhogshead imperialbeerbutt brbeerbutt imperialfirkin brfirkin # obscure British lengths barleycorn 1|3 UKinch # Given in Realm of Measure as the # difference between successive shoe sizes nail 1|16 UKyard # Originally the width of the thumbnail, # or 1|16 ft. This took on the general # meaning of 1|16 and settled on the # nail of a yard or 1|16 yards as its # final value. [12] pole 16.5 UKft # This was 15 Saxon feet, the Saxon rope 20 UKft # foot (aka northern foot) being longer englishell 45 UKinch flemishell 27 UKinch ell englishell # supposed to be measure from elbow to # fingertips span 9 UKinch # supposed to be distance from thumb # to pinky with full hand extension goad 4.5 UKft # used for cloth, possibly named after the # stick used for prodding animals. # misc obscure British units hide 120 acre # English unit of land area dating to the 7th # century, originally the amount of land # that a single plowman could cultivate, # which varied from 60-180 acres regionally. # Standardized at Normon conquest. virgate 1|4 hide nook 1|2 virgate rood furlong rod # Area of a strip a rod by a furlong englishcarat troyounce/151.5 # Originally intended to be 4 grain # but this value ended up being # used in the London diamond market mancus 2 oz mast 2.5 lb nailkeg 100 lbs basebox 31360 in^2 # Used in metal plating # alternate spellings gramme gram litre liter dioptre diopter aluminium aluminum sulphur sulfur # # Units derived the human body (may not be very accurate) # geometricpace 5 ft # distance between points where the same # foot hits the ground pace 2.5 ft # distance between points where alternate # feet touch the ground USmilitarypace 30 in # United States official military pace USdoubletimepace 36 in # United States official doubletime pace fingerbreadth 7|8 in # The finger is defined as either the width fingerlength 4.5 in # or length of the finger finger fingerbreadth palmwidth hand # The palm is a unit defined as either the width palmlength 8 in # or the length of the hand hand 4 inch # width of hand shaftment 6 inch # Distance from tip of outstretched thumb to the # opposite side of the palm of the hand. The # ending -ment is from the old English word # for hand. [18] smoot 5 ft + 7 in # Created as part of an MIT fraternity prank. # In 1958 Oliver Smoot was used to measure # the length of the Harvard Bridge, which was # marked off in Smoot lengths. These # markings have been maintained on the bridge # since then and repainted by subsequent # incoming fraternity members. During a # bridge renovation the new sidewalk was # scored every Smoot rather than at the # customary 6 ft spacing. tomcruise 5 ft + 7.75 in # Height of Tom Cruise # # Cooking measures # # Common abbreviations tbl tablespoon tbsp tablespoon tblsp tablespoon Tb tablespoon tsp teaspoon saltspoon 1|4 tsp # US measures uscup 8 usfloz ustablespoon 1|16 uscup usteaspoon 1|3 ustablespoon ustbl ustablespoon ustbsp ustablespoon ustblsp ustablespoon ustsp usteaspoon metriccup 250 ml stickbutter 1|4 lb # Butter in the USA is sold in one # pound packages that contain four # individually wrapped pieces. The # pieces are marked into tablespoons, # making it possible to measure out # butter by volume by slicing the # butter. legalcup 240 ml # The cup used on nutrition labeling legaltablespoon 1|16 legalcup legaltbsp legaltablespoon # Scoop size. Ice cream scoops in the US are marked with numbers # indicating the number of scoops required to fill a US quart. scoop(n) units=[1;cup] domain=[4,100] range=[0.04,1] \ 32 usfloz / n ; 32 usfloz / scoop # US can sizes. number1can 10 usfloz number2can 19 usfloz number2_5can 3.5 uscups number3can 4 uscups number5can 7 uscups number10can 105 usfloz # British measures brcup 1|2 brpint brteacup 1|3 brpint brtablespoon 15 ml # Also 5|8 brfloz, approx 17.7 ml brteaspoon 1|3 brtablespoon # Also 1|4 brtablespoon brdessertspoon 2 brteaspoon dessertspoon brdessertspoon dsp dessertspoon brtsp brteaspoon brtbl brtablespoon brtbsp brtablespoon brtblsp brtablespoon # Australian australiatablespoon 20 ml austbl australiatablespoon austbsp australiatablespoon austblsp australiatablespoon australiateaspoon 1|4 australiatablespoon austsp australiateaspoon # Italian etto 100 g # Used for buying items like meat and etti etto # cheese. # Chinese catty 0.5 kg oldcatty 4|3 lbs # Before metric conversion. tael 1|16 oldcatty # Should the tael be defined both ways? mace 0.1 tael oldpicul 100 oldcatty picul 100 catty # Chinese usage # Indian seer 14400 grain # British Colonial standard ser seer maund 40 seer pakistanseer 1 kg pakistanmaund 40 pakistanseer chittak 1|16 seer tola 1|5 chittak ollock 1|4 liter # Is this right? # Japanese japancup 200 ml # densities of cooking ingredients from The Cake Bible by Rose Levy Beranbaum # so you can convert '2 cups sugar' to grams, for example, or in the other # direction grams could be converted to 'cup flour_scooped'. butter 8 oz/uscup butter_clarified 6.8 oz/uscup cocoa_butter 9 oz/uscup shortening 6.75 oz/uscup # vegetable shortening oil 7.5 oz/uscup cakeflour_sifted 3.5 oz/uscup # The density of flour depends on the cakeflour_spooned 4 oz/uscup # measuring method. "Scooped", or cakeflour_scooped 4.5 oz/uscup # "dip and sweep" refers to dipping a flour_sifted 4 oz/uscup # measure into a bin, and then sweeping flour_spooned 4.25 oz/uscup # the excess off the top. "Spooned" flour_scooped 5 oz/uscup # means to lightly spoon into a measure breadflour_sifted 4.25 oz/uscup # and then sweep the top. Sifted means breadflour_spooned 4.5 oz/uscup # sifting the flour directly into a breadflour_scooped 5.5 oz/uscup # measure and then sweeping the top. cornstarch 120 grams/uscup dutchcocoa_sifted 75 g/uscup # These are for Dutch processed cocoa dutchcocoa_spooned 92 g/uscup dutchcocoa_scooped 95 g/uscup cocoa_sifted 75 g/uscup # These are for nonalkalized cocoa cocoa_spooned 82 g/uscup cocoa_scooped 95 g/uscup heavycream 232 g/uscup milk 242 g/uscup sourcream 242 g/uscup molasses 11.25 oz/uscup cornsyrup 11.5 oz/uscup honey 11.75 oz/uscup sugar 200 g/uscup powdered_sugar 4 oz/uscup brownsugar_light 217 g/uscup # packed brownsugar_dark 239 g/uscup baking_powder 4.6 grams / ustsp salt 6 g / ustsp koshersalt 2.8 g / ustsp # Diamond Crystal kosher salt koshersalt_morton 4.8 g / ustsp # Morton kosher salt # Values are from the nutrition info # on the packages # Egg weights and volumes for a USA large egg egg 50 grams # without shell eggwhite 30 grams eggyolk 18.6 grams eggvolume 3 ustablespoons + 1|2 ustsp eggwhitevolume 2 ustablespoons eggyolkvolume 3.5 ustsp # Alcohol density ethanoldensity 0.7893 g/cm^3 # From CRC Handbook, 91st Edition alcoholdensity ethanoldensity # # Density measures. Density has traditionally been measured on a variety of # bizarre nonlinear scales. # # Density of a sugar syrup is frequently measured in candy making procedures. # In the USA the boiling point of the syrup is measured. Some recipes instead # specify the density using degrees Baume. Conversion between degrees Baume # and the boiling point measure has proved elusive. This table appeared in one # text, and provides a fragmentary relationship to the concentration. # # temp(C) conc (%) # 100 30 # 101 40 # 102 50 # 103 60 # 106 70 # 112 80 # 123 90 # 140 95 # 151 97 # 160 98.2 # 166 99.5 # 171 99.6 # # The best source identified to date came from "Boiling point elevation of # technical sugarcane solutions and its use in automatic pan boiling" by # Michael Saska. International Sugar Journal, 2002, 104, 1247, pp 500-507. # # But I'm using equation (3) which is credited to Starzak and Peacock, # "Water activity coefficient in aqueous solutions of sucrose--A comprehensive # data analysis. Zuckerindustrie, 122, 380-387. (I couldn't find this # document.) # # Note that the range of validity is uncertain, but answers are in agreement # with the above table all the way to 99.6. # # The original equation has a parameter for the boiling point of water, which # of course varies with altitude. It also includes various other model # parameters. The input is the molar concentration of sucrose in the solution, # (moles sucrose) / (total moles). # # Bsp 3797.06 degC # Csp 226.28 degC # QQ -17638 J/mol # asp -1.0038 # bsp -0.24653 # tbw 100 degC # boiling point of water # sugar_bpe_orig(x) ((1-QQ/R Bsp * x^2 (1+asp x + bsp x^2) (tbw + Csp) \ # /(tbw+stdtemp)) / (1+(tbw + Csp)/Bsp *ln(1-x))-1) * (tbw + Csp) # # To convert mass concentration (brix) to molar concentration # # sc(x) (x / 342.3) / (( x/342.3) + (100-x)/18.02); \ # 100 sc 342.3|18.02 / (sc (342.3|18.02-1)+1) # # Here is a simplified version of this equation where the temperature of boiling # water has been fixed at 100 degrees Celsius and the argument is now the # concentration (brix). # # sugar_bpe(x) ((1+ 0.48851085 * sc(x)^2 (1+ -1.0038 sc(x) + -0.24653 sc(x)^2)) \ # / (1+0.08592964 ln(1-sc(x)))-1) 326.28 K # # # The formula is not invertible, so to implement it in units we unfortunately # must turn it into a table. # This table gives the boiling point elevation as a function of the sugar syrup # concentration expressed as a percentage. sugar_conc_bpe[K] \ 0 0.0000 5 0.0788 10 0.1690 15 0.2729 20 0.3936 25 0.5351 \ 30 0.7027 35 0.9036 40 1.1475 42 1.2599 44 1.3825 46 1.5165 \ 48 1.6634 50 1.8249 52 2.0031 54 2.2005 56 2.4200 58 2.6651 \ 60 2.9400 61 3.0902 62 3.2499 63 3.4198 64 3.6010 65 3.7944 \ 66 4.0012 67 4.2227 68 4.4603 69 4.7156 70 4.9905 71 5.2870 \ 72 5.6075 73 5.9546 74 6.3316 75 6.7417 76 7.1892 77 7.6786 \ 78.0 8.2155 79.0 8.8061 80.0 9.4578 80.5 9.8092 81.0 10.1793 \ 81.5 10.5693 82.0 10.9807 82.5 11.4152 83.0 11.8743 83.5 12.3601 \ 84.0 12.8744 84.5 13.4197 85.0 13.9982 85.5 14.6128 86.0 15.2663 \ 86.5 15.9620 87.0 16.7033 87.5 17.4943 88.0 18.3391 88.5 19.2424 \ 89.0 20.2092 89.5 21.2452 90.0 22.3564 90.5 23.5493 91.0 24.8309 \ 91.5 26.2086 92.0 27.6903 92.5 29.2839 93.0 30.9972 93.5 32.8374 \ 94.0 34.8104 94.5 36.9195 95.0 39.1636 95.5 41.5348 96.0 44.0142 \ 96.5 46.5668 97.0 49.1350 97.5 51.6347 98.0 53.9681 98.1 54.4091 \ 98.2 54.8423 98.3 55.2692 98.4 55.6928 98.5 56.1174 98.6 56.5497 \ 98.7 56.9999 98.8 57.4828 98.9 58.0206 99.0 58.6455 99.1 59.4062 \ 99.2 60.3763 99.3 61.6706 99.4 63.4751 99.5 66.1062 99.6 70.1448 \ 99.7 76.7867 # Using the brix table we can use this to produce a mapping from boiling point # to density which makes all of the units interconvertible. Because the brix # table stops at 95 this approach works up to a boiling point elevation of 39 K # or a boiling point of 139 C / 282 F, which is the "soft crack" stage in candy # making. The "hard crack" stage continues up to 310 F. # Boiling point elevation sugar_bpe(T) units=[K;g/cm^3] domain=[0,39.1636] range=[0.99717,1.5144619] \ brix(~sugar_conc_bpe(T)); sugar_conc_bpe(~brix(sugar_bpe)) # Absolute boiling point (produces an absolute temperature) sugar_bp(T) units=[K;g/cm^3] domain=[373.15,412.3136] \ range=[0.99717,1.5144619] \ brix(~sugar_conc_bpe(T-tempC(100))) ;\ sugar_conc_bpe(~brix(sugar_bp))+tempC(100) # In practice dealing with the absolute temperature is annoying because it is # not possible to convert to a nested function, so you're stuck retyping the # absolute temperature in Kelvins to convert to celsius or Fahrenheit. To # prevent this we supply definitions that build in the temperature conversion # and produce results in the Fahrenheit and Celsius scales. So using these # measures, to convert 46 degrees Baume to a Fahrenheit boiling point: # # You have: baume(45) # You want: sugar_bpF # 239.05647 # sugar_bpF(T) units=[1;g/cm^3] domain=[212,282.49448] range=[0.99717,1.5144619]\ brix(~sugar_conc_bpe(tempF(T)+-tempC(100))) ;\ ~tempF(sugar_conc_bpe(~brix(sugar_bpF))+tempC(100)) sugar_bpC(T) units=[1;g/cm^3] domain=[100,139.1636] range=[0.99717,1.5144619]\ brix(~sugar_conc_bpe(tempC(T)+-tempC(100))) ;\ ~tempC(sugar_conc_bpe(~brix(sugar_bpC))+tempC(100)) # Degrees Baume is used in European recipes to specify the density of a sugar # syrup. An entirely different definition is used for densities below # 1 g/cm^3. An arbitrary constant appears in the definition. This value is # equal to 145 in the US, but was according to [], the old scale used in # Holland had a value of 144, and the new scale or Gerlach scale used 146.78. baumeconst 145 # US value baume(d) units=[1;g/cm^3] domain=[0,145) range=[1,) \ (baumeconst/(baumeconst+-d)) g/cm^3 ; \ (baume+((-g)/cm^3)) baumeconst / baume # It's not clear if this value was ever used with negative degrees. twaddell(x) units=[1;g/cm^3] domain=[-200,) range=[0,) \ (1 + 0.005 x) g / cm^3 ; \ 200 (twaddell / (g/cm^3) +- 1) # The degree quevenne is a unit for measuring the density of milk. # Similarly it's unclear if negative values were allowed here. quevenne(x) units=[1;g/cm^3] domain=[-1000,) range=[0,) \ (1 + 0.001 x) g / cm^3 ; \ 1000 (quevenne / (g/cm^3) +- 1) # Degrees brix measures sugar concentration by weigh as a percentage, so a # solution that is 3 degrees brix is 3% sugar by weight. This unit was named # after Adolf Brix who invented a hydrometer that read this percentage # directly. This data is from Table 114 of NIST Circular 440, "Polarimetry, # Saccharimetry and the Sugars". It gives apparent specific gravity at 20 # degrees Celsius of various sugar concentrations. As rendered below this # data is converted to apparent density at 20 degrees Celsius using the # density figure for water given in the same NIST reference. They use the # word "apparent" to refer to measurements being made in air with brass # weights rather than vacuum. brix[0.99717g/cm^3]\ 0 1.00000 1 1.00390 2 1.00780 3 1.01173 4 1.01569 5 1.01968 \ 6 1.02369 7 1.02773 8 1.03180 9 1.03590 10 1.04003 11 1.04418 \ 12 1.04837 13 1.05259 14 1.05683 15 1.06111 16 1.06542 17 1.06976 \ 18 1.07413 19 1.07853 20 1.08297 21 1.08744 22 1.09194 23 1.09647 \ 24 1.10104 25 1.10564 26 1.11027 27 1.11493 28 1.11963 29 1.12436 \ 30 1.12913 31 1.13394 32 1.13877 33 1.14364 34 1.14855 35 1.15350 \ 36 1.15847 37 1.16349 38 1.16853 39 1.17362 40 1.17874 41 1.18390 \ 42 1.18910 43 1.19434 44 1.19961 45 1.20491 46 1.21026 47 1.21564 \ 48 1.22106 49 1.22652 50 1.23202 51 1.23756 52 1.24313 53 1.24874 \ 54 1.25439 55 1.26007 56 1.26580 57 1.27156 58 1.27736 59 1.28320 \ 60 1.28909 61 1.29498 62 1.30093 63 1.30694 64 1.31297 65 1.31905 \ 66 1.32516 67 1.33129 68 1.33748 69 1.34371 70 1.34997 71 1.35627 \ 72 1.36261 73 1.36900 74 1.37541 75 1.38187 76 1.38835 77 1.39489 \ 78 1.40146 79 1.40806 80 1.41471 81 1.42138 82 1.42810 83 1.43486 \ 84 1.44165 85 1.44848 86 1.45535 87 1.46225 88 1.46919 89 1.47616 \ 90 1.48317 91 1.49022 92 1.49730 93 1.50442 94 1.51157 95 1.51876 # Density measure invented by the American Petroleum Institute. Lighter # petroleum products are more valuable, and they get a higher API degree. # # The intervals of range and domain should be open rather than closed. # apidegree(x) units=[1;g/cm^3] domain=[-131.5,) range=[0,) \ 141.5 g/cm^3 / (x+131.5) ; \ 141.5 (g/cm^3) / apidegree + (-131.5) # # Average densities of various woods (dried) # Data from The Wood Database https://www.wood-database.com # # North American Hardwoods wood_cherry 35 lb/ft^3 wood_redoak 44 lb/ft^3 wood_whiteoak 47 lb/ft^3 wood_blackwalnut 38 lb/ft^3 wood_walnut wood_blackwalnut wood_birch 43 lb/ft^3 wood_hardmaple 44 lb/ft^3 wood_bigleafmaple 34 lb/ft^3 wood_boxeldermaple 30 lb/ft^3 wood_redmaple 38 lb/ft^3 wood_silvermaple 33 lb/ft^3 wood_stripedmaple 32 lb/ft^3 wood_softmaple (wood_bigleafmaple \ + wood_boxeldermaple \ + wood_redmaple \ + wood_silvermaple \ + wood_stripedmaple) / 5 wood_poplar 29 lb/ft^3 wood_beech 45 lb/ft^3 # North American Softwoods wood_jeffreypine 28 lb/ft^3 wood_ocotepine 44 lb/ft^3 wood_ponderosapine 28 lb/ft^3 wood_loblollypine 35 lb/ft^3 wood_longleafpine 41 lb/ft^3 wood_shortleafpine 35 lb/ft^3 wood_slashpine 41 lb/ft^3 wood_yellowpine (wood_loblollypine \ + wood_longleafpine \ + wood_shortleafpine \ + wood_slashpine) / 4 wood_redpine 34 lb/ft^3 wood_easternwhitepine 25 lb/ft^3 wood_westernwhitepine 27 lb/ft^3 wood_whitepine (wood_easternwhitepine + wood_westernwhitepine) / 2 wood_douglasfir 32 lb/ft^3 wood_blackspruce 28 lb/ft^3 wood_engelmannspruce 24 lb/ft^3 wood_redspruce 27 lb/ft^3 wood_sitkaspruce 27 lb/ft^3 wood_whitespruce 27 lb/ft^3 wood_spruce (wood_blackspruce \ + wood_engelmannspruce \ + wood_redspruce \ + wood_sitkaspruce \ + wood_whitespruce) / 5 # Other woods wood_basswood 26 lb/ft^3 wood_balsa 9 lb/ft^3 wood_ebony_gaboon 60 lb/ft^3 wood_ebony_macassar 70 lb/ft^3 wood_mahogany 37 lb/ft^3 # True (Honduran) mahogany, # Swietenia macrophylla wood_teak 41 lb/ft^3 wood_rosewood_brazilian 52 lb/ft^3 wood_rosewood_honduran 64 lb/ft^3 wood_rosewood_indian 52 lb/ft^3 wood_cocobolo 69 lb/ft^3 wood_bubinga 56 lb/ft^3 wood_zebrawood 50 lb/ft^3 wood_koa 38 lb/ft^3 wood_snakewood 75.7 lb/ft^3 wood_lignumvitae 78.5 lb/ft^3 wood_blackwood 79.3 lb/ft^3 wood_blackironwood 84.5 lb/ft^3 # Krugiodendron ferreum, listed # in database as the heaviest wood # # Modulus of elasticity of selected woods. # Data from The Wood Database https://www.wood-database.com # # North American Hardwoods wood_mod_beech 1.720e6 lbf/in^2 wood_mod_birchyellow 2.010e6 lbf/in^2 wood_mod_birch wood_mod_birchyellow wood_mod_cherry 1.490e6 lbf/in^2 wood_mod_hardmaple 1.830e6 lbf/in^2 wood_mod_bigleafmaple 1.450e6 lbf/in^2 wood_mod_boxeldermaple 1.050e6 lbf/in^2 wood_mod_redmaple 1.640e6 lbf/in^2 wood_mod_silvermaple 1.140e6 lbf/in^2 wood_mod_softmaple (wood_mod_bigleafmaple \ + wood_mod_boxeldermaple \ + wood_mod_redmaple \ + wood_mod_silvermaple) / 4 wood_mod_redoak 1.761e6 lbf/in^2 wood_mod_whiteoak 1.762e6 lbf/in^2 wood_mod_poplar 1.580e6 lbf/in^2 wood_mod_blackwalnut 1.680e6 lbf/in^2 wood_mod_walnut wood_mod_blackwalnut # North American Softwoods wood_mod_jeffreypine 1.240e6 lbf/in^2 wood_mod_ocotepine 2.209e6 lbf/in^2 wood_mod_ponderosapine 1.290e6 lbf/in^2 wood_mod_loblollypine 1.790e6 lbf/in^2 wood_mod_longleafpine 1.980e6 lbf/in^2 wood_mod_shortleafpine 1.750e6 lbf/in^2 wood_mod_slashpine 1.980e6 lbf/in^2 wood_mod_yellowpine (wood_mod_loblollypine \ + wood_mod_longleafpine \ + wood_mod_shortleafpine \ + wood_mod_slashpine) / 4 wood_mod_redpine 1.630e6 lbf/in^2 wood_mod_easternwhitepine 1.240e6 lbf/in^2 wood_mod_westernwhitepine 1.460e6 lbf/in^2 wood_mod_whitepine (wood_mod_easternwhitepine + \ wood_mod_westernwhitepine) / 2 wood_mod_douglasfir 1.765e6 lbf/in^2 wood_mod_blackspruce 1.523e6 lbf/in^2 wood_mod_englemannspruce 1.369e6 lbf/in^2 wood_mod_redspruce 1.560e6 lbf/in^2 wood_mod_sitkaspruce 1.600e6 lbf/in^2 wood_mod_whitespruce 1.315e6 lbf/in^2 wood_mod_spruce (wood_mod_blackspruce \ + wood_mod_englemannspruce \ + wood_mod_redspruce + wood_mod_sitkaspruce \ + wood_mod_whitespruce) / 5 # Other woods wood_mod_balsa 0.538e6 lbf/in^2 wood_mod_basswood 1.460e6 lbf/in^2 wood_mod_blackwood 2.603e6 lbf/in^2 # African, Dalbergia melanoxylon wood_mod_bubinga 2.670e6 lbf/in^2 wood_mod_cocobolo 2.712e6 lbf/in^2 wood_mod_ebony_gaboon 2.449e6 lbf/in^2 wood_mod_ebony_macassar 2.515e6 lbf/in^2 wood_mod_blackironwood 2.966e6 lbf/in^2 # Krugiodendron ferreum wood_mod_koa 1.503e6 lbf/in^2 wood_mod_lignumvitae 2.043e6 lbf/in^2 wood_mod_mahogany 1.458e6 lbf/in^2 # True (Honduran) mahogany, # Swietenia macrophylla wood_mod_rosewood_brazilian 2.020e6 lbf/in^2 wood_mod_rosewood_honduran 3.190e6 lbf/in^2 wood_mod_rosewood_indian 1.668e6 lbf/in^2 wood_mod_snakewood 3.364e6 lbf/in^2 wood_mod_teak 1.781e6 lbf/in^2 wood_mod_zebrawood 2.374e6 lbf/in^2 # # Area of countries and other regions. This is the "total area" which # includes land and water areas within international boundaries and # coastlines. Data from January, 2019. # # except as noted, sources are # https://en.wikipedia.org/wiki/List_of_countries_and_dependencies_by_area # https://www.cia.gov/library/publications/the-world-factbook) area_russia 17098246 km^2 area_antarctica 14000000 km^2 # area_canada is covered below as sum of province and territory areas area_china 9596961 km^2 # area_unitedstates is covered below as sum of state areas # includes only the 50 states and District of Columbia area_us area_unitedstates area_brazil 8515767 km^2 area_australia 7692024 km^2 # area_europeanunion is covered below as sum of member areas area_india 3287263 km^2 area_argentina 2780400 km^2 area_kazakhstan 2724900 km^2 area_algeria 2381741 km^2 area_drcongo 2344858 km^2 area_greenland 2166086 km^2 area_saudiarabia 2149690 km^2 area_mexico 1964375 km^2 area_indonesia 1910931 km^2 area_sudan 1861484 km^2 area_libya 1759540 km^2 area_iran 1648195 km^2 area_mongolia 1564110 km^2 area_peru 1285216 km^2 area_chad 1284000 km^2 area_niger 1267000 km^2 area_angola 1246700 km^2 area_mali 1240192 km^2 area_southafrica 1221037 km^2 area_colombia 1141748 km^2 area_ethiopia 1104300 km^2 area_bolivia 1098581 km^2 area_mauritania 1030700 km^2 area_egypt 1002450 km^2 area_tanzania 945087 km^2 area_nigeria 923768 km^2 area_venezuela 916445 km^2 area_pakistan 881912 km^2 area_namibia 825615 km^2 area_mozambique 801590 km^2 area_turkey 783562 km^2 area_chile 756102 km^2 area_zambia 752612 km^2 area_myanmar 676578 km^2 area_burma area_myanmar area_afghanistan 652230 km^2 area_southsudan 644329 km^2 area_france 640679 km^2 area_somalia 637657 km^2 area_centralafrica 622984 km^2 area_ukraine 603500 km^2 area_crimea 27000 km^2 # occupied by Russia; included in # (Encyclopedia Britannica) area_madagascar 587041 km^2 area_botswana 581730 km^2 area_kenya 580367 km^2 area_yemen 527968 km^2 area_thailand 513120 km^2 area_spain 505992 km^2 area_turkmenistan 488100 km^2 area_cameroon 475422 km^2 area_papuanewguinea 462840 km^2 area_sweden 450295 km^2 area_uzbekistan 447400 km^2 area_morocco 446550 km^2 area_iraq 438317 km^2 area_paraguay 406752 km^2 area_zimbabwe 390757 km^2 area_japan 377973 km^2 area_germany 357114 km^2 area_congorepublic 342000 km^2 area_finland 338424 km^2 area_vietnam 331212 km^2 area_malaysia 330803 km^2 area_norway 323802 km^2 area_ivorycoast 322463 km^2 area_poland 312696 km^2 area_oman 309500 km^2 area_italy 301339 km^2 area_philippines 300000 km^2 area_ecuador 276841 km^2 area_burkinafaso 274222 km^2 area_newzealand 270467 km^2 area_gabon 267668 km^2 area_westernsahara 266000 km^2 area_guinea 245857 km^2 # area_unitedkingdom is covered below area_uganda 241550 km^2 area_ghana 238533 km^2 area_romania 238397 km^2 area_laos 236800 km^2 area_guyana 214969 km^2 area_belarus 207600 km^2 area_kyrgyzstan 199951 km^2 area_senegal 196722 km^2 area_syria 185180 km^2 area_golanheights 1150 km^2 # occupied by Israel; included in # Syria (Encyclopedia Britannica) area_cambodia 181035 km^2 area_uruguay 176215 km^2 area_somaliland 176120 km^2 area_suriname 163820 km^2 area_tunisia 163610 km^2 area_bangladesh 147570 km^2 area_nepal 147181 km^2 area_tajikistan 143100 km^2 area_greece 131990 km^2 area_nicaragua 130373 km^2 area_northkorea 120540 km^2 area_malawi 118484 km^2 area_eritrea 117600 km^2 area_benin 114763 km^2 area_honduras 112492 km^2 area_liberia 111369 km^2 area_bulgaria 110879 km^2 area_cuba 109884 km^2 area_guatemala 108889 km^2 area_iceland 103000 km^2 area_southkorea 100210 km^2 area_hungary 93028 km^2 area_portugal 92090 km^2 area_jordan 89342 km^2 area_serbia 88361 km^2 area_azerbaijan 86600 km^2 area_austria 83871 km^2 area_uae 83600 km^2 area_czechia 78865 km^2 area_czechrepublic area_czechia area_panama 75417 km^2 area_sierraleone 71740 km^2 area_ireland 70273 km^2 area_georgia 69700 km^2 area_srilanka 65610 km^2 area_lithuania 65300 km^2 area_latvia 64559 km^2 area_togo 56785 km^2 area_croatia 56594 km^2 area_bosnia 51209 km^2 area_costarica 51100 km^2 area_slovakia 49037 km^2 area_dominicanrepublic 48671 km^2 area_estonia 45227 km^2 area_denmark 43094 km^2 area_netherlands 41850 km^2 area_switzerland 41284 km^2 area_bhutan 38394 km^2 area_taiwan 36193 km^2 area_guineabissau 36125 km^2 area_moldova 33846 km^2 area_belgium 30528 km^2 area_lesotho 30355 km^2 area_armenia 29743 km^2 area_solomonislands 28896 km^2 area_albania 28748 km^2 area_equitorialguinea 28051 km^2 area_burundi 27834 km^2 area_haiti 27750 km^2 area_rwanda 26338 km^2 area_northmacedonia 25713 km^2 area_djibouti 23200 km^2 area_belize 22966 km^2 area_elsalvador 21041 km^2 area_israel 20770 km^2 area_slovenia 20273 km^2 area_fiji 18272 km^2 area_kuwait 17818 km^2 area_eswatini 17364 km^2 area_easttimor 14919 km^2 area_bahamas 13943 km^2 area_montenegro 13812 km^2 area_vanatu 12189 km^2 area_qatar 11586 km^2 area_gambia 11295 km^2 area_jamaica 10991 km^2 area_kosovo 10887 km^2 area_lebanon 10452 km^2 area_cyprus 9251 km^2 area_puertorico 9104 km^2 # United States territory; not included # in United States area area_westbank 5860 km^2 # (CIA World Factbook) area_hongkong 2755 km^2 area_luxembourg 2586 km^2 area_singapore 716 km^2 area_gazastrip 360 km^2 # (CIA World Factbook) area_malta 316 km^2 # smallest EU country area_liechtenstein 160 km^2 area_monaco 2.02 km^2 area_vaticancity 0.44 km^2 # Members as of 1 Feb 2020 area_europeanunion area_austria + area_belgium + area_bulgaria \ + area_croatia + area_cyprus + area_czechia + area_denmark \ + area_estonia + area_finland + area_france + area_germany \ + area_greece + area_hungary + area_ireland + area_italy \ + area_latvia + area_lithuania + area_luxembourg \ + area_malta + area_netherlands + area_poland \ + area_portugal + area_romania + area_slovakia \ + area_slovenia + area_spain + area_sweden area_eu area_europeanunion # # Areas of the individual US states # # https://en.wikipedia.org/wiki/List_of_U.S._states_and_territories_by_area # # United States Summary: 2010, Population and Housing Unit Counts, Table 18, p. 41 # Issued September 2012 area_alaska 1723336.8 km^2 area_texas 695661.6 km^2 area_california 423967.4 km^2 area_montana 380831.1 km^2 area_newmexico 314917.4 km^2 area_arizona 295233.5 km^2 area_nevada 286379.7 km^2 area_colorado 269601.4 km^2 area_oregon 254799.2 km^2 area_wyoming 253334.5 km^2 area_michigan 250486.8 km^2 area_minnesota 225162.8 km^2 area_utah 219881.9 km^2 area_idaho 216442.6 km^2 area_kansas 213100.0 km^2 area_nebraska 200329.9 km^2 area_southdakota 199728.7 km^2 area_washington 184660.8 km^2 area_northdakota 183107.8 km^2 area_oklahoma 181037.2 km^2 area_missouri 180540.3 km^2 area_florida 170311.7 km^2 area_wisconsin 169634.8 km^2 area_georgia_us 153910.4 km^2 area_illinois 149995.4 km^2 area_iowa 145745.9 km^2 area_newyork 141296.7 km^2 area_northcarolina 139391.0 km^2 area_arkansas 137731.8 km^2 area_alabama 135767.4 km^2 area_louisiana 135658.7 km^2 area_mississippi 125437.7 km^2 area_pennsylvania 119280.2 km^2 area_ohio 116097.7 km^2 area_virginia 110786.6 km^2 area_tennessee 109153.1 km^2 area_kentucky 104655.7 km^2 area_indiana 94326.2 km^2 area_maine 91633.1 km^2 area_southcarolina 82932.7 km^2 area_westvirginia 62755.5 km^2 area_maryland 32131.2 km^2 area_hawaii 28313.0 km^2 area_massachusetts 27335.7 km^2 area_vermont 24906.3 km^2 area_newhampshire 24214.2 km^2 area_newjersey 22591.4 km^2 area_connecticut 14357.4 km^2 area_delaware 6445.8 km^2 area_rhodeisland 4001.2 km^2 area_districtofcolumbia 177.0 km^2 area_unitedstates area_alabama + area_alaska + area_arizona \ + area_arkansas + area_california + area_colorado \ + area_connecticut + area_delaware \ + area_districtofcolumbia + area_florida \ + area_georgia_us + area_hawaii + area_idaho \ + area_illinois + area_indiana + area_iowa \ + area_kansas + area_kentucky + area_louisiana \ + area_maine + area_maryland + area_massachusetts \ + area_michigan + area_minnesota + area_mississippi \ + area_missouri + area_montana + area_nebraska \ + area_nevada + area_newhampshire + area_newjersey \ + area_newmexico + area_newyork + area_northcarolina \ + area_northdakota + area_ohio + area_oklahoma \ + area_oregon + area_pennsylvania + area_rhodeisland \ + area_southcarolina + area_southdakota \ + area_tennessee + area_texas + area_utah \ + area_vermont + area_virginia + area_washington \ + area_westvirginia + area_wisconsin + area_wyoming # Total area of Canadian province and territories # # Statistics Canada, "Land and freshwater area, by province and territory", # 2016-10-07: # # https://www150.statcan.gc.ca/n1/pub/11-402-x/2012000/chap/geo/tbl/tbl06-eng.htm area_ontario 1076395 km^2 # confederated 1867-Jul-01 area_quebec 1542056 km^2 # confederated 1867-Jul-01 area_novascotia 55284 km^2 # confederated 1867-Jul-01 area_newbrunswick 72908 km^2 # confederated 1867-Jul-01 area_canada_original area_ontario + area_quebec + area_novascotia \ + area_newbrunswick area_manitoba 647797 km^2 # confederated 1870-Jul-15 area_britishcolumbia 944735 km^2 # confederated 1871-Jul-20 area_princeedwardisland 5660 km^2 # confederated 1873-Jul-01 area_canada_additional area_manitoba + area_britishcolumbia \ + area_princeedwardisland area_alberta 661848 km^2 # confederated 1905-Sep-01 area_saskatchewan 651036 km^2 # confederated 1905-Sep-01 area_newfoundlandandlabrador 405212 km^2 # confederated 1949-Mar-31 area_canada_recent area_alberta + area_saskatchewan \ + area_newfoundlandandlabrador area_canada_provinces area_canada_original + area_canada_additional \ + area_canada_recent area_northwestterritories 1346106 km^2 # NT confederated 1870-Jul-15 area_yukon 482443 km^2 # YT confederated 1898-Jun-13 area_nunavut 2093190 km^2 # NU confederated 1999-Apr-01 area_canada_territories area_northwestterritories + area_yukon \ + area_nunavut area_canada area_canada_provinces + area_canada_territories # area-uk-countries.units - UK country (/province) total areas # https://en.wikipedia.org/wiki/Countries_of_the_United_Kingdom#Statistics # GB is official UK country code for some purposes but internally is a Kingdom # # areas from A Beginners Guide to UK Geography 2019 v1.0, Office for National Statistics # England: country; 0927-Jul-12 united; 1603-Mar-24 union of crowns area_england 132947.76 km^2 # # Wales: 1282 conquered; 1535 union; principality until 2011 area_wales 21224.48 km^2 # # England and Wales: nation; 1535 union area_englandwales area_england + area_wales # # Scotland: country; ~900 united; 1603-Mar-24 union of crowns area_scotland 80226.36 km^2 # # Great Britain: kingdom; excludes NI; # 1707 Treaty and Acts of Union: union of parliaments area_greatbritain area_england + area_wales + area_scotland area_gb area_greatbritain # # Northern Ireland: province; Ireland: 1177 Henry II lordship; # 1542 Henry VIII kingdom; 1652 Cromwell commonwealth; # 1691 William III kingdom; 1800 Acts of Union: UK of GB & Ireland; # 1921 Irish Free State independent of UK area_northernireland 14133.38 km^2 # # United Kingdom of GB & NI: 1800 Acts of Union: UK of GB & Ireland; # 1921 Irish Free State independent of UK area_unitedkingdom area_greatbritain + area_northernireland area_uk area_unitedkingdom # # Units derived from imperial system # ouncedal oz ft / s^2 # force which accelerates an ounce # at 1 ft/s^2 poundal lb ft / s^2 # same thing for a pound tondal longton ft / s^2 # and for a ton pdl poundal osi ounce force / inch^2 # used in aviation psi pound force / inch^2 psia psi # absolute pressure # Note that gauge pressure can be given # using the gaugepressure() and # psig() nonlinear unit definitions tsi ton force / inch^2 reyn psi sec slug lbf s^2 / ft slugf slug force slinch lbf s^2 / inch # Mass unit derived from inch second slinchf slinch force # pound-force system. Used in space # applications where in/sec^2 was a # natural acceleration measure. geepound slug lbf lb force tonf ton force lbm lb kip 1000 lbf # from kilopound ksi kip / in^2 mil 0.001 inch thou 0.001 inch tenth 0.0001 inch # one tenth of one thousandth of an inch millionth 1e-6 inch # one millionth of an inch circularinch 1|4 pi in^2 # area of a one-inch diameter circle circleinch circularinch # A circle with diameter d inches has # an area of d^2 circularinches cylinderinch circleinch inch # Cylinder h inch tall, d inches diameter # has volume d^2 h cylinder inches circularmil 1|4 pi mil^2 # area of one-mil diameter circle cmil circularmil cental 100 pound centner cental caliber 0.01 inch # for measuring bullets duty ft lbf celo ft / s^2 jerk ft / s^3 australiapoint 0.01 inch # The "point" is used to measure rainfall # in Australia sabin ft^2 # Measure of sound absorption equal to the # absorbing power of one square foot of # a perfectly absorbing material. The # sound absorptivity of an object is the # area times a dimensionless # absorptivity coefficient. standardgauge 4 ft + 8.5 in # Standard width between railroad track flag 5 ft^2 # Construction term referring to sidewalk. rollwallpaper 30 ft^2 # Area of roll of wall paper fillpower in^3 / ounce # Density of down at standard pressure. # The best down has 750-800 fillpower. pinlength 1|16 inch # A #17 pin is 17/16 in long in the USA. buttonline 1|40 inch # The line was used in 19th century USA # to measure width of buttons. beespace 1|4 inch # Bees will fill any space that is smaller # than the bee space and leave open # spaces that are larger. The size of # the space varies with species. diamond 8|5 ft # Marking on US tape measures that is # useful to carpenters who wish to place # five studs in an 8 ft distance. Note # that the numbers appear in red every # 16 inches as well, giving six # divisions in 8 feet. retmaunit 1.75 in # Height of rack mountable equipment. U retmaunit # Equipment should be 1|32 inch narrower RU U # than its U measurement indicates to # allow for clearance, so 4U=(6+31|32)in # RETMA stands for the former name of # the standardizing organization, Radio # Electronics Television Manufacturers # Association. This organization is now # called the Electronic Industries # Alliance (EIA) and the rack standard # is specified in EIA RS-310-D. count per pound # For measuring the size of shrimp flightlevel 100 ft # Flight levels are used to ensure safe FL flightlevel # vertical separation between aircraft # despite variations in local air # pressure. Flight levels define # altitudes based on a standard air # pressure so that altimeter calibration # is not needed. This means that # aircraft at separated flight levels # are guaranteed to be separated. # Hence the definition of 100 feet is # a nominal, not true, measure. # Customarily written with no space in # the form FL290, which will not work in # units. But note "FL 290" will work. # # Other units of work, energy, power, etc # # Calorie: approximate energy to raise a gram of water one degree celsius calorie cal_th # Default is the thermochemical calorie cal calorie calorie_th 4.184 J # Thermochemical calorie, defined in 1930 thermcalorie calorie_th # by Frederick Rossini as 4.1833 J to cal_th calorie_th # avoid difficulties associated with the # uncertainty in the heat capacity of # water. In 1948 the value of the joule # was changed, so the thermochemical # calorie was redefined to 4.184 J. # This kept the energy measured by this # unit the same. calorie_IT 4.1868 J # International (Steam) Table calorie, cal_IT calorie_IT # defined in 1929 as watt-hour/860 or # equivalently 180|43 joules. At this # time the international joule had a # different value than the modern joule, # and the values were different in the # USA and in Europe. In 1956 at the # Fifth International Conference on # Properties of Steam the exact # definition given here was adopted. calorie_15 4.18580 J # Energy to go from 14.5 to 15.5 degC cal_15 calorie_15 calorie_fifteen cal_15 calorie_20 4.18190 J # Energy to go from 19.5 to 20.5 degC cal_20 calorie_20 calorie_twenty calorie_20 calorie_4 4.204 J # Energy to go from 3.5 to 4.5 degC cal_4 calorie_4 calorie_four calorie_4 cal_mean 4.19002 J # 1|100 energy to go from 0 to 100 degC Calorie kilocalorie # the food Calorie thermie 1e6 cal_15 # Heat required to raise the # temperature of a tonne of # water from 14.5 to 15.5 degC. # btu definitions: energy to raise a pound of water 1 degF btu btu_IT # International Table BTU is the default britishthermalunit btu btu_IT cal_IT lb (degF) / gram K btu_th cal_th lb (degF) / gram K btu_mean cal_mean lb (degF) / gram K btu_15 cal_15 lb (degF) / gram K btu_ISO 1055.06 J # Exact, rounded ISO definition based # on the IT calorie quad quadrillion btu ECtherm 1e5 btu_ISO # Exact definition UStherm 1.054804e8 J # Exact definition, therm UStherm # Water latent heat from [23] water_fusion_heat 6.01 kJ/mol / (18.015 g/mol) # At 0 deg C water_vaporization_heat 2256.4 J/g # At saturation, 100 deg C, 101.42 kPa # Specific heat capacities of various substances specificheat_water calorie / g K water_specificheat specificheat_water # Values from www.engineeringtoolbox.com/specific-heat-metals-d_152.html specificheat_aluminum 0.91 J/g K specificheat_antimony 0.21 J/g K specificheat_barium 0.20 J/g K specificheat_beryllium 1.83 J/g K specificheat_bismuth 0.13 J/g K specificheat_cadmium 0.23 J/g K specificheat_cesium 0.24 J/g K specificheat_chromium 0.46 J/g K specificheat_cobalt 0.42 J/g K specificheat_copper 0.39 J/g K specificheat_gallium 0.37 J/g K specificheat_germanium 0.32 J/g K specificheat_gold 0.13 J/g K specificheat_hafnium 0.14 J/g K specificheat_indium 0.24 J/g K specificheat_iridium 0.13 J/g K specificheat_iron 0.45 J/g K specificheat_lanthanum 0.195 J/g K specificheat_lead 0.13 J/g K specificheat_lithium 3.57 J/g K specificheat_lutetium 0.15 J/g K specificheat_magnesium 1.05 J/g K specificheat_manganese 0.48 J/g K specificheat_mercury 0.14 J/g K specificheat_molybdenum 0.25 J/g K specificheat_nickel 0.44 J/g K specificheat_osmium 0.13 J/g K specificheat_palladium 0.24 J/g K specificheat_platinum 0.13 J/g K specificheat_plutonum 0.13 J/g K specificheat_potassium 0.75 J/g K specificheat_rhenium 0.14 J/g K specificheat_rhodium 0.24 J/g K specificheat_rubidium 0.36 J/g K specificheat_ruthenium 0.24 J/g K specificheat_scandium 0.57 J/g K specificheat_selenium 0.32 J/g K specificheat_silicon 0.71 J/g K specificheat_silver 0.23 J/g K specificheat_sodium 1.21 J/g K specificheat_strontium 0.30 J/g K specificheat_tantalum 0.14 J/g K specificheat_thallium 0.13 J/g K specificheat_thorium 0.13 J/g K specificheat_tin 0.21 J/g K specificheat_titanium 0.54 J/g K specificheat_tungsten 0.13 J/g K specificheat_uranium 0.12 J/g K specificheat_vanadium 0.39 J/g K specificheat_yttrium 0.30 J/g K specificheat_zinc 0.39 J/g K specificheat_zirconium 0.27 J/g K specificheat_ethanol 2.3 J/g K specificheat_ammonia 4.6 J/g K specificheat_freon 0.91 J/g K # R-12 at 0 degrees Fahrenheit specificheat_gasoline 2.22 J/g K specificheat_iodine 2.15 J/g K specificheat_oliveoil 1.97 J/g K # en.wikipedia.org/wiki/Heat_capacity#Table_of_specific_heat_capacities specificheat_hydrogen 14.3 J/g K specificheat_helium 5.1932 J/g K specificheat_argon 0.5203 J/g K specificheat_tissue 3.5 J/g K specificheat_diamond 0.5091 J/g K specificheat_granite 0.79 J/g K specificheat_graphite 0.71 J/g K specificheat_ice 2.11 J/g K specificheat_asphalt 0.92 J/g K specificheat_brick 0.84 J/g K specificheat_concrete 0.88 J/g K specificheat_glass_silica 0.84 J/g K specificheat_glass_flint 0.503 J/g K specificheat_glass_pyrex 0.753 J/g K specificheat_gypsum 1.09 J/g K specificheat_marble 0.88 J/g K specificheat_sand 0.835 J/g K specificheat_soil 0.835 J/g K specificheat_wood 1.7 J/g K specificheat_sucrose 1.244 J/g K #www.sugartech.co.za/heatcapacity/index.php # Energy densities of various fuels # # Most of these fuels have varying compositions or qualities and hence their # actual energy densities vary. These numbers are hence only approximate. # # E1. http://bioenergy.ornl.gov/papers/misc/energy_conv.html # E2. http://www.aps.org/policy/reports/popa-reports/energy/units.cfm # E3. http://www.ior.com.au/ecflist.html tonoil 1e10 cal_IT # Ton oil equivalent. A conventional # value for the energy released by toe tonoil # burning one metric ton of oil. [18,E2] # Note that energy per mass of petroleum # products is fairly constant. # Variations in volumetric energy # density result from variations in the # density (kg/m^3) of different fuels. # This definition is given by the # IEA/OECD. toncoal 7e9 cal_IT # Energy in metric ton coal from [18]. # This is a nominal value which # is close to the heat content # of coal used in the 1950's barreloil 5.8 Mbtu # Conventional value for barrel of crude # oil [E2]. Actual range is 5.6 - 6.3. naturalgas_HHV 1027 btu/ft3 # Energy content of natural gas. HHV naturalgas_LHV 930 btu/ft3 # is for Higher Heating Value and naturalgas naturalgas_HHV # includes energy from condensation # combustion products. LHV is for Lower # Heating Value and excludes these. # American publications typically report # HHV whereas European ones report LHV. charcoal 30 GJ/tonne woodenergy_dry 20 GJ/tonne # HHV, a cord weights about a tonne woodenergy_airdry 15 GJ/tonne # 20% moisture content coal_bituminous 27 GJ / tonne coal_lignite 15 GJ / tonne coal_US 22 GJ / uston # Average for US coal (short ton), 1995 ethanol_HHV 84000 btu/usgallon ethanol_LHV 75700 btu/usgallon diesel 130500 btu/usgallon gasoline_LHV 115000 btu/usgallon gasoline_HHV 125000 btu/usgallon gasoline gasoline_HHV heating 37.3 MJ/liter fueloil 39.7 MJ/liter # low sulphur propane 93.3 MJ/m^3 butane 124 MJ/m^3 # These values give total energy from uranium fission. Actual efficiency # of nuclear power plants is around 30%-40%. Note also that some reactors # use enriched uranium around 3% U-235. Uranium during processing or use # may be in a compound of uranium oxide or uranium hexafluoride, in which # case the energy density would be lower depending on how much uranium is # in the compound. uranium_pure 200 MeV avogadro / (235.0439299 g/mol) # Pure U-235 uranium_natural 0.7% uranium_pure # Natural uranium: 0.7% U-235 # Celsius heat unit: energy to raise a pound of water 1 degC celsiusheatunit cal lb (degC) / gram K chu celsiusheatunit # "Apparent" average power in an AC circuit, the product of rms voltage # and rms current, equal to the true power in watts when voltage and # current are in phase. In a DC circuit, always equal to the true power. VA volt ampere kWh kilowatt hour # The horsepower is supposedly the power of one horse pulling. Obviously # different people had different horses. horsepower 550 foot pound force / sec # Invented by James Watt mechanicalhorsepower horsepower hp horsepower metrichorsepower 75 kilogram force meter / sec # PS=Pferdestaerke in electrichorsepower 746 W # Germany boilerhorsepower 9809.50 W waterhorsepower 746.043 W brhorsepower horsepower # Value corrected Dec, 2019. Was 745.7 W. donkeypower 250 W chevalvapeur metrichorsepower # # Heat Transfer # # Thermal conductivity, K, measures the rate of heat transfer across # a material. The heat transfered is # Q = K dT A t / L # where dT is the temperature difference across the material, A is the # cross sectional area, t is the time, and L is the length (thickness). # Thermal conductivity is a material property. THERMAL_CONDUCTIVITY POWER / AREA (TEMPERATURE_DIFFERENCE/LENGTH) THERMAL_RESISTIVITY 1/THERMAL_CONDUCTIVITY # Thermal conductance is the rate at which heat flows across a given # object, so the area and thickness have been fixed. It depends on # the size of the object and is hence not a material property. THERMAL_CONDUCTANCE POWER / TEMPERATURE_DIFFERENCE THERMAL_RESISTANCE 1/THERMAL_CONDUCTANCE # Thermal admittance is the rate of heat flow per area across an # object whose thickness has been fixed. Its reciprocal, thermal # insulation, is used to for measuring the heat transfer per area # of sheets of insulation or cloth that are of specified thickness. THERMAL_ADMITTANCE THERMAL_CONDUCTIVITY / LENGTH THERMAL_INSULANCE THERMAL_RESISTIVITY LENGTH THERMAL_INSULATION THERMAL_RESISTIVITY LENGTH Rvalue degF ft^2 hr / btu Uvalue 1/Rvalue europeanUvalue watt / m^2 K RSI degC m^2 / W clo 0.155 * degC m^2 / W # Supposed to be the insulance # required to keep a resting person # comfortable indoors. The value # given is from NIST and the CRC, # but [5] gives a slightly different # value of 0.875 ft^2 degF hr / btu. tog 0.1 * degC m^2 / W # Also used for clothing. # Thermal Conductivity of a few materials diamond_natural_thermal_conductivity 2200 W / m K diamond_synthetic_thermal_conductivity 3320 W / m K # 99% pure C12 silver_thermal_conductivity 406 W / m K aluminum_thermal_conductivity 205 W / m K copper_thermal_conductivity 385 W / m K gold_thermal_conductivity 314 W / m K iron_thermal_conductivity 79.5 W / m K stainless_304_thermal_conductivity 15.5 W / m K # average value # The bel was defined by engineers of Bell Laboratories to describe the # reduction in audio level over a length of one mile. It was originally # called the transmission unit (TU) but was renamed around 1923 to honor # Alexander Graham Bell. The bel proved inconveniently large so the decibel # has become more common. The decibel is dimensionless since it reports a # ratio, but it is used in various contexts to report a signal's power # relative to some reference level. bel(x) units=[1;1] range=(0,) 10^(x); log(bel) # Basic bel definition decibel(x) units=[1;1] range=(0,) 10^(x/10); 10 log(decibel) # Basic decibel dB() decibel # Abbreviation dBW(x) units=[1;W] range=(0,) dB(x) W ; ~dB(dBW/W) # Reference = 1 W dBk(x) units=[1;W] range=(0,) dB(x) kW ; ~dB(dBk/kW) # Reference = 1 kW dBf(x) units=[1;W] range=(0,) dB(x) fW ; ~dB(dBf/fW) # Reference = 1 fW dBm(x) units=[1;W] range=(0,) dB(x) mW ; ~dB(dBm/mW) # Reference = 1 mW dBmW(x) units=[1;W] range=(0,) dBm(x) ; ~dBm(dBmW) # Reference = 1 mW dBJ(x) units=[1;J] range=(0,) dB(x) J; ~dB(dBJ/J) # Energy relative # to 1 joule. Used for power spectral # density since W/Hz = J # When used to measure amplitude, voltage, or current the signal is squared # because power is proportional to the square of these measures. The root # mean square (RMS) voltage is typically used with these units. dB_amplitude(x) units=[1;1] dB(0.5 x) ; ~dB(dB_amplitude^2) dBV(x) units=[1;V] range=(0,) dB(0.5 x) V;~dB(dBV^2 / V^2) # Reference = 1 V dBmV(x) units=[1;V] range=(0,) dB(0.5 x) mV;~dB(dBmV^2/mV^2)# Reference = 1 mV dBuV(x) units=[1;V] range=(0,) dB(0.5 x) microV ; ~dB(dBuV^2 / microV^2) # Reference = 1 microvolt # Here are dB measurements for current. Be aware that dbA is also # a unit for frequency weighted sound pressure. dBA(x) units=[1;A] range=(0,) dB(0.5 x) A;~dB(dBA^2 / A^2) # Reference = 1 A dBmA(x) units=[1;A] range=(0,) dB(0.5 x) mA;~dB(dBmA^2/mA^2)# Reference = 1 mA dBuA(x) units=[1;A] range=(0,) dB(0.5 x) microA ; ~dB(dBuA^2 / microA^2) # Reference = 1 microamp # Referenced to the voltage that causes 1 mW dissipation in a 600 ohm load. # Originally defined as dBv but changed to prevent confusion with dBV. # The "u" is for unloaded. dBu(x) units=[1;V] range=(0,) dB(0.5 x) sqrt(mW 600 ohm) ; \ ~dB(dBu^2 / mW 600 ohm) dBv(x) units=[1;V] range=(0,) dBu(x) ; ~dBu(dBv) # Synonym for dBu # Measurements for sound in air, referenced to the threshold of human hearing # Note that sound in other media typically uses 1 micropascal as a reference # for sound pressure. Units dBA, dBB, dBC, refer to different frequency # weightings meant to approximate the human ear's response. # sound pressure level dBSPL(x) units=[1;Pa] range=(0,) dB(0.5 x) 20 microPa ; \ ~dB(dBSPL^2 / (20 microPa)^2) # sound intensity level dBSIL(x) units=[1;W/m^2] range=(0,) dB(x) 1e-12 W/m^2; \ ~dB(dBSIL / (1e-12 W/m^2)) # sound power level (The W in SWL is for the reference power, 1 W.) dBSWL(x) units=[1;W] range=(0,) dB(x) 1e-12 W; ~dB(dBSWL/1e-12 W) # The neper is another similar logarithmic unit. Note that the neper # is defined based on the ratio of amplitudes rather than the power # ratio like the decibel. This means that if the data is power, and # you convert to nepers you should take the square root of the data # to convert to amplitude. If you want to convert nepers to a power # measurement you need to square the resulting output. neper(x) units=[1;1] range=(0,) exp(x); ln(neper) centineper(x) units=[1;1] range=(0,) exp(x/100); 100 ln(centineper) Np() neper cNp() centineper Np_power(x) units=[1;1] Np(2 x) ; ~Np(Np_power)/2 # Misc other measures ENTROPY ENERGY / TEMPERATURE clausius 1e3 cal/K # A unit of physical entropy langley thermcalorie/cm^2 # Used in radiation theory poncelet 100 kg force m / s tonrefrigeration uston 144 btu / lb day # One ton refrigeration is # the rate of heat extraction required # turn one ton of water to ice in # a day. Ice is defined to have a # latent heat of 144 btu/lb. tonref tonrefrigeration refrigeration tonref / ton frigorie 1000 cal_15 # Used in refrigeration engineering. airwatt 8.5 (ft^3/min) inH2O # Measure of vacuum power as # pressure times air flow. # The unit "tnt" is defined so that you can write "tons tnt". The # question of which ton, exactly, is intended. The answer is that # nobody knows: # # Quoting the footnote from page 13 of # https://www.dtra.mil/Portals/61/Documents/NTPR/4-Rad_Exp_Rpts/36_The_Effects_of_Nuclear_Weapons.pdf # # The majority of the experimental and theoretical values of the # explosive energy released by TNT range from 900 to 1,100 calories per # gram. At one time, there was some uncertainty as to whether the term # “kiloton” of TNT referred to a short kiloton (2*10^6 pounds), a metric # kiloton (2.205*10^6 pounds), or a long kiloton (2.24*10^6 pounds). In # order to avoid ambiguity, it was agreed that the term “kiloton” would # refer to the release of 10^12 calories of explosive energy. This is # equivalent to 1 short kiloton of TNT if the energy release is 1,102 # calories per gram or to 1 long kiloton if the energy is 984 calories # per gram of TNT. # # It is therefore not well-defined how much energy a "gram of tnt" is, # though this term does appear in some references. tnt 1e9 cal_th / ton # Defined exact value # Nuclear weapon yields davycrocket 10 ton tnt # lightest US tactical nuclear weapon hiroshima 15.5 kiloton tnt # Uranium-235 fission bomb nagasaki 21 kiloton tnt # Plutonium-239 fission bomb fatman nagasaki littleboy hiroshima ivyking 500 kiloton tnt # most powerful fission bomb castlebravo 15 megaton tnt # most powerful US test tsarbomba 50 megaton tnt # most powerful test ever: USSR, # 30 October 1961 b53bomb 9 megaton tnt # http://rarehistoricalphotos.com/gadget-first-atomic-bomb/ trinity 18 kiloton tnt # July 16, 1945 gadget trinity # # Permeability: The permeability or permeance, n, of a substance determines # how fast vapor flows through the substance. The formula W = n A dP # holds where W is the rate of flow (in mass/time), n is the permeability, # A is the area of the flow path, and dP is the vapor pressure difference. # perm_0C grain / hr ft^2 inHg perm_zero perm_0C perm_0 perm_0C perm perm_0C perm_23C grain / hr ft^2 in Hg23C perm_twentythree perm_23C # # Counting measures # pair 2 brace 2 nest 3 # often used for items like bowls that # nest together hattrick 3 # Used in sports, especially cricket and ice # hockey to report the number of goals. dicker 10 dozen 12 bakersdozen 13 score 20 flock 40 timer 40 shock 60 toncount 100 # Used in sports in the UK longhundred 120 # From a germanic counting system gross 144 greatgross 12 gross tithe 1|10 # From Anglo-Saxon word for tenth # Paper counting measure shortquire 24 quire 25 shortream 480 ream 500 perfectream 516 bundle 2 reams bale 5 bundles # # Paper measures # # USA paper sizes lettersize 8.5 inch 11 inch legalsize 8.5 inch 14 inch ledgersize 11 inch 17 inch executivesize 7.25 inch 10.5 inch Apaper 8.5 inch 11 inch Bpaper 11 inch 17 inch Cpaper 17 inch 22 inch Dpaper 22 inch 34 inch Epaper 34 inch 44 inch # Correspondence envelope sizes. #10 is the standard business # envelope in the USA. envelope6_25size 3.5 inch 6 inch envelope6_75size 3.625 inch 6.5 inch envelope7size 3.75 inch 6.75 inch envelope7_75size 3.875 inch 7.5 inch envelope8_625size 3.625 inch 8.625 inch envelope9size 3.875 inch 8.875 inch envelope10size 4.125 inch 9.5 inch envelope11size 4.5 inch 10.375 inch envelope12size 4.75 inch 11 inch envelope14size 5 inch 11.5 inch envelope16size 6 inch 12 inch # Announcement envelope sizes (no relation to metric paper sizes like A4) envelopeA1size 3.625 inch 5.125 inch # same as 4bar envelopeA2size 4.375 inch 5.75 inch envelopeA6size 4.75 inch 6.5 inch envelopeA7size 5.25 inch 7.25 inch envelopeA8size 5.5 inch 8.125 inch envelopeA9size 5.75 inch 8.75 inch envelopeA10size 6 inch 9.5 inch # Baronial envelopes envelope4bar 3.625 inch 5.125 inch # same as A1 envelope5_5bar 4.375 inch 5.75 inch envelope6bar 4.75 inch 6.5 inch # Coin envelopes envelope1baby 2.25 inch 3.5 inch # same as #1 coin envelope00coin 1.6875 inch 2.75 inch envelope1coin 2.25 inch 3.5 inch envelope3coin 2.5 inch 4.25 inch envelope4coin 3 inch 4.5 inch envelope4_5coin 3 inch 4.875 inch envelope5coin 2.875 inch 5.25 inch envelope5_5coin 3.125 inch 5.5 inch envelope6coin 3.375 inch 6 inch envelope7coin 3.5 inch 6.5 inch # The metric paper sizes are defined so that if a sheet is cut in half # along the short direction, the result is two sheets which are # similar to the original sheet. This means that for any metric size, # the long side is close to sqrt(2) times the length of the short # side. Each series of sizes is generated by repeated cuts in half, # with the values rounded down to the nearest millimeter. A0paper 841 mm 1189 mm # The basic size in the A series A1paper 594 mm 841 mm # is defined to have an area of A2paper 420 mm 594 mm # one square meter. A3paper 297 mm 420 mm A4paper 210 mm 297 mm A5paper 148 mm 210 mm A6paper 105 mm 148 mm A7paper 74 mm 105 mm A8paper 52 mm 74 mm A9paper 37 mm 52 mm A10paper 26 mm 37 mm B0paper 1000 mm 1414 mm # The basic B size has an area B1paper 707 mm 1000 mm # of sqrt(2) square meters. B2paper 500 mm 707 mm B3paper 353 mm 500 mm B4paper 250 mm 353 mm B5paper 176 mm 250 mm B6paper 125 mm 176 mm B7paper 88 mm 125 mm B8paper 62 mm 88 mm B9paper 44 mm 62 mm B10paper 31 mm 44 mm C0paper 917 mm 1297 mm # The basic C size has an area C1paper 648 mm 917 mm # of sqrt(sqrt(2)) square meters. C2paper 458 mm 648 mm C3paper 324 mm 458 mm # Intended for envelope sizes C4paper 229 mm 324 mm C5paper 162 mm 229 mm C6paper 114 mm 162 mm C7paper 81 mm 114 mm C8paper 57 mm 81 mm C9paper 40 mm 57 mm C10paper 28 mm 40 mm # gsm (Grams per Square Meter), a sane, metric paper weight measure gsm grams / meter^2 # In the USA, a collection of crazy historical paper measures are used. Paper # is measured as a weight of a ream of that particular type of paper. This is # sometimes called the "substance" or "basis" (as in "substance 20" paper). # The standard sheet size or "basis size" varies depending on the type of # paper. As a result, 20 pound bond paper and 50 pound text paper are actually # about the same weight. The different sheet sizes were historically the most # convenient for printing or folding in the different applications. These # different basis weights are standards maintained by American Society for # Testing Materials (ASTM) and the American Forest and Paper Association # (AF&PA). poundbookpaper lb / 25 inch 38 inch ream lbbook poundbookpaper poundtextpaper poundbookpaper lbtext poundtextpaper poundoffsetpaper poundbookpaper # For offset printing lboffset poundoffsetpaper poundbiblepaper poundbookpaper # Designed to be lightweight, thin, lbbible poundbiblepaper # strong and opaque. poundtagpaper lb / 24 inch 36 inch ream lbtag poundtagpaper poundbagpaper poundtagpaper lbbag poundbagpaper poundnewsprintpaper poundtagpaper lbnewsprint poundnewsprintpaper poundposterpaper poundtagpaper lbposter poundposterpaper poundtissuepaper poundtagpaper lbtissue poundtissuepaper poundwrappingpaper poundtagpaper lbwrapping poundwrappingpaper poundwaxingpaper poundtagpaper lbwaxing poundwaxingpaper poundglassinepaper poundtagpaper lbglassine poundglassinepaper poundcoverpaper lb / 20 inch 26 inch ream lbcover poundcoverpaper poundindexpaper lb / 25.5 inch 30.5 inch ream lbindex poundindexpaper poundindexbristolpaper poundindexpaper lbindexbristol poundindexpaper poundbondpaper lb / 17 inch 22 inch ream # Bond paper is stiff and lbbond poundbondpaper # durable for repeated poundwritingpaper poundbondpaper # filing, and it resists lbwriting poundwritingpaper # ink penetration. poundledgerpaper poundbondpaper lbledger poundledgerpaper poundcopypaper poundbondpaper lbcopy poundcopypaper poundblottingpaper lb / 19 inch 24 inch ream lbblotting poundblottingpaper poundblankspaper lb / 22 inch 28 inch ream lbblanks poundblankspaper poundpostcardpaper lb / 22.5 inch 28.5 inch ream lbpostcard poundpostcardpaper poundweddingbristol poundpostcardpaper lbweddingbristol poundweddingbristol poundbristolpaper poundweddingbristol lbbristol poundbristolpaper poundboxboard lb / 1000 ft^2 lbboxboard poundboxboard poundpaperboard poundboxboard lbpaperboard poundpaperboard # When paper is marked in units of M, it means the weight of 1000 sheets of the # given size of paper. To convert this to paper weight, divide by the size of # the paper in question. paperM lb / 1000 # In addition paper weight is reported in "caliper" which is simply the # thickness of one sheet, typically in inches. Thickness is also reported in # "points" where a point is 1|1000 inch. These conversions are supplied to # convert these units roughly (using an approximate density) into the standard # paper weight values. pointthickness 0.001 in paperdensity 0.8 g/cm^3 # approximate--paper densities vary! papercaliper in paperdensity paperpoint pointthickness paperdensity # # Printing # fournierpoint 0.1648 inch / 12 # First definition of the printers # point made by Pierre Fournier who # defined it in 1737 as 1|12 of a # cicero which was 0.1648 inches. olddidotpoint 1|72 frenchinch # François Ambroise Didot, one of # a family of printers, changed # Fournier's definition around 1770 # to fit to the French units then in # use. bertholdpoint 1|2660 m # H. Berthold tried to create a # metric version of the didot point # in 1878. INpoint 0.4 mm # This point was created by a # group directed by Fermin Didot in # 1881 and is associated with the # imprimerie nationale. It doesn't # seem to have been used much. germandidotpoint 0.376065 mm # Exact definition appears in DIN # 16507, a German standards document # of 1954. Adopted more broadly in # 1966 by ??? metricpoint 3|8 mm # Proposed in 1977 by Eurograf oldpoint 1|72.27 inch # The American point was invented printerspoint oldpoint # by Nelson Hawks in 1879 and texpoint oldpoint # dominates USA publishing. # It was standardized by the American # Typefounders Association at the # value of 0.013837 inches exactly. # Knuth uses the approximation given # here (which is very close). The # comp.fonts FAQ claims that this # value is supposed to be 1|12 of a # pica where 83 picas is equal to 35 # cm. But this value differs from # the standard. texscaledpoint 1|65536 texpoint # The TeX typesetting system uses texsp texscaledpoint # this for all computations. computerpoint 1|72 inch # The American point was rounded point computerpoint computerpica 12 computerpoint # to an even 1|72 inch by computer postscriptpoint computerpoint # people at some point. pspoint postscriptpoint twip 1|20 point # TWentieth of an Imperial Point Q 1|4 mm # Used in Japanese phototypesetting # Q is for quarter frenchprinterspoint olddidotpoint didotpoint germandidotpoint # This seems to be the dominant value europeanpoint didotpoint # for the point used in Europe cicero 12 didotpoint stick 2 inches # Type sizes excelsior 3 oldpoint brilliant 3.5 oldpoint diamondtype 4 oldpoint pearl 5 oldpoint agate 5.5 oldpoint # Originally agate type was 14 lines per # inch, giving a value of 1|14 in. ruby agate # British nonpareil 6 oldpoint mignonette 6.5 oldpoint emerald mignonette # British minion 7 oldpoint brevier 8 oldpoint bourgeois 9 oldpoint longprimer 10 oldpoint smallpica 11 oldpoint pica 12 oldpoint english 14 oldpoint columbian 16 oldpoint greatprimer 18 oldpoint paragon 20 oldpoint meridian 44 oldpoint canon 48 oldpoint # German type sizes nonplusultra 2 didotpoint brillant 3 didotpoint diamant 4 didotpoint perl 5 didotpoint nonpareille 6 didotpoint kolonel 7 didotpoint petit 8 didotpoint borgis 9 didotpoint korpus 10 didotpoint corpus korpus garamond korpus mittel 14 didotpoint tertia 16 didotpoint text 18 didotpoint kleine_kanon 32 didotpoint kanon 36 didotpoint grobe_kanon 42 didotpoint missal 48 didotpoint kleine_sabon 72 didotpoint grobe_sabon 84 didotpoint # # Information theory units. Note that the name "entropy" is used both # to measure information and as a physical quantity. # INFORMATION bit nat (1/ln(2)) bits # Entropy measured base e hartley log2(10) bits # Entropy of a uniformly ban hartley # distributed random variable # over 10 symbols. dit hartley # from Decimal digIT # # Computer # bps bit/sec # Sometimes the term "baud" is # incorrectly used to refer to # bits per second. Baud refers # to symbols per second. Modern # modems transmit several bits # per symbol. #byte 8 bit # Not all machines had 8 bit #B byte # bytes, but these days most of # them do. But beware: for # transmission over modems, a # few extra bits are used so # there are actually 10 bits per # byte. octet 8 bits # The octet is always 8 bits nybble 4 bits # Half of a byte. Sometimes # equal to different lengths # such as 3 bits. nibble nybble nyp 2 bits # Donald Knuth asks in an exercise # for a name for a 2 bit # quantity and gives the "nyp" # as a solution due to Gregor # Purdy. Not in common use. meg megabyte # Some people consider these # units along with the kilobyte gig gigabyte # to be defined according to # powers of 2 with the kilobyte # equal to 2^10 bytes, the # megabyte equal to 2^20 bytes and # the gigabyte equal to 2^30 bytes # but these usages are forbidden # by SI. Binary prefixes have # been defined by IEC to replace # the SI prefixes. Use them to # get the binary units KiB, MiB, # GiB, etc. jiffy 0.01 sec # This is defined in the Jargon File jiffies jiffy # (http://www.jargon.org) as being the # duration of a clock tick for measuring # wall-clock time. Supposedly the value # used to be 1|60 sec or 1|50 sec # depending on the frequency of AC power, # but then 1|100 sec became more common. # On linux systems, this term is used and # for the Intel based chips, it does have # the value of .01 sec. The Jargon File # also lists two other definitions: # millisecond, and the time taken for # light to travel one foot. cdaudiospeed 44.1 kHz 2*16 bits # CD audio data rate at 44.1 kHz with 2 # samples of sixteen bits each. cdromspeed 75 2048 bytes / sec # For data CDs (mode1) 75 sectors are read # each second with 2048 bytes per sector. # Audio CDs do not have sectors, but # people sometimes divide the bit rate by # 75 and claim a sector length of 2352. # Data CDs have a lower rate due to # increased error correction overhead. # There is a rarely used mode (mode2) with # 2336 bytes per sector that has fewer # error correction bits than mode1. dvdspeed 1385 kB/s # This is the "1x" speed of a DVD using # constant linear velocity (CLV) mode. # Modern DVDs may vary the linear velocity # as they go from the inside to the # outside of the disc. # See http://www.osta.org/technology/dvdqa/dvdqa4.htm FIT / 1e9 hour # Failures In Time, number of failures per billion hours # # The IP address space is divided into subnets. The number of hosts # in a subnet depends on the length of the subnet prefix. This is # often written as /N where N is the number of bits in the prefix. # # https://en.wikipedia.org/wiki/Subnetwork # # These definitions gives the number of hosts for a subnet whose # prefix has the specified length in bits. # ipv4subnetsize(prefix_len) units=[1;1] domain=[0,32] range=[1,4294967296] \ 2^(32-prefix_len) ; 32-log2(ipv4subnetsize) ipv4classA ipv4subnetsize(8) ipv4classB ipv4subnetsize(16) ipv4classC ipv4subnetsize(24) ipv6subnetsize(prefix_len) units=[1;1] domain=[0,128] \ range=[1,340282366920938463463374607431768211456] \ 2^(128-prefix_len) ; 128-log2(ipv6subnetsize) # # Musical measures. Musical intervals expressed as ratios. Multiply # two intervals together to get the sum of the interval. The function # musicalcent can be used to convert ratios to cents. # # Perfect intervals octave 2 majorsecond musicalfifth^2 / octave majorthird 5|4 minorthird 6|5 musicalfourth 4|3 musicalfifth 3|2 majorsixth musicalfourth majorthird minorsixth musicalfourth minorthird majorseventh musicalfifth majorthird minorseventh musicalfifth minorthird pythagoreanthird majorsecond musicalfifth^2 / octave syntoniccomma pythagoreanthird / majorthird pythagoreancomma musicalfifth^12 / octave^7 # Equal tempered definitions semitone octave^(1|12) musicalcent(x) units=[1;1] range=(0,) semitone^(x/100) ; \ 100 log(musicalcent)/log(semitone) # # Musical note lengths. # wholenote ! MUSICAL_NOTE_LENGTH wholenote halfnote 1|2 wholenote quarternote 1|4 wholenote eighthnote 1|8 wholenote sixteenthnote 1|16 wholenote thirtysecondnote 1|32 wholenote sixtyfourthnote 1|64 wholenote dotted 3|2 doubledotted 7|4 breve doublewholenote semibreve wholenote minimnote halfnote crotchet quarternote quaver eighthnote semiquaver sixteenthnote demisemiquaver thirtysecondnote hemidemisemiquaver sixtyfourthnote semidemisemiquaver hemidemisemiquaver # # yarn and cloth measures # # yarn linear density woolyarnrun 1600 yard/pound # 1600 yds of "number 1 yarn" weighs # a pound. yarncut 300 yard/pound # Less common system used in # Pennsylvania for wool yarn cottonyarncount 840 yard/pound linenyarncount 300 yard/pound # Also used for hemp and ramie worstedyarncount 1680 ft/pound metricyarncount meter/gram denier 1|9 tex # used for silk and rayon manchesteryarnnumber drams/1000 yards # old system used for silk pli lb/in typp 1000 yd/lb # abbreviation for Thousand Yard Per Pound asbestoscut 100 yd/lb # used for glass and asbestos yarn tex gram / km # rational metric yarn measure, meant drex 0.1 tex # to be used for any kind of yarn poumar lb / 1e6 yard # yarn and cloth length skeincotton 80*54 inch # 80 turns of thread on a reel with a # 54 in circumference (varies for other # kinds of thread) cottonbolt 120 ft # cloth measurement woolbolt 210 ft bolt cottonbolt heer 600 yards cut 300 yards # used for wet-spun linen yarn lea 300 yards sailmakersyard 28.5 in sailmakersounce oz / sailmakersyard 36 inch silkmomme momme / 25 yards 1.49 inch # Traditional silk weight silkmm silkmomme # But it is also defined as # lb/100 yd 45 inch. The two # definitions are slightly different # and neither one seems likely to be # the true source definition. # # drug dosage # mcg microgram # Frequently used for vitamins iudiptheria 62.8 microgram # IU is for international unit iupenicillin 0.6 microgram iuinsulin 41.67 microgram drop 1|20 ml # The drop was an old "unit" that was # replaced by the minim. But I was # told by a pharmacist that in his # profession, the conversion of 20 # drops per ml is actually used. bloodunit 450 ml # For whole blood. For blood # components, a blood unit is the # quanity of the component found in a # blood unit of whole blood. The # human body contains about 12 blood # units of whole blood. # # misc medical measure # frenchcathetersize 1|3 mm # measure used for the outer diameter # of a catheter charriere frenchcathetersize # # fixup units for times when prefix handling doesn't do the job # hectare hectoare megohm megaohm kilohm kiloohm microhm microohm megalerg megaerg # 'L' added to make it pronounceable [18]. # # Money # # Note that US$ is the primitive unit so other currencies are # generally given in US$. # unitedstatesdollar US$ usdollar US$ $ dollar mark germanymark #bolivar venezuelabolivar # Not all databases are #venezuelabolivarfuerte 1e-5 bolivar # supplying these #bolivarfuerte 1e-5 bolivar # The currency was revalued #oldbolivar 1|1000 bolivarfuerte # twice peseta spainpeseta rand southafricarand escudo portugalescudo guilder netherlandsguilder hollandguilder netherlandsguilder peso mexicopeso yen japanyen lira turkeylira rupee indiarupee drachma greecedrachma franc francefranc markka finlandmarkka britainpound unitedkingdompound greatbritainpound unitedkingdompound unitedkingdompound ukpound poundsterling britainpound yuan chinayuan # Unicode Currency Names !utf8 icelandkróna icelandkrona polandzłoty polandzloty tongapa’anga tongapa'anga #venezuelabolívar venezuelabolivar vietnamđồng vietnamdong mongoliatögrög mongoliatugrik sãotomé&príncipedobra saotome&principedobra !endutf8 UKP GBP # Not an ISO code, but looks like one, and # sometimes used on usenet. !include currency.units # Money on the gold standard, used in the late 19th century and early # 20th century. olddollargold 23.22 grains goldprice # Used until 1934 newdollargold 96|7 grains goldprice # After Jan 31, 1934 dollargold newdollargold poundgold 113 grains goldprice # British pound # Precious metals goldounce goldprice troyounce silverounce silverprice troyounce platinumounce platinumprice troyounce XAU goldounce XPT platinumounce XAG silverounce # Nominal masses of US coins. Note that dimes, quarters and half dollars # have weight proportional to value. Before 1965 it was $40 / kg. USpennyweight 2.5 grams # Since 1982, 48 grains before USnickelweight 5 grams USdimeweight US$ 0.10 / (20 US$ / lb) # Since 1965 USquarterweight US$ 0.25 / (20 US$ / lb) # Since 1965 UShalfdollarweight US$ 0.50 / (20 US$ / lb) # Since 1971 USdollarweight 8.1 grams # Weight of Susan B. Anthony and # Sacagawea dollar coins # British currency quid britainpound # Slang names fiver 5 quid tenner 10 quid monkey 500 quid brgrand 1000 quid bob shilling shilling 1|20 britainpound # Before decimalisation, there oldpence 1|12 shilling # were 20 shillings to a pound, farthing 1|4 oldpence # each of twelve old pence guinea 21 shilling # Still used in horse racing crown 5 shilling florin 2 shilling groat 4 oldpence tanner 6 oldpence brpenny 0.01 britainpound pence brpenny tuppence 2 pence tuppenny tuppence ha'penny halfbrpenny hapenny ha'penny oldpenny oldpence oldtuppence 2 oldpence oldtuppenny oldtuppence threepence 3 oldpence # threepence never refers to new money threepenny threepence oldthreepence threepence oldthreepenny threepence oldhalfpenny halfoldpenny oldha'penny oldhalfpenny oldhapenny oldha'penny brpony 25 britainpound # Canadian currency loony 1 canadadollar # This coin depicts a loon toony 2 canadadollar # Cryptocurrency satoshi 1e-8 bitcoin XBT bitcoin # nonstandard code # # Units used for measuring volume of wood # cord 4*4*8 ft^3 # 4 ft by 4 ft by 8 ft bundle of wood facecord 1|2 cord cordfoot 1|8 cord # One foot long section of a cord cordfeet cordfoot housecord 1|3 cord # Used to sell firewood for residences, # often confusingly called a "cord" boardfoot ft^2 inch # Usually 1 inch thick wood boardfeet boardfoot fbm boardfoot # feet board measure stack 4 yard^3 # British, used for firewood and coal [18] rick 4 ft 8 ft 16 inches # Stack of firewood, supposedly # sometimes called a face cord, but this # value is equal to 1|3 cord. Name # comes from an old Norse word for a # stack of wood. stere m^3 timberfoot ft^3 # Used for measuring solid blocks of wood standard 120 12 ft 11 in 1.5 in # This is the St Petersburg or # Pittsburg standard. Apparently the # term is short for "standard hundred" # which was meant to refer to 100 pieces # of wood (deals). However, this # particular standard is equal to 120 # deals which are 12 ft by 11 in by 1.5 # inches (not the standard deal). hoppusfoot (4/pi) ft^3 # Volume calculation suggested in 1736 hoppusboardfoot 1|12 hoppusfoot # forestry manual by Edward Hoppus, for hoppuston 50 hoppusfoot # estimating the usable volume of a log. # It results from computing the volume # of a cylindrical log of length, L, and # girth (circumference), G, by V=L(G/4)^2. # The hoppus ton is apparently still in # use for shipments from Southeast Asia. # In Britain, the deal is apparently any piece of wood over 6 feet long, over # 7 wide and 2.5 inches thick. The OED doesn't give a standard size. A piece # of wood less than 7 inches wide is called a "batten". This unit is now used # exclusively for fir and pine. deal 12 ft 11 in 2.5 in # The standard North American deal [OED] wholedeal 12 ft 11 in 1.25 in # If it's half as thick as the standard # deal it's called a "whole deal"! splitdeal 12 ft 11 in 5|8 in # And half again as thick is a split deal. # Used for shellac mixing rate poundcut pound / gallon lbcut poundcut # # Gas and Liquid flow units # FLUID_FLOW VOLUME / TIME # Some obvious volumetric gas flow units (cu is short for cubic) cumec m^3/s cusec ft^3/s # Conventional abbreviations for fluid flow units gph gal/hr gpm gal/min mgd megagal/day brgph brgallon/hr brgpm brgallon/min brmgd mega brgallon/day usgph usgallon/hr usgpm usgallon/min usmgd mega usgallon/day cfs ft^3/s cfh ft^3/hour cfm ft^3/min lpm liter/min lfm ft/min # Used to report air flow produced by fans. # Multiply by cross sectional area to get a # flow in cfm. pru mmHg / (ml/min) # peripheral resistance unit, used in # medicine to assess blood flow in # the capillaries. # Miner's inch: This is an old historic unit used in the Western United # States. It is generally defined as the rate of flow through a one square # inch hole at a specified depth such as 4 inches. In the late 19th century, # volume of water was sometimes measured in the "24 hour inch". Values for the # miner's inch were fixed by state statues. (This information is from a web # site operated by the Nevada Division of Water Planning: The Water Words # Dictionary at http://www.state.nv.us/cnr/ndwp/dict-1/waterwds.htm.) minersinchAZ 1.5 ft^3/min minersinchCA 1.5 ft^3/min minersinchMT 1.5 ft^3/min minersinchNV 1.5 ft^3/min minersinchOR 1.5 ft^3/min minersinchID 1.2 ft^3/min minersinchKS 1.2 ft^3/min minersinchNE 1.2 ft^3/min minersinchNM 1.2 ft^3/min minersinchND 1.2 ft^3/min minersinchSD 1.2 ft^3/min minersinchUT 1.2 ft^3/min minersinchCO 1 ft^3/sec / 38.4 # 38.4 miner's inches = 1 ft^3/sec minersinchBC 1.68 ft^3/min # British Columbia # Oceanographic flow sverdrup 1e6 m^3 / sec # Used to express flow of ocean # currents. Named after Norwegian # oceanographer H. Sverdrup. # In vacuum science and some other applications, gas flow is measured # as the product of volumetric flow and pressure. This is useful # because it makes it easy to compare with the flow at standard # pressure (one atmosphere). It also directly relates to the number # of gas molecules per unit time, and hence to the mass flow if the # molecular mass is known. GAS_FLOW PRESSURE FLUID_FLOW sccm atm cc/min # 's' is for "standard" to indicate sccs atm cc/sec # flow at standard pressure scfh atm ft^3/hour # scfm atm ft^3/min slpm atm liter/min slph atm liter/hour lusec liter micron Hg / s # Used in vacuum science # US Standard Atmosphere (1976) # Atmospheric temperature and pressure vs. geometric height above sea level # This definition covers only the troposphere (the lowest atmospheric # layer, up to 11 km), and assumes the layer is polytropic. # A polytropic process is one for which PV^k = const, where P is the # pressure, V is the volume, and k is the polytropic exponent. The # polytropic index is n = 1 / (k - 1). As noted in the Wikipedia article # https://en.wikipedia.org/wiki/Polytropic_process, some authors reverse # the definitions of "exponent" and "index." The functions below assume # the following parameters: # temperature lapse rate, -dT/dz, in troposphere lapserate 6.5 K/km # US Std Atm (1976) # air molecular weight, including constituent mol wt, given # in Table 3, p. 3 air_1976 78.084 % 28.0134 \ + 20.9476 % 31.9988 \ + 9340 ppm 39.948 \ + 314 ppm 44.00995 \ + 18.18 ppm 20.183 \ + 5.24 ppm 4.0026 \ + 2 ppm 16.04303 \ + 1.14 ppm 83.80 \ + 0.55 ppm 2.01594 \ + 0.087 ppm 131.30 # universal gas constant R_1976 8.31432e3 N m/(kmol K) # polytropic index n polyndx_1976 air_1976 (kg/kmol) gravity/(R_1976 lapserate) - 1 # If desired, redefine using current values for air mol wt and R polyndx polyndx_1976 # polyndx air (kg/kmol) gravity/(R lapserate) - 1 # for comparison with various references polyexpnt (polyndx + 1) / polyndx # The model assumes the following reference values: # sea-level temperature and pressure stdatmT0 288.15 K stdatmP0 atm # "effective radius" for relation of geometric to geopotential height, # at a latitude at which g = 9.80665 m/s (approximately 45.543 deg); no # relation to actual radius earthradUSAtm 6356766 m # Temperature vs. geopotential height h # Assumes 15 degC at sea level # Based on approx 45 deg latitude # Lower limits of domain and upper limits of range are those of the # tables in US Standard Atmosphere (NASA 1976) stdatmTH(h) units=[m;K] domain=[-5000,11e3] range=[217,321] \ stdatmT0+(-lapserate h) ; (stdatmT0+(-stdatmTH))/lapserate # Temperature vs. geometric height z; based on approx 45 deg latitude stdatmT(z) units=[m;K] domain=[-5000,11e3] range=[217,321] \ stdatmTH(geop_ht(z)) ; ~geop_ht(~stdatmTH(stdatmT)) # Pressure vs. geopotential height h # Assumes 15 degC and 101325 Pa at sea level # Based on approx 45 deg latitude # Lower limits of domain and upper limits of range are those of the # tables in US Standard Atmosphere (NASA 1976) stdatmPH(h) units=[m;Pa] domain=[-5000,11e3] range=[22877,177764] \ atm (1 - (lapserate/stdatmT0) h)^(polyndx + 1) ; \ (stdatmT0/lapserate) (1+(-(stdatmPH/stdatmP0)^(1/(polyndx + 1)))) # Pressure vs. geometric height z; based on approx 45 deg latitude stdatmP(z) units=[m;Pa] domain=[-5000,11e3] range=[22877,177764] \ stdatmPH(geop_ht(z)); ~geop_ht(~stdatmPH(stdatmP)) # Geopotential height from geometric height # Based on approx 45 deg latitude # Lower limits of domain and range are somewhat arbitrary; they # correspond to the limits in the US Std Atm tables geop_ht(z) units=[m;m] domain=[-5000,) range=[-5004,) \ (earthradUSAtm z) / (earthradUSAtm + z) ; \ (earthradUSAtm geop_ht) / (earthradUSAtm + (-geop_ht)) # The standard value for the sea-level acceleration due to gravity is # 9.80665 m/s^2, but the actual value varies with latitude (Harrison 1949) # R_eff = 2 g_phi / denom # g_phi = 978.0356e-2 (1+0.0052885 sin(lat)^2+(-0.0000059) sin(2 lat)^2) # or # g_phi = 980.6160e-2 (1+(-0.0026373) cos(2 lat)+0.0000059 cos(2 lat)^2) # denom = 3.085462e-6+2.27e-9 cos(2 lat)+(-2e-12) cos(4 lat) (minutes?) # There is no inverse function; the standard value applies at a latitude # of about 45.543 deg g_phi(lat) units=[deg;m/s2] domain=[0,90] noerror \ 980.6160e-2 (1+(-0.0026373) cos(2 lat)+0.0000059 cos(2 lat)^2) m/s2 # effective Earth radius for relation of geometric height to # geopotential height, as function of latitude (Harrison 1949) earthradius_eff(lat) units=[deg;m] domain=[0,90] noerror \ m 2 9.780356 (1+0.0052885 sin(lat)^2+(-0.0000059) sin(2 lat)^2) / \ (3.085462e-6 + 2.27e-9 cos(2 lat) + (-2e-12) cos(4 lat)) # References # Harrison, L.P. 1949. Relation Between Geopotential and Geometric # Height. In Smithsonian Meteorological Tables. List, Robert J., ed. # 6th ed., 4th reprint, 1968. Washington, DC: Smithsonian Institution. # NASA. US National Aeronautics and Space Administration. 1976. # US Standard Atmosphere 1976. Washington, DC: US Government Printing Office. # Gauge pressure functions # # Gauge pressure is measured relative to atmospheric pressure. In the English # system, where pressure is often given in pounds per square inch, gauge # pressure is often indicated by 'psig' to distinguish it from absolute # pressure, often indicated by 'psia'. At the standard atmospheric pressure # of 14.696 psia, a gauge pressure of 0 psig is an absolute pressure of 14.696 # psia; an automobile tire inflated to 31 psig has an absolute pressure of # 45.696 psia. # # With gaugepressure(), the units must be specified (e.g., gaugepressure(1.5 # bar)); with psig(), the units are taken as psi, so the example above of tire # pressure could be given as psig(31). # # If the normal elevation is significantly different from sea level, change # Patm appropriately, and adjust the lower domain limit on the gaugepressure # definition. Patm atm gaugepressure(x) units=[Pa;Pa] domain=[-101325,) range=[0,) \ x + Patm ; gaugepressure+(-Patm) psig(x) units=[1;Pa] domain=[-14.6959487755135,) range=[0,) \ gaugepressure(x psi) ; ~gaugepressure(psig) / psi # Pressure for underwater diving seawater 0.1 bar / meter msw meter seawater fsw foot seawater # # Wire Gauge # # This area is a nightmare with huge charts of wire gauge diameters # that usually have no clear origin. There are at least 5 competing wire gauge # systems to add to the confusion. The use of wire gauge is related to the # manufacturing method: a metal rod is heated and drawn through a hole. The # size change can't be too big. To get smaller wires, the process is repeated # with a series of smaller holes. Generally larger gauges mean smaller wires. # The gauges often have values such as "00" and "000" which are larger sizes # than simply "0" gauge. In the tables that appear below, these gauges must be # specified as negative numbers (e.g. "00" is -1, "000" is -2, etc). # Alternatively, you can use the following units: # g00 (-1) g000 (-2) g0000 (-3) g00000 (-4) g000000 (-5) g0000000 (-6) # American Wire Gauge (AWG) or Brown & Sharpe Gauge appears to be the most # important gauge. ASTM B-258 specifies that this gauge is based on geometric # interpolation between gauge 0000, which is 0.46 inches exactly, and gauge 36 # which is 0.005 inches exactly. Therefore, the diameter in inches of a wire # is given by the formula 1|200 92^((36-g)/39). Note that 92^(1/39) is close # to 2^(1/6), so diameter is approximately halved for every 6 gauges. For the # repeated zero values, use negative numbers in the formula. The same document # also specifies rounding rules which seem to be ignored by makers of tables. # Gauges up to 44 are to be specified with up to 4 significant figures, but no # closer than 0.0001 inch. Gauges from 44 to 56 are to be rounded to the # nearest 0.00001 inch. # # In addition to being used to measure wire thickness, this gauge is used to # measure the thickness of sheets of aluminum, copper, and most metals other # than steel, iron and zinc. wiregauge(g) units=[1;m] range=(0,) \ 1|200 92^((36+(-g))/39) in; 36+(-39)ln(200 wiregauge/in)/ln(92) awg() wiregauge # Next we have the SWG, the Imperial or British Standard Wire Gauge. This one # is piecewise linear. It was used for aluminum sheets. brwiregauge[in] \ -6 0.5 \ -5 0.464 \ -3 0.4 \ -2 0.372 \ 3 0.252 \ 6 0.192 \ 10 0.128 \ 14 0.08 \ 19 0.04 \ 23 0.024 \ 26 0.018 \ 28 0.0148 \ 30 0.0124 \ 39 0.0052 \ 49 0.0012 \ 50 0.001 # The following is from the Appendix to ASTM B 258 # # For example, in U.S. gage, the standard for sheet metal is based on the # weight of the metal, not on the thickness. 16-gage is listed as # approximately .0625 inch thick and 40 ounces per square foot (the original # standard was based on wrought iron at .2778 pounds per cubic inch; steel # has almost entirely superseded wrought iron for sheet use, at .2833 pounds # per cubic inch). Smaller numbers refer to greater thickness. There is no # formula for converting gage to thickness or weight. # # It's rather unclear from the passage above whether the plate gauge values are # therefore wrong if steel is being used. Reference [15] states that steel is # in fact measured using this gauge (under the name Manufacturers' Standard # Gauge) with a density of 501.84 lb/ft3 = 0.2904 lb/in3 used for steel. # But this doesn't seem to be the correct density of steel (.2833 lb/in3 is # closer). # # This gauge was established in 1893 for purposes of taxation. # Old plate gauge for iron plategauge[(oz/ft^2)/(480*lb/ft^3)] \ -5 300 \ 1 180 \ 14 50 \ 16 40 \ 17 36 \ 20 24 \ 26 12 \ 31 7 \ 36 4.5 \ 38 4 # Manufacturers Standard Gage stdgauge[(oz/ft^2)/(501.84*lb/ft^3)] \ -5 300 \ 1 180 \ 14 50 \ 16 40 \ 17 36 \ 20 24 \ 26 12 \ 31 7 \ 36 4.5 \ 38 4 # A special gauge is used for zinc sheet metal. Notice that larger gauges # indicate thicker sheets. zincgauge[in] \ 1 0.002 \ 10 0.02 \ 15 0.04 \ 19 0.06 \ 23 0.1 \ 24 0.125 \ 27 0.5 \ 28 1 # # Imperial drill bit sizes are reported in inches or in a numerical or # letter gauge. # drillgauge[in] \ 1 0.2280 \ 2 0.2210 \ 3 0.2130 \ 4 0.2090 \ 5 0.2055 \ 6 0.2040 \ 7 0.2010 \ 8 0.1990 \ 9 0.1960 \ 10 0.1935 \ 11 0.1910 \ 12 0.1890 \ 13 0.1850 \ 14 0.1820 \ 15 0.1800 \ 16 0.1770 \ 17 0.1730 \ 18 0.1695 \ 19 0.1660 \ 20 0.1610 \ 22 0.1570 \ 23 0.1540 \ 24 0.1520 \ 25 0.1495 \ 26 0.1470 \ 27 0.1440 \ 28 0.1405 \ 29 0.1360 \ 30 0.1285 \ 31 0.1200 \ 32 0.1160 \ 33 0.1130 \ 34 0.1110 \ 35 0.1100 \ 36 0.1065 \ 38 0.1015 \ 39 0.0995 \ 40 0.0980 \ 41 0.0960 \ 42 0.0935 \ 43 0.0890 \ 44 0.0860 \ 45 0.0820 \ 46 0.0810 \ 48 0.0760 \ 51 0.0670 \ 52 0.0635 \ 53 0.0595 \ 54 0.0550 \ 55 0.0520 \ 56 0.0465 \ 57 0.0430 \ 65 0.0350 \ 66 0.0330 \ 68 0.0310 \ 69 0.0292 \ 70 0.0280 \ 71 0.0260 \ 73 0.0240 \ 74 0.0225 \ 75 0.0210 \ 76 0.0200 \ 78 0.0160 \ 79 0.0145 \ 80 0.0135 \ 88 0.0095 \ 104 0.0031 drillA 0.234 in drillB 0.238 in drillC 0.242 in drillD 0.246 in drillE 0.250 in drillF 0.257 in drillG 0.261 in drillH 0.266 in drillI 0.272 in drillJ 0.277 in drillK 0.281 in drillL 0.290 in drillM 0.295 in drillN 0.302 in drillO 0.316 in drillP 0.323 in drillQ 0.332 in drillR 0.339 in drillS 0.348 in drillT 0.358 in drillU 0.368 in drillV 0.377 in drillW 0.386 in drillX 0.397 in drillY 0.404 in drillZ 0.413 in # # Screw sizes # # In the USA, screw diameters for both wood screws and machine screws # are reported using a gauge number. Metric machine screws are # reported as Mxx where xx is the diameter in mm. # screwgauge(g) units=[1;m] range=[0,) \ (.06 + .013 g) in ; (screwgauge/in + (-.06)) / .013 # # Abrasive grit size # # Standards governing abrasive grit sizes are complicated, specifying # fractions of particles that are passed or retained by different mesh # sizes. As a result, it is not possible to make precise comparisons # of different grit standards. The tables below allow the # determination of rough equivlants by using median particle size. # # Standards in the USA are determined by the Unified Abrasives # Manufacturers' Association (UAMA), which resulted from the merger of # several previous organizations. One of the old organizations was # CAMI (Coated Abrasives Manufacturers' Institute). # # UAMA has a web page with plots showing abrasive particle ranges for # various different grits and comparisons between standards. # # http://www.uama.org/Abrasives101/101Standards.html # # Abrasives are grouped into "bonded" abrasives for use with grinding # wheels and "coated" abrasives for sandpapers and abrasive films. # The industry uses different grit standards for these two # categories. # # Another division is between "macrogrits", grits below 240 and # "microgrits", which are above 240. Standards differ, as do methods # for determining particle size. In the USA, ANSI B74.12 is the # standard governing macrogrits. ANSI B74.10 covers bonded microgrit # abrasives, and ANSI B74.18 covers coated microgrit abrasives. It # appears that the coated standard is identical to the bonded standard # for grits up through 600 but then diverges significantly. # # European grit sizes are determined by the Federation of European # Producers of Abrasives. http://www.fepa-abrasives.org # # They give two standards, the "F" grit for bonded abrasives and the # "P" grit for coated abrasives. This data is taken directly from # their web page. # FEPA P grit for coated abrasives is commonly seen on sandpaper in # the USA where the paper will be marked P600, for example. FEPA P # grits are said to be more tightly constrained than comparable ANSI # grits so that the particles are more uniform in size and hence give # a better finish. grit_P[micron] \ 12 1815 \ 16 1324 \ 20 1000 \ 24 764 \ 30 642 \ 36 538 \ 40 425 \ 50 336 \ 60 269 \ 80 201 \ 100 162 \ 120 125 \ 150 100 \ 180 82 \ 220 68 \ 240 58.5 \ 280 52.2 \ 320 46.2 \ 360 40.5 \ 400 35 \ 500 30.2 \ 600 25.8 \ 800 21.8 \ 1000 18.3 \ 1200 15.3 \ 1500 12.6 \ 2000 10.3 \ 2500 8.4 # The F grit is the European standard for bonded abrasives such as # grinding wheels grit_F[micron] \ 4 4890 \ 5 4125 \ 6 3460 \ 7 2900 \ 8 2460 \ 10 2085 \ 12 1765 \ 14 1470 \ 16 1230 \ 20 1040 \ 22 885 \ 24 745 \ 30 625 \ 36 525 \ 40 438 \ 46 370 \ 54 310 \ 60 260 \ 70 218 \ 80 185 \ 90 154 \ 100 129 \ 120 109 \ 150 82 \ 180 69 \ 220 58 \ 230 53 \ 240 44.5 \ 280 36.5 \ 320 29.2 \ 360 22.8 \ 400 17.3 \ 500 12.8 \ 600 9.3 \ 800 6.5 \ 1000 4.5 \ 1200 3 \ 1500 2.0 \ 2000 1.2 # According to the UAMA web page, the ANSI bonded and ANSI coated standards # are identical to FEPA F in the macrogrit range (under 240 grit), so these # values are taken from the FEPA F table. The values for 240 and above are # from the UAMA web site and represent the average of the "d50" range # endpoints listed there. ansibonded[micron] \ 4 4890 \ 5 4125 \ 6 3460 \ 7 2900 \ 8 2460 \ 10 2085 \ 12 1765 \ 14 1470 \ 16 1230 \ 20 1040 \ 22 885 \ 24 745 \ 30 625 \ 36 525 \ 40 438 \ 46 370 \ 54 310 \ 60 260 \ 70 218 \ 80 185 \ 90 154 \ 100 129 \ 120 109 \ 150 82 \ 180 69 \ 220 58 \ 240 50 \ 280 39.5 \ 320 29.5 \ 360 23 \ 400 18.25 \ 500 13.9 \ 600 10.55 \ 800 7.65 \ 1000 5.8 \ 1200 3.8 grit_ansibonded() ansibonded # Like the bonded grit, the coated macrogrits below 240 are taken from the # FEPA F table. Data above this is from the UAMA site. Note that the coated # and bonded standards are evidently the same from 240 up to 600 grit, but # starting at 800 grit, the coated standard diverges. The data from UAMA show # that 800 grit coated has an average size slightly larger than the average # size of 600 grit coated/bonded. However, the 800 grit has a significantly # smaller particle size variation. # # Because of this non-monotonicity from 600 grit to 800 grit this definition # produces a warning about the lack of a unique inverse. ansicoated[micron] noerror \ 4 4890 \ 5 4125 \ 6 3460 \ 7 2900 \ 8 2460 \ 10 2085 \ 12 1765 \ 14 1470 \ 16 1230 \ 20 1040 \ 22 885 \ 24 745 \ 30 625 \ 36 525 \ 40 438 \ 46 370 \ 54 310 \ 60 260 \ 70 218 \ 80 185 \ 90 154 \ 100 129 \ 120 109 \ 150 82 \ 180 69 \ 220 58 \ 240 50 \ 280 39.5 \ 320 29.5 \ 360 23 \ 400 18.25 \ 500 13.9 \ 600 10.55 \ 800 11.5 \ 1000 9.5 \ 2000 7.2 \ 2500 5.5 \ 3000 4 \ 4000 3 \ 6000 2 \ 8000 1.2 grit_ansicoated() ansicoated # # Is this correct? This is the JIS Japanese standard used on waterstones # jisgrit[micron] \ 150 75 \ 180 63 \ 220 53 \ 280 48 \ 320 40 \ 360 35 \ 400 30 \ 600 20 \ 700 17 \ 800 14 \ 1000 11.5 \ 1200 9.5 \ 1500 8 \ 2000 6.7 \ 2500 5.5 \ 3000 4 \ 4000 3 \ 6000 2 \ 8000 1.2 # The "Finishing Scale" marked with an A (e.g. A75). This information # is from the web page of the sand paper manufacturer Klingspor # http://www.klingspor.com/gritgradingsystems.htm # # I have no information about what this scale is used for. grit_A[micron]\ 16 15.3 \ 25 21.8 \ 30 23.6 \ 35 25.75 \ 45 35 \ 60 46.2 \ 65 53.5 \ 75 58.5 \ 90 65 \ 110 78 \ 130 93 \ 160 127 \ 200 156 # # Grits for DMT brand diamond sharpening stones from # http://dmtsharp.com/products/colorcode.htm # dmtxxcoarse 120 micron # 120 mesh dmtsilver dmtxxcoarse dmtxx dmtxxcoarse dmtxcoarse 60 micron # 220 mesh dmtx dmtxcoarse dmtblack dmtxcoarse dmtcoarse 45 micron # 325 mesh dmtc dmtcoarse dmtblue dmtcoarse dmtfine 25 micron # 600 mesh dmtred dmtfine dmtf dmtfine dmtefine 9 micron # 1200 mesh dmte dmtefine dmtgreen dmtefine dmtceramic 7 micron # 2200 mesh dmtcer dmtceramic dmtwhite dmtceramic dmteefine 3 micron # 8000 mesh dmttan dmteefine dmtee dmteefine # # The following values come from a page in the Norton Stones catalog, # available at their web page, http://www.nortonstones.com. # hardtranslucentarkansas 6 micron # Natural novaculite (silicon quartz) softarkansas 22 micron # stones extrafineindia 22 micron # India stones are Norton's manufactured fineindia 35 micron # aluminum oxide product mediumindia 53.5 micron coarseindia 97 micron finecrystolon 45 micron # Crystolon stones are Norton's mediumcrystalon 78 micron # manufactured silicon carbide product coarsecrystalon 127 micron # The following are not from the Norton catalog hardblackarkansas 6 micron hardwhitearkansas 11 micron washita 35 micron # # Mesh systems for measuring particle sizes by sifting through a wire # mesh or sieve # # The Tyler system and US Sieve system are based on four steps for # each factor of 2 change in the size, so each size is 2^1|4 different # from the adjacent sizes. Unfortunately, the mesh numbers are # arbitrary, so the sizes cannot be expressed with a functional form. # Various references round the values differently. The mesh numbers # are supposed to correspond to the number of holes per inch, but this # correspondence is only approximate because it doesn't include the # wire size of the mesh. # The Tyler Mesh system was apparently introduced by the WS Tyler # company, but it appears that they no longer use it. They follow the # ASTM E11 standard. meshtyler[micron] \ 2.5 8000 \ 3 6727 \ 3.5 5657 \ 4 4757 \ 5 4000 \ 6 3364 \ 7 2828 \ 8 2378 \ 9 2000 \ 10 1682 \ 12 1414 \ 14 1189 \ 16 1000 \ 20 841 \ 24 707 \ 28 595 \ 32 500 \ 35 420 \ 42 354 \ 48 297 \ 60 250 \ 65 210 \ 80 177 \ 100 149 \ 115 125 \ 150 105 \ 170 88 \ 200 74 \ 250 63 \ 270 53 \ 325 44 \ 400 37 # US Sieve size, ASTM E11 # # The WS Tyler company prints the list from ASTM E11 in their catalog, # http://wstyler.com/wp-content/uploads/2015/11/Product-Catalog-2.pdf sieve[micron] \ 3.5 5600 \ 4 4750 \ 5 4000 \ 6 3350 \ 7 2800 \ 8 2360 \ 10 2000 \ 12 1700 \ 14 1400 \ 16 1180 \ 18 1000 \ 20 850 \ 25 710 \ 30 600 \ 35 500 \ 40 425 \ 45 355 \ 50 300 \ 60 250 \ 70 212 \ 80 180 \ 100 150 \ 120 125 \ 140 106 \ 170 90 \ 200 75 \ 230 63 \ 270 53 \ 325 45 \ 400 38 \ 450 32 \ 500 25 \ 625 20 # These last two values are not in the standard series # but were included in the ASTM standard because they meshUS() sieve # were in common usage. # British Mesh size, BS 410: 1986 # This system appears to correspond to the Tyler and US system, but # with different mesh numbers. # # http://www.panadyne.com/technical/panadyne_international_sieve_chart.pdf # meshbritish[micron] \ 3 5657 \ 3.5 4757 \ 4 4000 \ 5 3364 \ 6 2828 \ 7 2378 \ 8 2000 \ 10 1682 \ 12 1414 \ 14 1189 \ 16 1000 \ 18 841 \ 22 707 \ 25 595 \ 30 500 \ 36 420 \ 44 354 \ 52 297 \ 60 250 \ 72 210 \ 85 177 \ 100 149 \ 120 125 \ 150 105 \ 170 88 \ 200 74 \ 240 63 \ 300 53 \ 350 44 \ 400 37 # French system, AFNOR NFX11-501: 1970 # The system appears to be based on size doubling every 3 mesh # numbers, though the values have been agressively rounded. # It's not clear if the unrounded values would be considered # incorrect, so this is given as a table rather than a function. # Functional form: # meshtamis(mesh) units=[1;m] 5000 2^(1|3 (mesh-38)) micron # # http://www.panadyne.com/technical/panadyne_international_sieve_chart.pdf meshtamis[micron] \ 17 40 \ 18 50 \ 19 63 \ 20 80 \ 21 100 \ 22 125 \ 23 160 \ 24 200 \ 25 250 \ 26 315 \ 27 400 \ 28 500 \ 29 630 \ 30 800 \ 31 1000 \ 32 1250 \ 33 1600 \ 34 2000 \ 35 2500 \ 36 3150 \ 37 4000 \ 38 5000 # # Ring size. All ring sizes are given as the circumference of the ring. # # USA ring sizes. Several slightly different definitions seem to be in # circulation. According to [15], the interior diameter of size n ring in # inches is 0.32 n + 0.458 for n ranging from 3 to 13.5 by steps of 0.5. The # size 2 ring is inconsistently 0.538in and no 2.5 size is listed. # # However, other sources list 0.455 + 0.0326 n and 0.4525 + 0.0324 n as the # diameter and list no special case for size 2. (Or alternatively they are # 1.43 + .102 n and 1.4216+.1018 n for measuring circumference in inches.) One # reference claimed that the original system was that each size was 1|10 inch # circumference, but that source doesn't have an explanation for the modern # system which is somewhat different. ringsize(n) units=[1;in] domain=[2,) range=[1.6252,) \ (1.4216+.1018 n) in ; (ringsize/in + (-1.4216))/.1018 # Old practice in the UK measured rings using the "Wheatsheaf gauge" with sizes # specified alphabetically and based on the ring inside diameter in steps of # 1|64 inch. This system was replaced in 1987 by British Standard 6820 which # specifies sizes based on circumference. Each size is 1.25 mm different from # the preceding size. The baseline is size C which is 40 mm circumference. # The new sizes are close to the old ones. Sometimes it's necessary to go # beyond size Z to Z+1, Z+2, etc. sizeAring 37.50 mm sizeBring 38.75 mm sizeCring 40.00 mm sizeDring 41.25 mm sizeEring 42.50 mm sizeFring 43.75 mm sizeGring 45.00 mm sizeHring 46.25 mm sizeIring 47.50 mm sizeJring 48.75 mm sizeKring 50.00 mm sizeLring 51.25 mm sizeMring 52.50 mm sizeNring 53.75 mm sizeOring 55.00 mm sizePring 56.25 mm sizeQring 57.50 mm sizeRring 58.75 mm sizeSring 60.00 mm sizeTring 61.25 mm sizeUring 62.50 mm sizeVring 63.75 mm sizeWring 65.00 mm sizeXring 66.25 mm sizeYring 67.50 mm sizeZring 68.75 mm # Japanese sizes start with size 1 at a 13mm inside diameter and each size is # 1|3 mm larger in diameter than the previous one. They are multiplied by pi # to give circumference. jpringsize(n) units=[1;mm] domain=[1,) range=[0.040840704,) \ (38|3 + n/3) pi mm ; 3 jpringsize/ pi mm + (-38) # The European ring sizes are the length of the circumference in mm minus 40. euringsize(n) units=[1;mm] (n+40) mm ; euringsize/mm + (-40) # # Abbreviations # mph mile/hr brmpg mile/brgallon usmpg mile/usgallon mpg mile/gal kph km/hr fL footlambert fpm ft/min fps ft/s rpm rev/min rps rev/sec mi mile smi mile nmi nauticalmile mbh 1e3 btu/hour mcm 1e3 circularmil ipy inch/year # used for corrosion rates ccf 100 ft^3 # used for selling water [18] Mcf 1000 ft^3 # not million cubic feet [18] kp kilopond kpm kp meter Wh W hour hph hp hour plf lb / foot # pounds per linear foot # # Compatibility units with Unix version # pa Pa ev eV #hg Hg oe Oe mh mH rd rod pf pF gr grain nt N hz Hz hd hogshead dry drygallon/gallon nmile nauticalmile beV GeV bev beV coul C # # Radioactivity units # becquerel /s # Activity of radioactive source Bq becquerel # curie 3.7e10 Bq # Defined in 1910 as the radioactivity Ci curie # emitted by the amount of radon that is # in equilibrium with 1 gram of radium. rutherford 1e6 Bq # RADIATION_DOSE gray gray J/kg # Absorbed dose of radiation Gy gray # rad 1e-2 Gy # From Radiation Absorbed Dose rep 8.38 mGy # Roentgen Equivalent Physical, the amount # of radiation which , absorbed in the # body, would liberate the same amount # of energy as 1 roentgen of X rays # would, or 97 ergs. sievert J/kg # Dose equivalent: dosage that has the Sv sievert # same effect on human tissues as 200 rem 1e-2 Sv # keV X-rays. Different types of # radiation are weighted by the # Relative Biological Effectiveness # (RBE). # # Radiation type RBE # X-ray, gamma ray 1 # beta rays, > 1 MeV 1 # beta rays, < 1 MeV 1.08 # neutrons, < 1 MeV 4-5 # neutrons, 1-10 MeV 10 # protons, 1 MeV 8.5 # protons, .1 MeV 10 # alpha, 5 MeV 15 # alpha, 1 MeV 20 # # The energies are the kinetic energy # of the particles. Slower particles # interact more, so they are more # effective ionizers, and hence have # higher RBE values. # # rem stands for Roentgen Equivalent # Mammal banana_dose 0.1e-6 sievert # Informal measure of the dose due to # eating one average sized banana roentgen 2.58e-4 C / kg # Ionizing radiation that produces # 1 statcoulomb of charge in 1 cc of # dry air at stp. rontgen roentgen # Sometimes it appears spelled this way sievertunit 8.38 rontgen # Unit of gamma ray dose delivered in one # hour at a distance of 1 cm from a # point source of 1 mg of radium # enclosed in platinum .5 mm thick. eman 1e-7 Ci/m^3 # radioactive concentration mache 3.7e-7 Ci/m^3 # # Atomic weights. The atomic weight of an element is the ratio of the mass of # a mole of the element to 1|12 of a mole of Carbon 12. The Standard Atomic # Weights apply to the elements as they occur naturally on Earth. Elements # which do not occur naturally or which occur with wide isotopic variability do # not have Standard Atomic Weights. For these elements, the atomic weight is # based on the longest lived isotope, as marked in the comments. In some # cases, the comment for these entries also gives a number which is an atomic # weight for a different isotope that may be of more interest than the longest # lived isotope. # actinium 227.0278 aluminum 26.981539 americium 243.0614 # Longest lived. 241.06 antimony 121.760 argon 39.948 arsenic 74.92159 astatine 209.9871 # Longest lived barium 137.327 berkelium 247.0703 # Longest lived. 249.08 beryllium 9.012182 bismuth 208.98037 boron 10.811 bromine 79.904 cadmium 112.411 calcium 40.078 californium 251.0796 # Longest lived. 252.08 carbon 12.011 cerium 140.115 cesium 132.90543 chlorine 35.4527 chromium 51.9961 cobalt 58.93320 copper 63.546 curium 247.0703 deuterium 2.0141017778 dysprosium 162.50 einsteinium 252.083 # Longest lived erbium 167.26 europium 151.965 fermium 257.0951 # Longest lived fluorine 18.9984032 francium 223.0197 # Longest lived gadolinium 157.25 gallium 69.723 germanium 72.61 gold 196.96654 hafnium 178.49 helium 4.002602 holmium 164.93032 hydrogen 1.00794 indium 114.818 iodine 126.90447 iridium 192.217 iron 55.845 krypton 83.80 lanthanum 138.9055 lawrencium 262.11 # Longest lived lead 207.2 lithium 6.941 lutetium 174.967 magnesium 24.3050 manganese 54.93805 mendelevium 258.10 # Longest lived mercury 200.59 molybdenum 95.94 neodymium 144.24 neon 20.1797 neptunium 237.0482 nickel 58.6934 niobium 92.90638 nitrogen 14.00674 nobelium 259.1009 # Longest lived osmium 190.23 oxygen 15.9994 palladium 106.42 phosphorus 30.973762 platinum 195.08 plutonium 244.0642 # Longest lived. 239.05 polonium 208.9824 # Longest lived. 209.98 potassium 39.0983 praseodymium 140.90765 promethium 144.9127 # Longest lived. 146.92 protactinium 231.03588 radium 226.0254 radon 222.0176 # Longest lived rhenium 186.207 rhodium 102.90550 rubidium 85.4678 ruthenium 101.07 samarium 150.36 scandium 44.955910 selenium 78.96 silicon 28.0855 silver 107.8682 sodium 22.989768 strontium 87.62 sulfur 32.066 tantalum 180.9479 technetium 97.9072 # Longest lived. 98.906 tellurium 127.60 terbium 158.92534 thallium 204.3833 thorium 232.0381 thullium 168.93421 tin 118.710 titanium 47.867 tungsten 183.84 uranium 238.0289 vanadium 50.9415 xenon 131.29 ytterbium 173.04 yttrium 88.90585 zinc 65.39 zirconium 91.224 # Average molecular weight of air # # The atmospheric composition listed is from NASA Earth Fact Sheet (accessed # 28 August 2015) # http://nssdc.gsfc.nasa.gov/planetary/factsheet/earthfact.html # Numbers do not add up to exactly 100% due to roundoff and uncertainty Water # is highly variable, typically makes up about 1% air 78.08% nitrogen 2 \ + 20.95% oxygen 2 \ + 9340 ppm argon \ + 400 ppm (carbon + oxygen 2) \ + 18.18 ppm neon \ + 5.24 ppm helium \ + 1.7 ppm (carbon + 4 hydrogen) \ + 1.14 ppm krypton \ + 0.55 ppm hydrogen 2 # Density of the elements # # Note some elements occur in multiple forms (allotropes) with different # densities, and they are accordingly listed multiple times. # Density of gas phase elements at STP hydrogendensity 0.08988 g/l heliumdensity 0.1786 g/l neondensity 0.9002 g/l nitrogendensity 1.2506 g/l oxygendensity 1.429 g/l fluorinedensity 1.696 g/l argondensity 1.784 g/l chlorinedensity 3.2 g/l kryptondensity 3.749 g/l xenondensity 5.894 g/l radondensity 9.73 g/l # Density of liquid phase elements near room temperature brominedensity 3.1028 g/cm^3 mercurydensity 13.534 g/cm^3 # Density of solid elements near room temperature lithiumdensity 0.534 g/cm^3 potassiumdensity 0.862 g/cm^3 sodiumdensity 0.968 g/cm^3 rubidiumdensity 1.532 g/cm^3 calciumdensity 1.55 g/cm^3 magnesiumdensity 1.738 g/cm^3 phosphorus_white_density 1.823 g/cm^3 berylliumdensity 1.85 g/cm^3 sulfur_gamma_density 1.92 g/cm^3 cesiumdensity 1.93 g/cm^3 carbon_amorphous_density 1.95 g/cm^3 # average value sulfur_betadensity 1.96 g/cm^3 sulfur_alpha_density 2.07 g/cm^3 carbon_graphite_density 2.267 g/cm^3 phosphorus_red_density 2.27 g/cm^3 # average value silicondensity 2.3290 g/cm^3 phosphorus_violet_density 2.36 g/cm^3 borondensity 2.37 g/cm^3 strontiumdensity 2.64 g/cm^3 phosphorus_black_density 2.69 g/cm^3 aluminumdensity 2.7 g/cm^3 bariumdensity 3.51 g/cm^3 carbon_diamond_density 3.515 g/cm^3 scandiumdensity 3.985 g/cm^3 selenium_vitreous_density 4.28 g/cm^3 selenium_alpha_density 4.39 g/cm^3 titaniumdensity 4.406 g/cm^3 yttriumdensity 4.472 g/cm^3 selenium_gray_density 4.81 g/cm^3 iodinedensity 4.933 g/cm^3 europiumdensity 5.264 g/cm^3 germaniumdensity 5.323 g/cm^3 radiumdensity 5.5 g/cm^3 arsenicdensity 5.727 g/cm^3 tin_alpha_density 5.769 g/cm^3 galliumdensity 5.91 g/cm^3 vanadiumdensity 6.11 g/cm^3 lanthanumdensity 6.162 g/cm^3 telluriumdensity 6.24 g/cm^3 zirconiumdensity 6.52 g/cm^3 antimonydensity 6.697 g/cm^3 ceriumdensity 6.77 g/cm^3 praseodymiumdensity 6.77 g/cm^3 ytterbiumdensity 6.9 g/cm^3 neodymiumdensity 7.01 g/cm^3 zincdensity 7.14 g/cm^3 chromiumdensity 7.19 g/cm^3 manganesedensity 7.21 g/cm^3 promethiumdensity 7.26 g/cm^3 tin_beta_density 7.265 g/cm^3 indiumdensity 7.31 g/cm^3 samariumdensity 7.52 g/cm^3 irondensity 7.874 g/cm^3 gadoliniumdensity 7.9 g/cm^3 terbiumdensity 8.23 g/cm^3 dysprosiumdensity 8.54 g/cm^3 niobiumdensity 8.57 g/cm^3 cadmiumdensity 8.65 g/cm^3 holmiumdensity 8.79 g/cm^3 cobaltdensity 8.9 g/cm^3 nickeldensity 8.908 g/cm^3 erbiumdensity 9.066 g/cm^3 polonium_alpha_density 9.196 g/cm^3 thuliumdensity 9.32 g/cm^3 polonium_beta_density 9.398 g/cm^3 bismuthdensity 9.78 g/cm^3 lutetiumdensity 9.841 g/cm^3 actiniumdensity 10 g/cm^3 molybdenumdensity 10.28 g/cm^3 silverdensity 10.49 g/cm^3 technetiumdensity 11 g/cm^3 leaddensity 11.34 g/cm^3 thoriumdensity 11.7 g/cm^3 thalliumdensity 11.85 g/cm^3 americiumdensity 12 g/cm^3 palladiumdensity 12.023 g/cm^3 rhodiumdensity 12.41 g/cm^3 rutheniumdensity 12.45 g/cm^3 berkelium_beta_density 13.25 g/cm^3 hafniumdensity 13.31 g/cm^3 curiumdensity 13.51 g/cm^3 berkelium_alphadensity 14.78 g/cm^3 californiumdensity 15.1 g/cm^3 protactiniumdensity 15.37 g/cm^3 tantalumdensity 16.69 g/cm^3 uraniumdensity 19.1 g/cm^3 tungstendensity 19.3 g/cm^3 golddensity 19.30 g/cm^3 plutoniumdensity 19.816 g/cm^3 neptuniumdensity 20.45 g/cm^3 # alpha form, only one at room temp rheniumdensity 21.02 g/cm^3 platinumdensity 21.45 g/cm^3 iridiumdensity 22.56 g/cm^3 osmiumdensity 22.59 g/cm^3 # A few alternate names tin_gray tin_alpha_density tin_white tin_beta_density graphitedensity carbon_graphite_density diamonddensity carbon_diamond_density # Predicted density of elements that have not been made in sufficient # quantities for measurement. franciumdensity 2.48 g/cm^3 # liquid, predicted melting point 8 degC astatinedensity 6.35 g/cm^3 einsteiniumdensity 8.84 g/cm^3 fermiumdensity 9.7 g/cm^3 nobeliumdensity 9.9 g/cm^3 mendeleviumdensity 10.3 g/cm^3 lawrenciumdensity 16 g/cm^3 rutherfordiumdensity 23.2 g/cm^3 roentgeniumdensity 28.7 g/cm^3 dubniumdensity 29.3 g/cm^3 darmstadtiumdensity 34.8 g/cm^3 seaborgiumdensity 35 g/cm^3 bohriumdensity 37.1 g/cm^3 meitneriumdensity 37.4 g/cm^3 hassiumdensity 41 g/cm^3 # # population units # people 1 person people death people capita people percapita per capita # TGM dozen based unit system listed on the "dozenal" forum # http://www.dozenalsociety.org.uk/apps/tgm.htm. These units are # proposed as an allegedly more rational alternative to the SI system. Tim 12^-4 hour # Time Grafut gravity Tim^2 # Length based on gravity Surf Grafut^2 # area Volm Grafut^3 # volume Vlos Grafut/Tim # speed Denz Maz/Volm # density Mag Maz gravity # force Maz Volm kg / oldliter # mass based on water #gross conflict with terameter #Tm Tim # Abbreviations Gf Grafut Sf Surf Vm Volm Vl Vlos Mz Maz Dz Denz # Dozen based unit prefixes Zena- 12 Duna- 12^2 Trina- 12^3 Quedra- 12^4 Quena- 12^5 Hesa- 12^6 Seva- 12^7 Aka- 12^8 Neena- 12^9 Dexa- 12^10 Lefa- 12^11 Zennila- 12^12 Zeni- 12^-1 Duni- 12^-2 Trini- 12^-3 Quedri- 12^-4 Queni- 12^-5 Hesi- 12^-6 Sevi- 12^-7 Aki- 12^-8 Neeni- 12^-9 Dexi- 12^-10 Lefi- 12^-11 Zennili- 12^-12 # # Traditional Japanese units (shakkanhou) # # The traditional system of weights and measures is called shakkanhou from the # shaku and the ken. Japan accepted SI units in 1891 and legalized conversions # to the traditional system. In 1909 the inch-pound system was also legalized, # so Japan had three legally approved systems. A change to the metric system # started in 1921 but there was a lot of resistance. The Measurement Law of # October 1999 prohibits sales in anything but SI units. However, the old # units still live on in construction and as the basis for paper sizes of books # and tools used for handicrafts. # # Note that units below use the Hepburn romanization system. Some other # systems would render "mou", "jou", and "chou" as "mo", "jo" and "cho". # # # http://hiramatu-hifuka.com/onyak/onyindx.html # Japanese Proportions. These are still in everyday use. They also # get used as units to represent the proportion of the standard unit. wari_proportion 1|10 wari wari_proportion bu_proportion 1|100 # The character bu can also be read fun or bun # but usually "bu" is used for units. rin_proportion 1|1000 mou_proportion 1|10000 # Japanese Length Measures # # The length system is called kanejaku or # square and originated in China. It was # adopted as Japan's official measure in 701 # by the Taiho Code. This system is still in # common use in architecture and clothing. shaku 1|3.3 m mou 1|10000 shaku rin 1|1000 shaku bu_distance 1|100 shaku sun 1|10 shaku jou_distance 10 shaku jou jou_distance kanejakusun sun # Alias to emphasize architectural name kanejaku shaku kanejakujou jou # http://en.wikipedia.org/wiki/Taiwanese_units_of_measurement taichi shaku # http://zh.wikipedia.org/wiki/台尺 taicun sun # http://zh.wikipedia.org/wiki/台制 !utf8 台尺 taichi # via Hanyu Pinyin romanizations 台寸 taicun !endutf8 # In context of clothing, shaku is different from architecture # http://www.scinet.co.jp/sci/sanwa/kakizaki-essay54.html kujirajaku 10|8 shaku kujirajakusun 1|10 kujirajaku kujirajakubu 1|100 kujirajaku kujirajakujou 10 kujirajaku tan_distance 3 kujirajakujou ken 6 shaku # Also sometimes 6.3, 6.5, or 6.6 # http://www.homarewood.co.jp/syakusun.htm # mostly unused chou_distance 60 ken chou chou_distance ri 36 chou # Japanese Area Measures # Tsubo is still used for land size, though the others are more # recognized by their homonyms in the other measurements. gou_area 1|10 tsubo tsubo 36 shaku^2 # Size of two tatami = ken^2 ?? se 30 tsubo tan_area 10 se chou_area 10 tan_area # http://en.wikipedia.org/wiki/Taiwanese_units_of_measurement ping tsubo # http://zh.wikipedia.org/wiki/坪 jia 2934 ping # http://zh.wikipedia.org/wiki/甲_(单位) fen 1|10 jia # http://zh.wikipedia.org/wiki/分 fen_area 1|10 jia # Protection against future collisions !utf8 坪 ping # via Hanyu Pinyin romanizations 甲 jia 分 fen 分地 fen_area # Protection against future collisions !endutf8 # Japanese architecture is based on a "standard" size of tatami mat. # Room sizes today are given in number of tatami, and this number # determines the spacing between colums and hence sizes of sliding # doors and paper screens. However, every region has its own slightly # different tatami size. Edoma, used in and around Tokyo and # Hokkaido, is becoming a nationwide standard. Kyouma is used around # Kyoto, Osaka and Kyuushu, and Chuukyouma is used around Nagoya. # Note that the tatami all have the aspect ratio 2:1 so that the mats # can tile the room with some of them turned 90 degrees. # # http://www.moon2.net/tatami/infotatami/structure.html edoma (5.8*2.9) shaku^2 kyouma (6.3*3.15) shaku^2 chuukyouma (6*3) shaku^2 jou_area edoma tatami jou_area # Japanese Volume Measures # The "shou" is still used for such things as alcohol and seasonings. # Large quantities of paint are still purchased in terms of "to". shaku_volume 1|10 gou_volume gou_volume 1|10 shou gou gou_volume shou (4.9*4.9*2.7) sun^3 # The character shou which is # the same as masu refers to a # rectangular wooden cup used to # measure liquids and cereal. # Sake is sometimes served in a masu # Note that it happens to be # EXACTLY 7^4/11^3 liters. to 10 shou koku 10 to # No longer used; historically a measure of rice # Japanese Weight Measures # # http://wyoming.hp.infoseek.co.jp/zatugaku/zamoney.html # Not really used anymore. rin_weight 1|10 bu_weight bu_weight 1|10 monme fun 1|10 monme monme momme kin 160 monme kan 1000 monme kwan kan # This was the old pronounciation of the unit. # The old spelling persisted a few centuries # longer and was not changed until around # 1950. # http://en.wikipedia.org/wiki/Taiwanese_units_of_measurement # says: "Volume measure in Taiwan is largely metric". taijin kin # http://zh.wikipedia.org/wiki/台斤 tailiang 10 monme # http://zh.wikipedia.org/wiki/台斤 taiqian monme # http://zh.wikipedia.org/wiki/台制 !utf8 台斤 taijin # via Hanyu Pinyin romanizations 台兩 tailiang 台錢 taiqian !endutf8 # # Australian unit # australiasquare (10 ft)^2 # Used for house area # # A few German units as currently in use. # zentner 50 kg doppelzentner 2 zentner pfund 500 g # The klafter, which was used in central Europe, was derived from the span of # outstretched arms. # # https://en.wikipedia.org/wiki/Obsolete_Austrian_units_of_measurement # https://www.llv.li/files/abi/klafter-m2-en.pdf austriaklafter 1.89648384 m # Exact definition, 23 July 1871 austriafoot 1|6 austriaklafter prussiaklafter 1.88 m prussiafoot 1|6 prussiaklafter bavariaklafter 1.751155 m bavariafoot 1|6 bavariaklafter hesseklafter 2.5 m hessefoot 1|6 hesseklafter switzerlandklafter metricklafter switzerlandfoot 1|6 switzerlandklafter swissklafter switzerlandklafter swissfoot 1|6 swissklafter metricklafter 1.8 m austriayoke 8 austriaklafter * 200 austriaklafter liechtensteinsquareklafter 3.596652 m^2 # Used until 2017 to measure land area liechtensteinklafter sqrt(liechtensteinsquareklafter) # The klafter was also used to measure volume of wood, generally being a stack # of wood one klafter wide, one klafter long, with logs 3 feet (half a klafter) # in length prussiawoodklafter 0.5 prussiaklafter^3 austriawoodklafter 0.5 austriaklafter^3 festmeter m^3 # modern measure of wood, solid cube raummeter 0.7 festmeter # Air space between the logs, stacked schuettraummeter 0.65 raummeter # A cubic meter volume of split and cut schüttraummeter schuettraummeter# firewood in a loose, unordered # pile, not stacked. This is called # "tipped". # # Swedish (Sweden) pre-metric units of 1739. # The metric system was adopted in 1878. # https://sv.wikipedia.org/wiki/Verkm%C3%A5tt # verklinje 2.0618125 mm verktum 12 verklinje kvarter 6 verktum fot 2 kvarter aln 2 fot famn 3 aln # # Some traditional Russian measures # # If you would like to help expand this section and understand # cyrillic transliteration, let me know. These measures are meant to # reflect common usage, e.g. in translated literature. # dessiatine 2400 sazhen^2 # Land measure dessjatine dessiatine funt 409.51718 grams # similar to pound zolotnik 1|96 funt # used for precious metal measure pood 40 funt # common in agricultural measure arshin (2 + 1|3) feet sazhen 3 arshin # analogous to fathom verst 500 sazhen # of similar use to mile versta verst borderverst 1000 sazhen russianmile 7 verst # # Old French distance measures, from French Weights and Measures # Before the Revolution by Zupko # frenchfoot 144|443.296 m # pied de roi, the standard of Paris. pied frenchfoot # Half of the hashimicubit, frenchfeet frenchfoot # instituted by Charlemagne. frenchinch 1|12 frenchfoot # This exact definition comes from frenchthumb frenchinch # a law passed on 10 Dec 1799 which pouce frenchthumb # fixed the meter at # 3 frenchfeet + 11.296 lignes. frenchline 1|12 frenchinch # This is supposed to be the size ligne frenchline # of the average barleycorn frenchpoint 1|12 frenchline toise 6 frenchfeet arpent 180^2 pied^2 # The arpent is 100 square perches, # but the perche seems to vary a lot # and can be 18 feet, 20 feet, or 22 # feet. This measure was described # as being in common use in Canada in # 1934 (Websters 2nd). The value # given here is the Paris standard # arpent. frenchgrain 1|18827.15 kg # Weight of a wheat grain, hence # smaller than the British grain. frenchpound 9216 frenchgrain # # Before the Imperial Weights and Measures Act of 1824, various different # weights and measures were in use in different places. # # Scots linear measure scotsinch 1.00540054 UKinch scotslink 1|100 scotschain scotsfoot 12 scotsinch scotsfeet scotsfoot scotsell 37 scotsinch scotsfall 6 scotsell scotschain 4 scotsfall scotsfurlong 10 scotschain scotsmile 8 scotsfurlong # Scots area measure scotsrood 40 scotsfall^2 scotsacre 4 scotsrood # Irish linear measure irishinch UKinch irishpalm 3 irishinch irishspan 3 irishpalm irishfoot 12 irishinch irishfeet irishfoot irishcubit 18 irishinch irishyard 3 irishfeet irishpace 5 irishfeet irishfathom 6 irishfeet irishpole 7 irishyard # Only these values irishperch irishpole # are different from irishchain 4 irishperch # the British Imperial irishlink 1|100 irishchain # or English values for irishfurlong 10 irishchain # these lengths. irishmile 8 irishfurlong # # Irish area measure irishrood 40 irishpole^2 irishacre 4 irishrood # English wine capacity measures (Winchester measures) winepint 1|2 winequart winequart 1|4 winegallon winegallon 231 UKinch^3 # Sometimes called the Winchester Wine Gallon, # it was legalized in 1707 by Queen Anne, and # given the definition of 231 cubic inches. It # had been in use for a while as 8 pounds of wine # using a merchant's pound, but the definition of # the merchant's pound had become uncertain. A # pound of 15 tower ounces (6750 grains) had been # common, but then a pound of 15 troy ounces # (7200 grains) gained popularity. Because of # the switch in the value of the merchants pound, # the size of the wine gallon was uncertain in # the market, hence the official act in 1707. # The act allowed that a six inch tall cylinder # with a 7 inch diameter was a lawful wine # gallon. (This comes out to 230.9 in^3.) # Note also that in Britain a legal conversion # was established to the 1824 Imperial gallon # then taken as 277.274 in^3 so that the wine # gallon was 0.8331 imperial gallons. This is # 231.1 cubic inches (using the international # inch). winerundlet 18 winegallon winebarrel 31.5 winegallon winetierce 42 winegallon winehogshead 2 winebarrel winepuncheon 2 winetierce winebutt 2 winehogshead winepipe winebutt winetun 2 winebutt # English beer and ale measures used 1803-1824 and used for beer before 1688 beerpint 1|2 beerquart beerquart 1|4 beergallon beergallon 282 UKinch^3 beerbarrel 36 beergallon beerhogshead 1.5 beerbarrel # English ale measures used from 1688-1803 for both ale and beer alepint 1|2 alequart alequart 1|4 alegallon alegallon beergallon alebarrel 34 alegallon alehogshead 1.5 alebarrel # Scots capacity measure scotsgill 1|4 mutchkin mutchkin 1|2 choppin choppin 1|2 scotspint scotspint 1|2 scotsquart scotsquart 1|4 scotsgallon scotsgallon 827.232 UKinch^3 scotsbarrel 8 scotsgallon jug scotspint # Scots dry capacity measure scotswheatlippy 137.333 UKinch^3 # Also used for peas, beans, rye, salt scotswheatlippies scotswheatlippy scotswheatpeck 4 scotswheatlippy scotswheatfirlot 4 scotswheatpeck scotswheatboll 4 scotswheatfirlot scotswheatchalder 16 scotswheatboll scotsoatlippy 200.345 UKinch^3 # Also used for barley and malt scotsoatlippies scotsoatlippy scotsoatpeck 4 scotsoatlippy scotsoatfirlot 4 scotsoatpeck scotsoatboll 4 scotsoatfirlot scotsoatchalder 16 scotsoatboll # Scots Tron weight trondrop 1|16 tronounce tronounce 1|20 tronpound tronpound 9520 grain tronstone 16 tronpound # Irish liquid capacity measure irishnoggin 1|4 irishpint irishpint 1|2 irishquart irishquart 1|2 irishpottle irishpottle 1|2 irishgallon irishgallon 217.6 UKinch^3 irishrundlet 18 irishgallon irishbarrel 31.5 irishgallon irishtierce 42 irishgallon irishhogshead 2 irishbarrel irishpuncheon 2 irishtierce irishpipe 2 irishhogshead irishtun 2 irishpipe # Irish dry capacity measure irishpeck 2 irishgallon irishbushel 4 irishpeck irishstrike 2 irishbushel irishdrybarrel 2 irishstrike irishquarter 2 irishbarrel # English Tower weights, abolished in 1528 towerpound 5400 grain towerounce 1|12 towerpound towerpennyweight 1|20 towerounce towergrain 1|32 towerpennyweight # English Mercantile weights, used since the late 12th century mercpound 6750 grain mercounce 1|15 mercpound mercpennyweight 1|20 mercounce # English weights for lead leadstone 12.5 lb fotmal 70 lb leadwey 14 leadstone fothers 12 leadwey # English Hay measure newhaytruss 60 lb # New and old here seem to refer to "new" newhayload 36 newhaytruss # hay and "old" hay rather than a new unit oldhaytruss 56 lb # and an old unit. oldhayload 36 oldhaytruss # English wool measure woolclove 7 lb woolstone 2 woolclove wooltod 2 woolstone woolwey 13 woolstone woolsack 2 woolwey woolsarpler 2 woolsack woollast 6 woolsarpler # # Ancient history units: There tends to be uncertainty in the definitions # of the units in this section # These units are from [11] # Roman measure. The Romans had a well defined distance measure, but their # measures of weight were poor. They adopted local weights in different # regions without distinguishing among them so that there are half a dozen # different Roman "standard" weight systems. romanfoot 296 mm # There is some uncertainty in this definition romanfeet romanfoot # from which all the other units are derived. pes romanfoot # This value appears in numerous sources. In "The pedes romanfoot # Roman Land Surveyors", Dilke gives 295.7 mm. romaninch 1|12 romanfoot # The subdivisions of the Roman foot have the romandigit 1|16 romanfoot # same names as the subdivisions of the pound, romanpalm 1|4 romanfoot # but we can't have the names for different romancubit 18 romaninch # units. romanpace 5 romanfeet # Roman double pace (basic military unit) passus romanpace romanperch 10 romanfeet stade 125 romanpaces stadia stade stadium stade romanmile 8 stadia # 1000 paces romanleague 1.5 romanmile schoenus 4 romanmile # Other values for the Roman foot (from Dilke) earlyromanfoot 29.73 cm pesdrusianus 33.3 cm # or 33.35 cm, used in Gaul & Germany in 1st c BC lateromanfoot 29.42 cm # Roman areas actuslength 120 romanfeet # length of a Roman furrow actus 120*4 romanfeet^2 # area of the furrow squareactus 120^2 romanfeet^2 # actus quadratus acnua squareactus iugerum 2 squareactus iugera iugerum jugerum iugerum jugera iugerum heredium 2 iugera # heritable plot heredia heredium centuria 100 heredia centurium centuria # Roman volumes sextarius 35.4 in^3 # Basic unit of Roman volume. As always, sextarii sextarius # there is uncertainty. Six large Roman # measures survive with volumes ranging from # 34.4 in^3 to 39.55 in^3. Three of them # cluster around the size given here. # # But the values for this unit vary wildly # in other sources. One reference gives 0.547 # liters, but then says the amphora is a # cubic Roman foot. This gives a value for the # sextarius of 0.540 liters. And the # encyclopedia Britannica lists 0.53 liters for # this unit. Both [7] and [11], which were # written by scholars of weights and measures, # give the value of 35.4 cubic inches. cochlearia 1|48 sextarius cyathi 1|12 sextarius acetabula 1|8 sextarius quartaria 1|4 sextarius quartarius quartaria heminae 1|2 sextarius hemina heminae cheonix 1.5 sextarii # Dry volume measures (usually) semodius 8 sextarius semodii semodius modius 16 sextarius modii modius # Liquid volume measures (usually) congius 12 heminae congii congius amphora 8 congii amphorae amphora # Also a dry volume measure culleus 20 amphorae quadrantal amphora # Roman weights libra 5052 grain # The Roman pound varied significantly librae libra # from 4210 grains to 5232 grains. Most of romanpound libra # the standards were obtained from the weight uncia 1|12 libra # of particular coins. The one given here is unciae uncia # based on the Gold Aureus of Augustus which romanounce uncia # was in use from BC 27 to AD 296. deunx 11 uncia dextans 10 uncia dodrans 9 uncia bes 8 uncia seprunx 7 uncia semis 6 uncia quincunx 5 uncia triens 4 uncia quadrans 3 uncia sextans 2 uncia sescuncia 1.5 uncia semuncia 1|2 uncia siscilius 1|4 uncia sextula 1|6 uncia semisextula 1|12 uncia scriptulum 1|24 uncia scrupula scriptulum romanobol 1|2 scrupula romanaspound 4210 grain # Old pound based on bronze coinage, the # earliest money of Rome BC 338 to BC 268. # Egyptian length measure egyptianroyalcubit 20.63 in # plus or minus .2 in egyptianpalm 1|7 egyptianroyalcubit egyptiandigit 1|4 egyptianpalm egyptianshortcubit 6 egyptianpalm doubleremen 29.16 in # Length of the diagonal of a square with remendigit 1|40 doubleremen # side length of 1 royal egyptian cubit. # This is divided into 40 digits which are # not the same size as the digits based on # the royal cubit. # Greek length measures greekfoot 12.45 in # Listed as being derived from the greekfeet greekfoot # Egyptian Royal cubit in [11]. It is greekcubit 1.5 greekfoot # said to be 3|5 of a 20.75 in cubit. pous greekfoot podes greekfoot orguia 6 greekfoot greekfathom orguia stadion 100 orguia akaina 10 greekfeet plethron 10 akaina greekfinger 1|16 greekfoot homericcubit 20 greekfingers # Elbow to end of knuckles. shortgreekcubit 18 greekfingers # Elbow to start of fingers. ionicfoot 296 mm doricfoot 326 mm olympiccubit 25 remendigit # These olympic measures were not as olympicfoot 2|3 olympiccubit # common as the other greek measures. olympicfinger 1|16 olympicfoot # They were used in agriculture. olympicfeet olympicfoot olympicdakylos olympicfinger olympicpalm 1|4 olympicfoot olympicpalestra olympicpalm olympicspithame 3|4 foot olympicspan olympicspithame olympicbema 2.5 olympicfeet olympicpace olympicbema olympicorguia 6 olympicfeet olympicfathom olympicorguia olympiccord 60 olympicfeet olympicamma olympiccord olympicplethron 100 olympicfeet olympicstadion 600 olympicfeet # Greek capacity measure greekkotyle 270 ml # This approximate value is obtained xestes 2 greekkotyle # from two earthenware vessels that khous 12 greekkotyle # were reconstructed from fragments. metretes 12 khous # The kotyle is a day's corn ration choinix 4 greekkotyle # for one man. hekteos 8 choinix medimnos 6 hekteos # Greek weight. Two weight standards were used, an Aegina standard based # on the Beqa shekel and an Athens (attic) standard. aeginastater 192 grain # Varies up to 199 grain aeginadrachmae 1|2 aeginastater aeginaobol 1|6 aeginadrachmae aeginamina 50 aeginastaters aeginatalent 60 aeginamina # Supposedly the mass of a cubic foot # of water (whichever foot was in use) atticstater 135 grain # Varies 134-138 grain atticdrachmae 1|2 atticstater atticobol 1|6 atticdrachmae atticmina 50 atticstaters attictalent 60 atticmina # Supposedly the mass of a cubic foot # of water (whichever foot was in use) # "Northern" cubit and foot. This was used by the pre-Aryan civilization in # the Indus valley. It was used in Mesopotamia, Egypt, North Africa, China, # central and Western Europe until modern times when it was displaced by # the metric system. northerncubit 26.6 in # plus/minus .2 in northernfoot 1|2 northerncubit sumeriancubit 495 mm kus sumeriancubit sumerianfoot 2|3 sumeriancubit assyriancubit 21.6 in assyrianfoot 1|2 assyriancubit assyrianpalm 1|3 assyrianfoot assyriansusi 1|20 assyrianpalm susi assyriansusi persianroyalcubit 7 assyrianpalm # Arabic measures. The arabic standards were meticulously kept. Glass weights # accurate to .2 grains were made during AD 714-900. hashimicubit 25.56 in # Standard of linear measure used # in Persian dominions of the Arabic # empire 7-8th cent. Is equal to two # French feet. blackcubit 21.28 in arabicfeet 1|2 blackcubit arabicfoot arabicfeet arabicinch 1|12 arabicfoot arabicmile 4000 blackcubit silverdirhem 45 grain # The weights were derived from these two tradedirhem 48 grain # units with two identically named systems # used for silver and used for trade purposes silverkirat 1|16 silverdirhem silverwukiyeh 10 silverdirhem silverrotl 12 silverwukiyeh arabicsilverpound silverrotl tradekirat 1|16 tradedirhem tradewukiyeh 10 tradedirhem traderotl 12 tradewukiyeh arabictradepound traderotl # Miscellaneous ancient units parasang 3.5 mile # Persian unit of length usually thought # to be between 3 and 3.5 miles biblicalcubit 21.8 in hebrewcubit 17.58 in li 10|27.8 mile # Chinese unit of length # 100 li is considered a day's march liang 11|3 oz # Chinese weight unit # Medieval time units. According to the OED, these appear in Du Cange # by Papias. timepoint 1|5 hour # also given as 1|4 timeminute 1|10 hour timeostent 1|60 hour timeounce 1|8 timeostent timeatom 1|47 timeounce # Given in [15], these subdivisions of the grain were supposedly used # by jewelers. The mite may have been used but the blanc could not # have been accurately measured. mite 1|20 grain droit 1|24 mite periot 1|20 droit blanc 1|24 periot # # Localization # !var UNITS_ENGLISH US hundredweight ushundredweight ton uston scruple apscruple fluidounce usfluidounce #gallon usgallon bushel usbushel quarter quarterweight cup uscup tablespoon ustablespoon teaspoon usteaspoon dollar US$ cent $ 0.01 penny cent minim minimvolume pony ponyvolume grand usgrand firkin usfirkin hogshead ushogshead !endvar !var UNITS_ENGLISH GB hundredweight brhundredweight ton brton scruple brscruple fluidounce brfluidounce gallon brgallon bushel brbushel quarter brquarter chaldron brchaldron cup brcup teacup brteacup tablespoon brtablespoon teaspoon brteaspoon dollar US$ cent $ 0.01 penny brpenny minim minimnote pony brpony grand brgrand firkin brfirkin hogshead brhogshead !endvar !varnot UNITS_ENGLISH GB US !message Unknown value for environment variable UNITS_ENGLISH. Should be GB or US. !endvar !utf8 ⅛- 1|8 ¼- 1|4 ⅜- 3|8 ½- 1|2 ⅝- 5|8 ¾- 3|4 ⅞- 7|8 ⅙- 1|6 ⅓- 1|3 ⅔- 2|3 ⅚- 5|6 ⅕- 1|5 ⅖- 2|5 ⅗- 3|5 ⅘- 4|5 # U+2150- 1|7 For some reason these characters are getting # U+2151- 1|9 flagged as invalid UTF8. # U+2152- 1|10 #⅐- 1|7 # fails under MacOS #⅑- 1|9 # fails under MacOS #⅒- 1|10 # fails under MacOS ℯ exp(1) # U+212F, base of natural log µ- micro # micro sign U+00B5 μ- micro # small mu U+03BC ångström angstrom Å angstrom # angstrom symbol U+212B Å angstrom # A with ring U+00C5 röntgen roentgen °C degC °F degF °K K # °K is incorrect notation °R degR ° degree ℃ degC ℉ degF K K # Kelvin symbol, U+212A ℓ liter # unofficial abbreviation used in some places Ω ohm # Ohm symbol U+2126 Ω ohm # Greek capital omega U+03A9 ℧ mho ʒ dram # U+0292 ℈ scruple ℥ ounce ℔ lb ℎ h ℏ hbar τ tau π pi # Greek letter pi 𝜋 pi # mathematical italic small pi α alpha σ sigma ‰ 1|1000 ‱ 1|10000 ′ ' # U+2032 ″ " # U+2033 # # Unicode currency symbols # ¢ cent £ britainpound ¥ japanyen € euro ₩ southkoreawon ₪ israelnewshekel ₤ lira # ₺ turkeylira # fails under MacOS ₨ rupee # unofficial legacy rupee sign # ₹ indiarupee # official rupee sign # MacOS fail #؋ afghanafghani # fails under MacOS ฿ thailandbaht ₡ elsalvadorcolon # Also costaricacolon ₣ francefranc ₦ nigerianaira ₧ spainpeseta ₫ vietnamdong ₭ laokip ₮ mongoliatugrik ₯ greecedrachma ₱ philippinepeso # ₲ paraguayguarani # fails under MacOS #₴ ukrainehryvnia # fails under MacOS #₵ ghanacedi # fails under MacOS #₸ kazakhstantenge # fails under MacOS #₼ azerbaijanmanat # fails under MacOS #₽ russiaruble # fails under MacOS #₾ georgialari # fails under MacOS ﷼ iranrial ﹩ $ ¢ ¢ £ £ ¥ ¥ ₩ ₩ # # Square Unicode symbols starting at U+3371 # ㍱ hPa ㍲ da ㍳ au ㍴ bar # ㍵ oV??? ㍶ pc #㍷ dm invalid on Mac #㍸ dm^2 invalid on Mac #㍹ dm^3 invalid on Mac ㎀ pA ㎁ nA ㎂ µA ㎃ mA ㎄ kA ㎅ kB ㎆ MB ㎇ GB ㎈ cal ㎉ kcal ㎊ pF ㎋ nF ㎌ µF ㎍ µg ㎎ mg ㎏ kg ㎐ Hz ㎑ kHz ㎒ MHz ㎓ GHz ㎔ THz ㎕ µL ㎖ mL ㎗ dL ㎘ kL ㎙ fm ㎚ nm ㎛ µm ㎜ mm ㎝ cm ㎞ km ㎟ mm^2 ㎠ cm^2 ㎡ m^2 ㎢ km^2 ㎣ mm^3 ㎤ cm^3 ㎥ m^3 ㎦ km^3 ㎧ m/s ㎨ m/s^2 ㎩ Pa ㎪ kPa ㎫ MPa ㎬ GPa ㎭ rad ㎮ rad/s ㎯ rad/s^2 ㎰ ps ㎱ ns ㎲ µs ㎳ ms ㎴ pV ㎵ nV ㎶ µV ㎷ mV ㎸ kV ㎹ MV ㎺ pW ㎻ nW ㎼ µW ㎽ mW ㎾ kW ㎿ MW ㏀ kΩ ㏁ MΩ ㏃ Bq ㏄ cc ㏅ cd ㏆ C/kg ㏈() dB ㏉ Gy ㏊ ha # ㏋ HP?? ㏌ in # ㏍ KK?? # ㏎ KM??? ㏏ kt ㏐ lm # ㏑ ln # ㏒ log ㏓ lx ㏔ mb ㏕ mil ㏖ mol ㏗() pH ㏙ ppm # ㏚ PR??? ㏛ sr ㏜ Sv ㏝ Wb #㏞ V/m Invalid on Mac #㏟ A/m Invalid on Mac #㏿ gal Invalid on Mac !endutf8 ############################################################################ # # Unit list aliases # # These provide a shorthand for conversions to unit lists. # ############################################################################ !unitlist hms hr;min;sec !unitlist time year;day;hr;min;sec !unitlist dms deg;arcmin;arcsec !unitlist ftin ft;in;1|8 in !unitlist inchfine in;1|8 in;1|16 in;1|32 in;1|64 in !unitlist usvol cup;3|4 cup;2|3 cup;1|2 cup;1|3 cup;1|4 cup;\ tbsp;tsp;1|2 tsp;1|4 tsp;1|8 tsp ############################################################################ # # The following units were in the Unix units database but do not appear in # this file: # # wey used for cheese, salt and other goods. Measured mass or # waymass volume depending on what was measured and where the measuring # took place. A wey of cheese ranged from 200 to 324 pounds. # # sack No precise definition # # spindle The length depends on the type of yarn # # block Defined variously on different computer systems # # erlang A unit of telephone traffic defined variously. # Omitted because there are no other units for this # dimension. Is this true? What about CCS = 1/36 erlang? # Erlang is supposed to be dimensionless. One erlang means # a single channel occupied for one hour. # ############################################################################ # # The following have been suggested or considered and deemed out of scope. # They will not be added to GNU units. # # Conversions between different calendar systems used in different countries or # different historical periods are out of scope for units and will not be added. # # Wind chill and heat index cannot be handled because they are bivarite, # with dependence on both the temperature and wind speed or humidity. # # Plain english text output like "one hectare is equivalent to one hundred # million square centimeters" is out of scope. # postgresql-unit-7.8/definitions.unresolved000066400000000000000000000060471450213077700212100ustar00rootroot00000000000000MONEY US$ normaltemp tempF(70) normtemp normaltemp sqrt_cm sqrt_cm sqrt_centimeter sqrt_cm sqrt_g sqrt_g sqrt_gram sqrt_g S10 SB_degree(10) buck US$ fin 5 US$ sawbuck 10 US$ usgrand 1000 US$ greenback US$ count per pound diamond_natural_thermal_conductivity 2200 W / m K diamond_synthetic_thermal_conductivity 3320 W / m K stainless_304_thermal_conductivity 15.5 W / m K ipv4classA ipv4subnetsize(8) ipv4classB ipv4subnetsize(16) ipv4classC ipv4subnetsize(24) semitone octave^(1|12) wholenote wholenote MUSICAL_NOTE_LENGTH wholenote halfnote 1|2 wholenote quarternote 1|4 wholenote eighthnote 1|8 wholenote sixteenthnote 1|16 wholenote thirtysecondnote 1|32 wholenote sixtyfourthnote 1|64 wholenote breve doublewholenote semibreve wholenote minimnote halfnote crotchet quarternote quaver eighthnote semiquaver sixteenthnote demisemiquaver thirtysecondnote hemidemisemiquaver sixtyfourthnote semidemisemiquaver hemidemisemiquaver unitedstatesdollar US$ usdollar US$ $ dollar mark germanymark peseta spainpeseta rand southafricarand escudo portugalescudo guilder netherlandsguilder hollandguilder netherlandsguilder peso mexicopeso yen japanyen lira turkeylira rupee indiarupee drachma greecedrachma franc francefranc markka finlandmarkka britainpound unitedkingdompound greatbritainpound unitedkingdompound unitedkingdompound ukpound poundsterling britainpound yuan chinayuan icelandkróna icelandkrona polandzłoty polandzloty tongapa’anga tongapa'anga vietnamđồng vietnamdong mongoliatögrög mongoliatugrik sãotomé&príncipedobra saotome&principedobra UKP GBP olddollargold 23.22 grains goldprice newdollargold 96|7 grains goldprice dollargold newdollargold poundgold 113 grains goldprice goldounce goldprice troyounce silverounce silverprice troyounce platinumounce platinumprice troyounce XAU goldounce XPT platinumounce XAG silverounce USdimeweight US$ 0.10 / (20 US$ / lb) USquarterweight US$ 0.25 / (20 US$ / lb) UShalfdollarweight US$ 0.50 / (20 US$ / lb) quid britainpound fiver 5 quid tenner 10 quid monkey 500 quid brgrand 1000 quid bob shilling shilling 1|20 britainpound oldpence 1|12 shilling farthing 1|4 oldpence guinea 21 shilling crown 5 shilling florin 2 shilling groat 4 oldpence tanner 6 oldpence brpenny 0.01 britainpound pence brpenny tuppence 2 pence tuppenny tuppence ha'penny halfbrpenny hapenny ha'penny oldpenny oldpence oldtuppence 2 oldpence oldtuppenny oldtuppence threepence 3 oldpence threepenny threepence oldthreepence threepence oldthreepenny threepence oldhalfpenny halfoldpenny oldha'penny oldhalfpenny oldhapenny oldha'penny brpony 25 britainpound loony 1 canadadollar toony 2 canadadollar satoshi 1e-8 bitcoin XBT bitcoin brmgd mega brgallon/day usmgd mega usgallon/day percapita per capita dollar US$ cent $ 0.01 penny cent grand usgrand π pi ¢ cent £ britainpound ¥ japanyen € euro ₩ southkoreawon ₪ israelnewshekel ₤ lira ₨ rupee ฿ thailandbaht ₡ elsalvadorcolon ₣ francefranc ₦ nigerianaira ₧ spainpeseta ₫ vietnamdong ₭ laokip ₮ mongoliatugrik ₯ greecedrachma ₱ philippinepeso ﷼ iranrial ﹩ $ ¢ ¢ £ £ ¥ ¥ ₩ ₩ postgresql-unit-7.8/do000077500000000000000000000011421450213077700151040ustar00rootroot00000000000000#!/bin/bash set -eux export PGDATABASE=postgres for PGVERSION in ${*:-15 14 13 12 11 10 9.6 9.5}; do echo echo "### $PGVERSION ###" PG_CONFIG=/usr/lib/postgresql/$PGVERSION/bin/pg_config export PGCLUSTER="$PGVERSION/main" export PGPORT="54${PGVERSION/./}" [ "$PGVERSION" = "15" ] && unset PGPORT # default version make clean make PG_CONFIG=$PG_CONFIG PROFILE="-Werror" sudo make install PG_CONFIG=$PG_CONFIG psql -c "DROP EXTENSION IF EXISTS unit CASCADE" if ! make installcheck REGRESS_OPTS="--use-existing --dbname=postgres" PG_CONFIG=$PG_CONFIG; then cat regression.diffs exit 1 fi done postgresql-unit-7.8/dump-units.sh000077500000000000000000000006241450213077700172240ustar00rootroot00000000000000#!/bin/sh # output intentionally not ordered so the initial load order from definitions.units is preserved psql <<-EOT SET extra_float_digits = 3; SET unit.output_base_units = on; \copy (SELECT prefix, factor, definition, dump FROM unit_prefixes ORDER BY ordering) to 'unit_prefixes.data' \copy (SELECT name, unit, shift, definition, dump FROM unit_units ORDER BY ordering) to 'unit_units.data' EOT postgresql-unit-7.8/expected/000077500000000000000000000000001450213077700163575ustar00rootroot00000000000000postgresql-unit-7.8/expected/aggregate.out000066400000000000000000000162541450213077700210460ustar00rootroot00000000000000-- test aggregates /* revert to pre-12 default for stddev(value()) tests */ SET extra_float_digits = 0; CREATE TEMP TABLE u ( u unit ); -- empty SELECT sum(u) AS null_sum FROM u; null_sum ---------- (1 row) SELECT min(u) AS null_min FROM u; null_min ---------- (1 row) SELECT max(u) AS null_max FROM u; null_max ---------- (1 row) SELECT avg(u) AS null_avg FROM u; null_avg ---------- (1 row) SELECT var_pop(u) AS null_var_pop FROM u; null_var_pop -------------- (1 row) SELECT var_samp(u) AS null_var_samp FROM u; null_var_samp --------------- (1 row) SELECT variance(u) AS null_variance FROM u; null_variance --------------- (1 row) SELECT stddev_pop(u) AS null_stddev_pop FROM u; null_stddev_pop ----------------- (1 row) SELECT stddev_samp(u) AS null_stddev_samp FROM u; null_stddev_samp ------------------ (1 row) SELECT stddev(u) AS null_stddev FROM u; null_stddev ------------- (1 row) -- one NULL row INSERT INTO u VALUES (NULL); SELECT sum(u) AS null_sum FROM u; null_sum ---------- (1 row) SELECT min(u) AS null_min FROM u; null_min ---------- (1 row) SELECT max(u) AS null_max FROM u; null_max ---------- (1 row) SELECT avg(u) AS null_avg FROM u; null_avg ---------- (1 row) SELECT var_pop(u) AS null_var_pop FROM u; null_var_pop -------------- (1 row) SELECT var_samp(u) AS null_var_samp FROM u; null_var_samp --------------- (1 row) SELECT variance(u) AS null_variance FROM u; null_variance --------------- (1 row) SELECT stddev_pop(u) AS null_stddev_pop FROM u; null_stddev_pop ----------------- (1 row) SELECT stddev_samp(u) AS null_stddev_samp FROM u; null_stddev_samp ------------------ (1 row) SELECT stddev(u) AS null_stddev FROM u; null_stddev ------------- (1 row) -- one non-NULL row DELETE FROM u; INSERT INTO u VALUES (meter(5)); SELECT sum(u) AS five_meters FROM u; five_meters ------------- 5 m (1 row) SELECT min(u) AS five_meters FROM u; five_meters ------------- 5 m (1 row) SELECT max(u) AS five_meters FROM u; five_meters ------------- 5 m (1 row) SELECT avg(u) AS five_meters FROM u; five_meters ------------- 5 m (1 row) SELECT var_pop(u) AS zero_var_pop FROM u; zero_var_pop -------------- 0 (1 row) SELECT var_samp(u) AS zero_var_samp FROM u; zero_var_samp --------------- 0 (1 row) SELECT variance(u) AS zero_variance FROM u; zero_variance --------------- 0 (1 row) SELECT stddev_pop(u) AS zero_stddev_pop FROM u; zero_stddev_pop ----------------- 0 m (1 row) SELECT stddev_samp(u) AS zero_stddev_samp FROM u; zero_stddev_samp ------------------ 0 m (1 row) SELECT stddev(u) AS zero_stddev FROM u; zero_stddev ------------- 0 m (1 row) -- two rows, matching dimensions DELETE FROM u; INSERT INTO u VALUES (meter()), (meter(2)); SELECT sum(u) AS three_meters FROM u; three_meters -------------- 3 m (1 row) SELECT min(u) AS one_meter FROM u; one_meter ----------- 1 m (1 row) SELECT max(u) AS two_meters FROM u; two_meters ------------ 2 m (1 row) SELECT avg(u) AS oneandhalf_meters FROM u; oneandhalf_meters ------------------- 1.5 m (1 row) SELECT var_pop(u) FROM u; var_pop --------- 0.25 (1 row) SELECT var_samp(u) FROM u; var_samp ---------- 0.5 (1 row) SELECT variance(u) FROM u; variance ---------- 0.5 (1 row) SELECT stddev_pop(u) FROM u; stddev_pop ------------ 500 mm (1 row) SELECT stddev_samp(u) FROM u; stddev_samp --------------------- 707.106781186548 mm (1 row) SELECT stddev(u) FROM u; stddev --------------------- 707.106781186548 mm (1 row) DELETE FROM u; INSERT INTO u VALUES (kilogram(2)), (kilogram()); SELECT sum(u), sum(value(u)) FROM u; sum | sum ------+----- 3 kg | 3 (1 row) SELECT min(u), min(value(u)) FROM u; min | min ------+----- 1 kg | 1 (1 row) SELECT max(u), max(value(u)) FROM u; max | max ------+----- 2 kg | 2 (1 row) SELECT avg(u), avg(value(u)) FROM u; avg | avg --------+----- 1.5 kg | 1.5 (1 row) SELECT var_pop(u), var_pop(value(u)) FROM u; var_pop | var_pop ---------+--------- 0.25 | 0.25 (1 row) SELECT var_samp(u), var_samp(value(u)) FROM u; var_samp | var_samp ----------+---------- 0.5 | 0.5 (1 row) SELECT variance(u), variance(value(u)) FROM u; variance | variance ----------+---------- 0.5 | 0.5 (1 row) SELECT stddev_pop(u), stddev_pop(value(u)) FROM u; stddev_pop | stddev_pop ------------+------------ 500 g | 0.5 (1 row) SELECT stddev_samp(u), stddev_samp(value(u)) FROM u; stddev_samp | stddev_samp --------------------+------------------- 707.106781186548 g | 0.707106781186548 (1 row) SELECT stddev(u), stddev(value(u)) FROM u; stddev | stddev --------------------+------------------- 707.106781186548 g | 0.707106781186548 (1 row) -- three rows, one NULL INSERT INTO u VALUES (NULL); SELECT sum(u) AS three_kilogram FROM u; three_kilogram ---------------- 3 kg (1 row) SELECT min(u) AS one_kilogram FROM u; one_kilogram -------------- 1 kg (1 row) SELECT max(u) AS two_kilogram FROM u; two_kilogram -------------- 2 kg (1 row) SELECT avg(u) AS oneandhalf_kilogram FROM u; oneandhalf_kilogram --------------------- 1.5 kg (1 row) SELECT var_pop(u) FROM u; var_pop --------- 0.25 (1 row) SELECT var_samp(u) FROM u; var_samp ---------- 0.5 (1 row) SELECT variance(u) FROM u; variance ---------- 0.5 (1 row) SELECT stddev_pop(u) FROM u; stddev_pop ------------ 500 g (1 row) SELECT stddev_samp(u) FROM u; stddev_samp -------------------- 707.106781186548 g (1 row) SELECT stddev(u) FROM u; stddev -------------------- 707.106781186548 g (1 row) -- two rows, dimension mismatch DELETE FROM u; INSERT INTO u VALUES (ampere()), (kilogram(2)); SELECT sum(u) AS error FROM u; ERROR: dimension mismatch in "+" operation: "1 A", "2 kg" SELECT min(u) AS error FROM u; ERROR: dimension mismatch in "unit_least" operation: "1 A", "2 kg" SELECT max(u) AS error FROM u; ERROR: dimension mismatch in "unit_greatest" operation: "1 A", "2 kg" SELECT avg(u) AS error FROM u; ERROR: dimension mismatch in "+" operation: "1 A", "2 kg" CONTEXT: SQL function "unit_accum" statement 1 SELECT var_pop(u) AS error FROM u; ERROR: dimension mismatch in "+" operation: "1 A", "2 kg" CONTEXT: SQL function "unit_accum" statement 1 SELECT var_samp(u) AS error FROM u; ERROR: dimension mismatch in "+" operation: "1 A", "2 kg" CONTEXT: SQL function "unit_accum" statement 1 SELECT variance(u) AS error FROM u; ERROR: dimension mismatch in "+" operation: "1 A", "2 kg" CONTEXT: SQL function "unit_accum" statement 1 SELECT stddev_pop(u) AS error FROM u; ERROR: dimension mismatch in "+" operation: "1 A", "2 kg" CONTEXT: SQL function "unit_accum" statement 1 SELECT stddev_samp(u) AS error FROM u; ERROR: dimension mismatch in "+" operation: "1 A", "2 kg" CONTEXT: SQL function "unit_accum" statement 1 SELECT stddev(u) AS error FROM u; ERROR: dimension mismatch in "+" operation: "1 A", "2 kg" CONTEXT: SQL function "unit_accum" statement 1 postgresql-unit-7.8/expected/binary.out000066400000000000000000000027431450213077700204020ustar00rootroot00000000000000SELECT unit_send('0'); unit_send ------------------------------------ \x00000000000000000000000000000000 (1 row) SELECT unit_send(-'0'::unit); unit_send ------------------------------------ \x80000000000000000000000000000000 (1 row) SELECT unit_send('1 m'::unit); unit_send ------------------------------------ \x3ff00000000000000100000000000000 (1 row) SELECT unit_send('1 kg^-1'::unit); unit_send ------------------------------------ \x3ff000000000000000ff000000000000 (1 row) SELECT unit_send('1 s'::unit); unit_send ------------------------------------ \x3ff00000000000000000010000000000 (1 row) SELECT unit_send('1 A^-1'::unit); unit_send ------------------------------------ \x3ff0000000000000000000ff00000000 (1 row) SELECT unit_send('1 K'::unit); unit_send ------------------------------------ \x3ff00000000000000000000001000000 (1 row) SELECT unit_send('1 mol^-1'::unit); unit_send ------------------------------------ \x3ff00000000000000000000000ff0000 (1 row) SELECT unit_send('1 cd'::unit); unit_send ------------------------------------ \x3ff00000000000000000000000000100 (1 row) SELECT unit_send('1 B^-1'::unit); unit_send ------------------------------------ \x3ff000000000000000000000000000ff (1 row) postgresql-unit-7.8/expected/compare.out000066400000000000000000000212171450213077700205410ustar00rootroot00000000000000-- test comparisons WITH v(u) AS (VALUES (NULL), ('-2'::unit), ('-1'::unit), ('-0'::unit), ('0'::unit), ('1'::unit), ('2'::unit), (meter()), (meter() * '2'), (kilogram()), (kilogram() * '2') ), va(a) AS (SELECT * FROM v), vb(b) AS (SELECT * FROM v) SELECT a, b, CASE WHEN unit_cmp(a, b) < 0 THEN '<' WHEN unit_cmp(a, b) = 0 THEN '=' WHEN unit_cmp(a, b) > 0 THEN '>' END AS cmp, a < b AS lt, a <= b AS le, a = b AS eq, a <> b AS ne, a >= b AS ge, a > b AS gt FROM va CROSS JOIN vb; a | b | cmp | lt | le | eq | ne | ge | gt ------+------+-----+----+----+----+----+----+---- | | | | | | | | | -2 | | | | | | | | -1 | | | | | | | | -0 | | | | | | | | 0 | | | | | | | | 1 | | | | | | | | 2 | | | | | | | | 1 m | | | | | | | | 2 m | | | | | | | | 1 kg | | | | | | | | 2 kg | | | | | | | -2 | | | | | | | | -2 | -2 | = | f | t | t | f | t | f -2 | -1 | < | t | t | f | t | f | f -2 | -0 | < | t | t | f | t | f | f -2 | 0 | < | t | t | f | t | f | f -2 | 1 | < | t | t | f | t | f | f -2 | 2 | < | t | t | f | t | f | f -2 | 1 m | < | t | t | f | t | f | f -2 | 2 m | < | t | t | f | t | f | f -2 | 1 kg | < | t | t | f | t | f | f -2 | 2 kg | < | t | t | f | t | f | f -1 | | | | | | | | -1 | -2 | > | f | f | f | t | t | t -1 | -1 | = | f | t | t | f | t | f -1 | -0 | < | t | t | f | t | f | f -1 | 0 | < | t | t | f | t | f | f -1 | 1 | < | t | t | f | t | f | f -1 | 2 | < | t | t | f | t | f | f -1 | 1 m | < | t | t | f | t | f | f -1 | 2 m | < | t | t | f | t | f | f -1 | 1 kg | < | t | t | f | t | f | f -1 | 2 kg | < | t | t | f | t | f | f -0 | | | | | | | | -0 | -2 | > | f | f | f | t | t | t -0 | -1 | > | f | f | f | t | t | t -0 | -0 | = | f | t | t | f | t | f -0 | 0 | = | f | t | t | f | t | f -0 | 1 | < | t | t | f | t | f | f -0 | 2 | < | t | t | f | t | f | f -0 | 1 m | < | t | t | f | t | f | f -0 | 2 m | < | t | t | f | t | f | f -0 | 1 kg | < | t | t | f | t | f | f -0 | 2 kg | < | t | t | f | t | f | f 0 | | | | | | | | 0 | -2 | > | f | f | f | t | t | t 0 | -1 | > | f | f | f | t | t | t 0 | -0 | = | f | t | t | f | t | f 0 | 0 | = | f | t | t | f | t | f 0 | 1 | < | t | t | f | t | f | f 0 | 2 | < | t | t | f | t | f | f 0 | 1 m | < | t | t | f | t | f | f 0 | 2 m | < | t | t | f | t | f | f 0 | 1 kg | < | t | t | f | t | f | f 0 | 2 kg | < | t | t | f | t | f | f 1 | | | | | | | | 1 | -2 | > | f | f | f | t | t | t 1 | -1 | > | f | f | f | t | t | t 1 | -0 | > | f | f | f | t | t | t 1 | 0 | > | f | f | f | t | t | t 1 | 1 | = | f | t | t | f | t | f 1 | 2 | < | t | t | f | t | f | f 1 | 1 m | < | t | t | f | t | f | f 1 | 2 m | < | t | t | f | t | f | f 1 | 1 kg | < | t | t | f | t | f | f 1 | 2 kg | < | t | t | f | t | f | f 2 | | | | | | | | 2 | -2 | > | f | f | f | t | t | t 2 | -1 | > | f | f | f | t | t | t 2 | -0 | > | f | f | f | t | t | t 2 | 0 | > | f | f | f | t | t | t 2 | 1 | > | f | f | f | t | t | t 2 | 2 | = | f | t | t | f | t | f 2 | 1 m | > | f | f | f | t | t | t 2 | 2 m | < | t | t | f | t | f | f 2 | 1 kg | > | f | f | f | t | t | t 2 | 2 kg | < | t | t | f | t | f | f 1 m | | | | | | | | 1 m | -2 | > | f | f | f | t | t | t 1 m | -1 | > | f | f | f | t | t | t 1 m | -0 | > | f | f | f | t | t | t 1 m | 0 | > | f | f | f | t | t | t 1 m | 1 | > | f | f | f | t | t | t 1 m | 2 | < | t | t | f | t | f | f 1 m | 1 m | = | f | t | t | f | t | f 1 m | 2 m | < | t | t | f | t | f | f 1 m | 1 kg | > | f | f | f | t | t | t 1 m | 2 kg | < | t | t | f | t | f | f 2 m | | | | | | | | 2 m | -2 | > | f | f | f | t | t | t 2 m | -1 | > | f | f | f | t | t | t 2 m | -0 | > | f | f | f | t | t | t 2 m | 0 | > | f | f | f | t | t | t 2 m | 1 | > | f | f | f | t | t | t 2 m | 2 | > | f | f | f | t | t | t 2 m | 1 m | > | f | f | f | t | t | t 2 m | 2 m | = | f | t | t | f | t | f 2 m | 1 kg | > | f | f | f | t | t | t 2 m | 2 kg | > | f | f | f | t | t | t 1 kg | | | | | | | | 1 kg | -2 | > | f | f | f | t | t | t 1 kg | -1 | > | f | f | f | t | t | t 1 kg | -0 | > | f | f | f | t | t | t 1 kg | 0 | > | f | f | f | t | t | t 1 kg | 1 | > | f | f | f | t | t | t 1 kg | 2 | < | t | t | f | t | f | f 1 kg | 1 m | < | t | t | f | t | f | f 1 kg | 2 m | < | t | t | f | t | f | f 1 kg | 1 kg | = | f | t | t | f | t | f 1 kg | 2 kg | < | t | t | f | t | f | f 2 kg | | | | | | | | 2 kg | -2 | > | f | f | f | t | t | t 2 kg | -1 | > | f | f | f | t | t | t 2 kg | -0 | > | f | f | f | t | t | t 2 kg | 0 | > | f | f | f | t | t | t 2 kg | 1 | > | f | f | f | t | t | t 2 kg | 2 | > | f | f | f | t | t | t 2 kg | 1 m | > | f | f | f | t | t | t 2 kg | 2 m | < | t | t | f | t | f | f 2 kg | 1 kg | > | f | f | f | t | t | t 2 kg | 2 kg | = | f | t | t | f | t | f (121 rows) -- test btree index CREATE TEMP TABLE u (u unit); INSERT INTO u SELECT meter(generate_series(1,10000)::double precision); INSERT INTO u SELECT generate_series(1,10000)::text::unit * kilogram(); ANALYZE u; CREATE INDEX ON u(u); SELECT * FROM u WHERE u = meter(400); u ------- 400 m (1 row) SELECT * FROM u WHERE u = '300' * kilogram(); u -------- 300 kg (1 row) EXPLAIN (COSTS OFF) SELECT * FROM u WHERE u = meter(400); QUERY PLAN ------------------------------------ Index Only Scan using u_u_idx on u Index Cond: (u = '400 m'::unit) (2 rows) EXPLAIN (COSTS OFF) SELECT * FROM u WHERE u = '300' * kilogram(); QUERY PLAN ------------------------------------ Index Only Scan using u_u_idx on u Index Cond: (u = '300 kg'::unit) (2 rows) -- test strict operators SELECT '1 m'::unit << '1 m'::unit; ?column? ---------- f (1 row) SELECT '1 m'::unit << '1 A'::unit; ERROR: dimension mismatch in "strict comparison" operation: "1 m", "1 A" SELECT '1 m'::unit <<= '1 m'::unit; ?column? ---------- t (1 row) SELECT '1 m'::unit <<= '1 A'::unit; ERROR: dimension mismatch in "strict comparison" operation: "1 m", "1 A" SELECT '1 m'::unit == '1 m'::unit; ?column? ---------- t (1 row) SELECT '1 m'::unit == '1 A'::unit; ERROR: dimension mismatch in "strict comparison" operation: "1 m", "1 A" SELECT '1 m'::unit <<>> '1 m'::unit; ?column? ---------- f (1 row) SELECT '1 m'::unit <<>> '1 A'::unit; ERROR: dimension mismatch in "strict comparison" operation: "1 m", "1 A" SELECT '1 m'::unit >>= '1 m'::unit; ?column? ---------- t (1 row) SELECT '1 m'::unit >>= '1 A'::unit; ERROR: dimension mismatch in "strict comparison" operation: "1 m", "1 A" SELECT '1 m'::unit >> '1 m'::unit; ?column? ---------- f (1 row) SELECT '1 m'::unit >> '1 A'::unit; ERROR: dimension mismatch in "strict comparison" operation: "1 m", "1 A" -- test range type SELECT 'empty'::unitrange; unitrange ----------- empty (1 row) SELECT '(1 m, 2 m)'::unitrange; unitrange --------------- ("1 m","2 m") (1 row) SELECT '(1 m, 2 A)'::unitrange; ERROR: dimension mismatch in "strict comparison" operation: "1 m", "2 A" LINE 1: SELECT '(1 m, 2 A)'::unitrange; ^ SELECT unit_diff('1 A', '2 A'); unit_diff ----------- -1 (1 row) SELECT unit_diff('1 A', '2 K'); ERROR: dimension mismatch in "-" operation: "1 A", "2 K" postgresql-unit-7.8/expected/convert.out000066400000000000000000000175341450213077700206020ustar00rootroot00000000000000-- length WITH l(u) AS (VALUES ('mm'), ('m'), ('km'), ('in'), ('ft'), ('yd'), ('mi')) SELECT l1.u, l2.u, l1.u::unit @ l2.u FROM l l1 CROSS JOIN l l2 \crosstabview u | mm | m | km | in | ft | yd | mi ----+------------+------------+--------------+-----------------------+------------------------+------------------------+------------------------- mm | 1 mm | 0.001 m | 1e-06 km | 0.0393700787401575 in | 0.00328083989501312 ft | 0.00109361329833771 yd | 6.21371192237334e-07 mi m | 1000 mm | 1 m | 0.001 km | 39.3700787401575 in | 3.28083989501312 ft | 1.09361329833771 yd | 0.000621371192237334 mi km | 1000000 mm | 1000 m | 1 km | 39370.0787401575 in | 3280.83989501312 ft | 1093.61329833771 yd | 0.621371192237334 mi in | 25.4 mm | 0.0254 m | 2.54e-05 km | 1 in | 0.0833333333333333 ft | 0.0277777777777778 yd | 1.57828282828283e-05 mi ft | 304.8 mm | 0.3048 m | 0.0003048 km | 12 in | 1 ft | 0.333333333333333 yd | 0.000189393939393939 mi yd | 914.4 mm | 0.9144 m | 0.0009144 km | 36 in | 3 ft | 1 yd | 0.000568181818181818 mi mi | 1609344 mm | 1609.344 m | 1.609344 km | 63360 in | 5280 ft | 1760 yd | 1 mi (7 rows) /* revert to pre-12 default */ SET extra_float_digits = 0; WITH l(u) AS (VALUES ('mm'), ('m'), ('km'), ('in'), ('ft'), ('yd'), ('mi')) SELECT l1.u, l2.u, l1.u::unit @@ l2.u FROM l l1 CROSS JOIN l l2 \crosstabview u | mm | m | km | in | ft | yd | mi ----+---------+----------+-----------+--------------------+---------------------+---------------------+---------------------- mm | 1 | 0.001 | 1e-06 | 0.0393700787401575 | 0.00328083989501312 | 0.00109361329833771 | 6.21371192237334e-07 m | 1000 | 1 | 0.001 | 39.3700787401575 | 3.28083989501312 | 1.09361329833771 | 0.000621371192237334 km | 1000000 | 1000 | 1 | 39370.0787401575 | 3280.83989501312 | 1093.61329833771 | 0.621371192237334 in | 25.4 | 0.0254 | 2.54e-05 | 1 | 0.0833333333333333 | 0.0277777777777778 | 1.57828282828283e-05 ft | 304.8 | 0.3048 | 0.0003048 | 12 | 1 | 0.333333333333333 | 0.000189393939393939 yd | 914.4 | 0.9144 | 0.0009144 | 36 | 3 | 1 | 0.000568181818181818 mi | 1609344 | 1609.344 | 1.609344 | 63360 | 5280 | 1760 | 1 (7 rows) RESET extra_float_digits; -- area WITH l(u) AS (VALUES ('mm^2'), ('m^2'), ('km^2'), ('in^2'), ('ft^2'), ('yd^2'), ('mi^2')) SELECT l1.u, l2.u, l1.u::unit @ l2.u FROM l l1 CROSS JOIN l l2 \crosstabview u | mm^2 | m^2 | km^2 | in^2 | ft^2 | yd^2 | mi^2 ------+--------------------+--------------------+---------------------+-------------------------+---------------------------+---------------------------+--------------------------- mm^2 | 1 mm^2 | 1e-06 m^2 | 1e-12 km^2 | 0.0015500031000062 in^2 | 1.07639104167097e-05 ft^2 | 1.19599004630108e-06 yd^2 | 3.86102158542446e-13 mi^2 m^2 | 1000000 mm^2 | 1 m^2 | 1e-06 km^2 | 1550.0031000062 in^2 | 10.7639104167097 ft^2 | 1.19599004630108 yd^2 | 3.86102158542446e-07 mi^2 km^2 | 1000000000000 mm^2 | 1000000 m^2 | 1 km^2 | 1550003100.0062 in^2 | 10763910.4167097 ft^2 | 1195990.04630108 yd^2 | 0.386102158542446 mi^2 in^2 | 645.16 mm^2 | 0.00064516 m^2 | 6.4516e-10 km^2 | 1 in^2 | 0.00694444444444444 ft^2 | 0.000771604938271605 yd^2 | 2.49097668605244e-10 mi^2 ft^2 | 92903.04 mm^2 | 0.09290304 m^2 | 9.290304e-08 km^2 | 144 in^2 | 1 ft^2 | 0.111111111111111 yd^2 | 3.58700642791552e-08 mi^2 yd^2 | 836127.36 mm^2 | 0.83612736 m^2 | 8.3612736e-07 km^2 | 1296 in^2 | 9 ft^2 | 1 yd^2 | 3.22830578512397e-07 mi^2 mi^2 | 2589988110336 mm^2 | 2589988.110336 m^2 | 2.589988110336 km^2 | 4014489600 in^2 | 27878400 ft^2 | 3097600 yd^2 | 1 mi^2 (7 rows) -- volume WITH l(u) AS (VALUES ('mm^3'), ('l'), ('m^3'), ('in^3'), ('ft^3'), ('yd^3')) SELECT l1.u, l2.u, l1.u::unit @ l2.u FROM l l1 CROSS JOIN l l2 \crosstabview u | mm^3 | l | m^3 | in^3 | ft^3 | yd^3 ------+--------------------+-----------------+--------------------+---------------------------+---------------------------+--------------------------- mm^3 | 1 mm^3 | 1e-06 l | 1e-09 m^3 | 6.10237440947323e-05 in^3 | 3.53146667214886e-08 ft^3 | 1.30795061931439e-09 yd^3 l | 1000000 mm^3 | 1 l | 0.001 m^3 | 61.0237440947323 in^3 | 0.0353146667214886 ft^3 | 0.00130795061931439 yd^3 m^3 | 1000000000 mm^3 | 1000 l | 1 m^3 | 61023.7440947323 in^3 | 35.3146667214886 ft^3 | 1.30795061931439 yd^3 in^3 | 16387.064 mm^3 | 0.016387064 l | 1.6387064e-05 m^3 | 1 in^3 | 0.000578703703703704 ft^3 | 2.14334705075446e-05 yd^3 ft^3 | 28316846.592 mm^3 | 28.316846592 l | 0.028316846592 m^3 | 1728 in^3 | 1 ft^3 | 0.037037037037037 yd^3 yd^3 | 764554857.984 mm^3 | 764.554857984 l | 0.764554857984 m^3 | 46656 in^3 | 27 ft^3 | 1 yd^3 (6 rows) -- weight WITH l(u) AS (VALUES ('g'), ('kg'), ('t'), ('oz'), ('lb')) SELECT l1.u, l2.u, l1.u::unit @ l2.u FROM l l1 CROSS JOIN l l2 \crosstabview u | g | kg | t | oz | lb ----+----------------+-------------------+--------------------+-----------------------+------------------------ g | 1 g | 0.001 kg | 1e-06 t | 0.0352739619495804 oz | 0.00220462262184878 lb kg | 1000 g | 1 kg | 0.001 t | 35.2739619495804 oz | 2.20462262184878 lb t | 1000000 g | 1000 kg | 1 t | 35273.9619495804 oz | 2204.62262184878 lb oz | 28.349523125 g | 0.028349523125 kg | 2.8349523125e-05 t | 1 oz | 0.0625 lb lb | 453.59237 g | 0.45359237 kg | 0.00045359237 t | 16 oz | 1 lb (5 rows) -- time WITH l(u) AS (VALUES ('s'), ('min'), ('hr'), ('d'), ('julianyear')) SELECT l1.u, l2.u, l1.u::unit @ l2.u FROM l l1 CROSS JOIN l l2 \crosstabview u | s | min | hr | d | julianyear ------------+------------+------------------------+-------------------------+------------------------+--------------------------------- s | 1 s | 0.0166666666666667 min | 0.000277777777777778 hr | 1.15740740740741e-05 d | 3.16880878140289e-08 julianyear min | 60 s | 1 min | 0.0166666666666667 hr | 0.000694444444444444 d | 1.90128526884174e-06 julianyear hr | 3600 s | 60 min | 1 hr | 0.0416666666666667 d | 0.000114077116130504 julianyear d | 86400 s | 1440 min | 24 hr | 1 d | 0.0027378507871321 julianyear julianyear | 31557600 s | 525960 min | 8766 hr | 365.25 d | 1 julianyear (5 rows) postgresql-unit-7.8/expected/crosstab.out000066400000000000000000002011171450213077700207320ustar00rootroot00000000000000SET unit.time_output_custom = false; -- test multiplication WITH i(i) AS (VALUES ('-2'::unit), ('-1'), ('0'), ('1'), ('2')) SELECT unit, i, unit * i FROM units CROSS JOIN i WHERE (base OR coherent) AND NOT duplicate \crosstabview unit | -2 | -1 | 0 | 1 | 2 -------+--------+--------+-------+-------+------- 1 | -2 | -1 | 0 | 1 | 2 1 m | -2 m | -1 m | 0 m | 1 m | 2 m 1 kg | -2 kg | -1 kg | 0 kg | 1 kg | 2 kg 1 s | -2 s | -1 s | 0 s | 1 s | 2 s 1 A | -2 A | -1 A | 0 A | 1 A | 2 A 1 K | -2 K | -1 K | 0 K | 1 K | 2 K 1 mol | -2 mol | -1 mol | 0 mol | 1 mol | 2 mol 1 cd | -2 cd | -1 cd | 0 cd | 1 cd | 2 cd 1 B | -2 B | -1 B | 0 B | 1 B | 2 B 1 Hz | -2 Hz | -1 Hz | 0 Hz | 1 Hz | 2 Hz 1 N | -2 N | -1 N | 0 N | 1 N | 2 N 1 Pa | -2 Pa | -1 Pa | 0 Pa | 1 Pa | 2 Pa 1 J | -2 J | -1 J | 0 J | 1 J | 2 J 1 W | -2 W | -1 W | 0 W | 1 W | 2 W 1 C | -2 C | -1 C | 0 C | 1 C | 2 C 1 V | -2 V | -1 V | 0 V | 1 V | 2 V 1 F | -2 F | -1 F | 0 F | 1 F | 2 F 1 Ω | -2 Ω | -1 Ω | 0 Ω | 1 Ω | 2 Ω 1 S | -2 S | -1 S | 0 S | 1 S | 2 S 1 Wb | -2 Wb | -1 Wb | 0 Wb | 1 Wb | 2 Wb 1 T | -2 T | -1 T | 0 T | 1 T | 2 T 1 H | -2 H | -1 H | 0 H | 1 H | 2 H 1 lx | -2 lx | -1 lx | 0 lx | 1 lx | 2 lx 1 Gy | -2 Gy | -1 Gy | 0 Gy | 1 Gy | 2 Gy 1 kat | -2 kat | -1 kat | 0 kat | 1 kat | 2 kat (25 rows) SELECT a.unit AS a, b.unit AS b, a.unit * b.unit AS mul FROM units AS a CROSS JOIN units AS b WHERE (a.base OR a.coherent) AND NOT a.duplicate AND (b.base OR b.coherent) AND NOT b.duplicate \crosstabview a | 1 | 1 m | 1 kg | 1 s | 1 A | 1 K | 1 mol | 1 cd | 1 B | 1 Hz | 1 N | 1 Pa | 1 J | 1 W | 1 C | 1 V | 1 F | 1 Ω | 1 S | 1 Wb | 1 T | 1 H | 1 lx | 1 Gy | 1 kat -------+-------+------------------+--------------------+------------------+------------------+--------------------+----------------------+---------------------+--------------------+------------------+--------------------+------------------+--------------------+--------------------+------------------+--------------------+----------------------+----------------------+----------------------+--------------------+--------------------+----------------------+---------------------+------------------+---------------------- 1 | 1 | 1 m | 1 kg | 1 s | 1 A | 1 K | 1 mol | 1 cd | 1 B | 1 Hz | 1 N | 1 Pa | 1 J | 1 W | 1 C | 1 V | 1 F | 1 Ω | 1 S | 1 Wb | 1 T | 1 H | 1 lx | 1 Gy | 1 kat 1 m | 1 m | 1 m^2 | 1 m*kg | 1 m*s | 1 m*A | 1 m*K | 1 m*mol | 1 m*cd | 1 m*B | 1 m/s | 1 J | 1 kg/s^2 | 1 m^3*kg/s^2 | 1 m^3*kg/s^3 | 1 m*s*A | 1 m^3*kg/s^3*A | 1 s^4*A^2/m*kg | 1 m^3*kg/s^3*A^2 | 1 s^3*A^2/m*kg | 1 m^3*kg/s^2*A | 1 m*kg/s^2*A | 1 m^3*kg/s^2*A^2 | 1 cd/m | 1 m^3/s^2 | 1 m*mol/s 1 kg | 1 kg | 1 m*kg | 1 kg^2 | 1 kg*s | 1 kg*A | 1 kg*K | 1 kg*mol | 1 kg*cd | 1 kg*B | 1 kg/s | 1 m*kg^2/s^2 | 1 kg^2/m*s^2 | 1 m^2*kg^2/s^2 | 1 m^2*kg^2/s^3 | 1 kg*s*A | 1 m^2*kg^2/s^3*A | 1 s^4*A^2/m^2 | 1 m^2*kg^2/s^3*A^2 | 1 s^3*A^2/m^2 | 1 m^2*kg^2/s^2*A | 1 kg^2/s^2*A | 1 m^2*kg^2/s^2*A^2 | 1 kg*cd/m^2 | 1 J | 1 kg*mol/s 1 s | 1 s | 1 m*s | 1 kg*s | 1 s^2 | 1 C | 1 s*K | 1 s*mol | 1 s*cd | 1 s*B | 1 | 1 m*kg/s | 1 kg/m*s | 1 m^2*kg/s | 1 J | 1 s^2*A | 1 Wb | 1 s^5*A^2/m^2*kg | 1 H | 1 F | 1 m^2*kg/s*A | 1 kg/s*A | 1 m^2*kg/s*A^2 | 1 s*cd/m^2 | 1 m^2/s | 1 mol 1 A | 1 A | 1 m*A | 1 kg*A | 1 C | 1 A^2 | 1 A*K | 1 A*mol | 1 A*cd | 1 A*B | 1 A/s | 1 m*kg*A/s^2 | 1 kg*A/m*s^2 | 1 m^2*kg*A/s^2 | 1 m^2*kg*A/s^3 | 1 s*A^2 | 1 W | 1 s^4*A^3/m^2*kg | 1 V | 1 s^3*A^3/m^2*kg | 1 J | 1 kg/s^2 | 1 Wb | 1 A*cd/m^2 | 1 m^2*A/s^2 | 1 A*mol/s 1 K | 1 K | 1 m*K | 1 kg*K | 1 s*K | 1 A*K | 1 K^2 | 1 K*mol | 1 K*cd | 1 K*B | 1 K/s | 1 m*kg*K/s^2 | 1 kg*K/m*s^2 | 1 m^2*kg*K/s^2 | 1 m^2*kg*K/s^3 | 1 s*A*K | 1 m^2*kg*K/s^3*A | 1 s^4*A^2*K/m^2*kg | 1 m^2*kg*K/s^3*A^2 | 1 s^3*A^2*K/m^2*kg | 1 m^2*kg*K/s^2*A | 1 kg*K/s^2*A | 1 m^2*kg*K/s^2*A^2 | 1 K*cd/m^2 | 1 m^2*K/s^2 | 1 K*mol/s 1 mol | 1 mol | 1 m*mol | 1 kg*mol | 1 s*mol | 1 A*mol | 1 K*mol | 1 mol^2 | 1 mol*cd | 1 mol*B | 1 kat | 1 m*kg*mol/s^2 | 1 kg*mol/m*s^2 | 1 m^2*kg*mol/s^2 | 1 m^2*kg*mol/s^3 | 1 s*A*mol | 1 m^2*kg*mol/s^3*A | 1 s^4*A^2*mol/m^2*kg | 1 m^2*kg*mol/s^3*A^2 | 1 s^3*A^2*mol/m^2*kg | 1 m^2*kg*mol/s^2*A | 1 kg*mol/s^2*A | 1 m^2*kg*mol/s^2*A^2 | 1 mol*cd/m^2 | 1 m^2*mol/s^2 | 1 mol^2/s 1 cd | 1 cd | 1 m*cd | 1 kg*cd | 1 s*cd | 1 A*cd | 1 K*cd | 1 mol*cd | 1 cd^2 | 1 cd*B | 1 cd/s | 1 m*kg*cd/s^2 | 1 kg*cd/m*s^2 | 1 m^2*kg*cd/s^2 | 1 m^2*kg*cd/s^3 | 1 s*A*cd | 1 m^2*kg*cd/s^3*A | 1 s^4*A^2*cd/m^2*kg | 1 m^2*kg*cd/s^3*A^2 | 1 s^3*A^2*cd/m^2*kg | 1 m^2*kg*cd/s^2*A | 1 kg*cd/s^2*A | 1 m^2*kg*cd/s^2*A^2 | 1 cd^2/m^2 | 1 m^2*cd/s^2 | 1 mol*cd/s 1 B | 1 B | 1 m*B | 1 kg*B | 1 s*B | 1 A*B | 1 K*B | 1 mol*B | 1 cd*B | 1 B^2 | 1 B/s | 1 m*kg*B/s^2 | 1 kg*B/m*s^2 | 1 m^2*kg*B/s^2 | 1 m^2*kg*B/s^3 | 1 s*A*B | 1 m^2*kg*B/s^3*A | 1 s^4*A^2*B/m^2*kg | 1 m^2*kg*B/s^3*A^2 | 1 s^3*A^2*B/m^2*kg | 1 m^2*kg*B/s^2*A | 1 kg*B/s^2*A | 1 m^2*kg*B/s^2*A^2 | 1 cd*B/m^2 | 1 m^2*B/s^2 | 1 mol*B/s 1 Hz | 1 Hz | 1 m/s | 1 kg/s | 1 | 1 A/s | 1 K/s | 1 kat | 1 cd/s | 1 B/s | 1 s^-2 | 1 m*kg/s^3 | 1 kg/m*s^3 | 1 W | 1 m^2*kg/s^4 | 1 A | 1 m^2*kg/s^4*A | 1 S | 1 m^2*kg/s^4*A^2 | 1 s^2*A^2/m^2*kg | 1 V | 1 kg/s^3*A | 1 Ω | 1 cd/m^2*s | 1 m^2/s^3 | 1 mol/s^2 1 N | 1 N | 1 J | 1 m*kg^2/s^2 | 1 m*kg/s | 1 m*kg*A/s^2 | 1 m*kg*K/s^2 | 1 m*kg*mol/s^2 | 1 m*kg*cd/s^2 | 1 m*kg*B/s^2 | 1 m*kg/s^3 | 1 m^2*kg^2/s^4 | 1 kg^2/s^4 | 1 m^3*kg^2/s^4 | 1 m^3*kg^2/s^5 | 1 m*kg*A/s | 1 m^3*kg^2/s^5*A | 1 s^2*A^2/m | 1 m^3*kg^2/s^5*A^2 | 1 s*A^2/m | 1 m^3*kg^2/s^4*A | 1 m*kg^2/s^4*A | 1 m^3*kg^2/s^4*A^2 | 1 kg*cd/m*s^2 | 1 m^3*kg/s^4 | 1 m*kg*mol/s^3 1 Pa | 1 Pa | 1 kg/s^2 | 1 kg^2/m*s^2 | 1 kg/m*s | 1 kg*A/m*s^2 | 1 kg*K/m*s^2 | 1 kg*mol/m*s^2 | 1 kg*cd/m*s^2 | 1 kg*B/m*s^2 | 1 kg/m*s^3 | 1 kg^2/s^4 | 1 kg^2/m^2*s^4 | 1 m*kg^2/s^4 | 1 m*kg^2/s^5 | 1 kg*A/m*s | 1 m*kg^2/s^5*A | 1 s^2*A^2/m^3 | 1 m*kg^2/s^5*A^2 | 1 s*A^2/m^3 | 1 m*kg^2/s^4*A | 1 kg^2/m*s^4*A | 1 m*kg^2/s^4*A^2 | 1 kg*cd/m^3*s^2 | 1 m*kg/s^4 | 1 kg*mol/m*s^3 1 J | 1 J | 1 m^3*kg/s^2 | 1 m^2*kg^2/s^2 | 1 m^2*kg/s | 1 m^2*kg*A/s^2 | 1 m^2*kg*K/s^2 | 1 m^2*kg*mol/s^2 | 1 m^2*kg*cd/s^2 | 1 m^2*kg*B/s^2 | 1 W | 1 m^3*kg^2/s^4 | 1 m*kg^2/s^4 | 1 m^4*kg^2/s^4 | 1 m^4*kg^2/s^5 | 1 m^2*kg*A/s | 1 m^4*kg^2/s^5*A | 1 s^2*A^2 | 1 m^4*kg^2/s^5*A^2 | 1 s*A^2 | 1 m^4*kg^2/s^4*A | 1 m^2*kg^2/s^4*A | 1 m^4*kg^2/s^4*A^2 | 1 kg*cd/s^2 | 1 m^4*kg/s^4 | 1 m^2*kg*mol/s^3 1 W | 1 W | 1 m^3*kg/s^3 | 1 m^2*kg^2/s^3 | 1 J | 1 m^2*kg*A/s^3 | 1 m^2*kg*K/s^3 | 1 m^2*kg*mol/s^3 | 1 m^2*kg*cd/s^3 | 1 m^2*kg*B/s^3 | 1 m^2*kg/s^4 | 1 m^3*kg^2/s^5 | 1 m*kg^2/s^5 | 1 m^4*kg^2/s^5 | 1 m^4*kg^2/s^6 | 1 m^2*kg*A/s^2 | 1 m^4*kg^2/s^6*A | 1 s*A^2 | 1 m^4*kg^2/s^6*A^2 | 1 A^2 | 1 m^4*kg^2/s^5*A | 1 m^2*kg^2/s^5*A | 1 m^4*kg^2/s^5*A^2 | 1 kg*cd/s^3 | 1 m^4*kg/s^5 | 1 m^2*kg*mol/s^4 1 C | 1 C | 1 m*s*A | 1 kg*s*A | 1 s^2*A | 1 s*A^2 | 1 s*A*K | 1 s*A*mol | 1 s*A*cd | 1 s*A*B | 1 A | 1 m*kg*A/s | 1 kg*A/m*s | 1 m^2*kg*A/s | 1 m^2*kg*A/s^2 | 1 s^2*A^2 | 1 J | 1 s^5*A^3/m^2*kg | 1 Wb | 1 s^4*A^3/m^2*kg | 1 m^2*kg/s | 1 kg/s | 1 m^2*kg/s*A | 1 s*A*cd/m^2 | 1 m^2*A/s | 1 A*mol 1 V | 1 V | 1 m^3*kg/s^3*A | 1 m^2*kg^2/s^3*A | 1 Wb | 1 W | 1 m^2*kg*K/s^3*A | 1 m^2*kg*mol/s^3*A | 1 m^2*kg*cd/s^3*A | 1 m^2*kg*B/s^3*A | 1 m^2*kg/s^4*A | 1 m^3*kg^2/s^5*A | 1 m*kg^2/s^5*A | 1 m^4*kg^2/s^5*A | 1 m^4*kg^2/s^6*A | 1 J | 1 m^4*kg^2/s^6*A^2 | 1 C | 1 m^4*kg^2/s^6*A^3 | 1 A | 1 m^4*kg^2/s^5*A^2 | 1 m^2*kg^2/s^5*A^2 | 1 m^4*kg^2/s^5*A^3 | 1 kg*cd/s^3*A | 1 m^4*kg/s^5*A | 1 m^2*kg*mol/s^4*A 1 F | 1 F | 1 s^4*A^2/m*kg | 1 s^4*A^2/m^2 | 1 s^5*A^2/m^2*kg | 1 s^4*A^3/m^2*kg | 1 s^4*A^2*K/m^2*kg | 1 s^4*A^2*mol/m^2*kg | 1 s^4*A^2*cd/m^2*kg | 1 s^4*A^2*B/m^2*kg | 1 S | 1 s^2*A^2/m | 1 s^2*A^2/m^3 | 1 s^2*A^2 | 1 s*A^2 | 1 s^5*A^3/m^2*kg | 1 C | 1 s^8*A^4/m^4*kg^2 | 1 s | 1 s^7*A^4/m^4*kg^2 | 1 s^2*A | 1 s^2*A/m^2 | 1 s^2 | 1 s^4*A^2*cd/m^4*kg | 1 s^2*A^2/kg | 1 s^3*A^2*mol/m^2*kg 1 Ω | 1 Ω | 1 m^3*kg/s^3*A^2 | 1 m^2*kg^2/s^3*A^2 | 1 H | 1 V | 1 m^2*kg*K/s^3*A^2 | 1 m^2*kg*mol/s^3*A^2 | 1 m^2*kg*cd/s^3*A^2 | 1 m^2*kg*B/s^3*A^2 | 1 m^2*kg/s^4*A^2 | 1 m^3*kg^2/s^5*A^2 | 1 m*kg^2/s^5*A^2 | 1 m^4*kg^2/s^5*A^2 | 1 m^4*kg^2/s^6*A^2 | 1 Wb | 1 m^4*kg^2/s^6*A^3 | 1 s | 1 m^4*kg^2/s^6*A^4 | 1 | 1 m^4*kg^2/s^5*A^3 | 1 m^2*kg^2/s^5*A^3 | 1 m^4*kg^2/s^5*A^4 | 1 kg*cd/s^3*A^2 | 1 m^4*kg/s^5*A^2 | 1 m^2*kg*mol/s^4*A^2 1 S | 1 S | 1 s^3*A^2/m*kg | 1 s^3*A^2/m^2 | 1 F | 1 s^3*A^3/m^2*kg | 1 s^3*A^2*K/m^2*kg | 1 s^3*A^2*mol/m^2*kg | 1 s^3*A^2*cd/m^2*kg | 1 s^3*A^2*B/m^2*kg | 1 s^2*A^2/m^2*kg | 1 s*A^2/m | 1 s*A^2/m^3 | 1 s*A^2 | 1 A^2 | 1 s^4*A^3/m^2*kg | 1 A | 1 s^7*A^4/m^4*kg^2 | 1 | 1 s^6*A^4/m^4*kg^2 | 1 C | 1 s*A/m^2 | 1 s | 1 s^3*A^2*cd/m^4*kg | 1 s*A^2/kg | 1 s^2*A^2*mol/m^2*kg 1 Wb | 1 Wb | 1 m^3*kg/s^2*A | 1 m^2*kg^2/s^2*A | 1 m^2*kg/s*A | 1 J | 1 m^2*kg*K/s^2*A | 1 m^2*kg*mol/s^2*A | 1 m^2*kg*cd/s^2*A | 1 m^2*kg*B/s^2*A | 1 V | 1 m^3*kg^2/s^4*A | 1 m*kg^2/s^4*A | 1 m^4*kg^2/s^4*A | 1 m^4*kg^2/s^5*A | 1 m^2*kg/s | 1 m^4*kg^2/s^5*A^2 | 1 s^2*A | 1 m^4*kg^2/s^5*A^3 | 1 C | 1 m^4*kg^2/s^4*A^2 | 1 m^2*kg^2/s^4*A^2 | 1 m^4*kg^2/s^4*A^3 | 1 kg*cd/s^2*A | 1 m^4*kg/s^4*A | 1 m^2*kg*mol/s^3*A 1 T | 1 T | 1 m*kg/s^2*A | 1 kg^2/s^2*A | 1 kg/s*A | 1 kg/s^2 | 1 kg*K/s^2*A | 1 kg*mol/s^2*A | 1 kg*cd/s^2*A | 1 kg*B/s^2*A | 1 kg/s^3*A | 1 m*kg^2/s^4*A | 1 kg^2/m*s^4*A | 1 m^2*kg^2/s^4*A | 1 m^2*kg^2/s^5*A | 1 kg/s | 1 m^2*kg^2/s^5*A^2 | 1 s^2*A/m^2 | 1 m^2*kg^2/s^5*A^3 | 1 s*A/m^2 | 1 m^2*kg^2/s^4*A^2 | 1 kg^2/s^4*A^2 | 1 m^2*kg^2/s^4*A^3 | 1 kg*cd/m^2*s^2*A | 1 m^2*kg/s^4*A | 1 kg*mol/s^3*A 1 H | 1 H | 1 m^3*kg/s^2*A^2 | 1 m^2*kg^2/s^2*A^2 | 1 m^2*kg/s*A^2 | 1 Wb | 1 m^2*kg*K/s^2*A^2 | 1 m^2*kg*mol/s^2*A^2 | 1 m^2*kg*cd/s^2*A^2 | 1 m^2*kg*B/s^2*A^2 | 1 Ω | 1 m^3*kg^2/s^4*A^2 | 1 m*kg^2/s^4*A^2 | 1 m^4*kg^2/s^4*A^2 | 1 m^4*kg^2/s^5*A^2 | 1 m^2*kg/s*A | 1 m^4*kg^2/s^5*A^3 | 1 s^2 | 1 m^4*kg^2/s^5*A^4 | 1 s | 1 m^4*kg^2/s^4*A^3 | 1 m^2*kg^2/s^4*A^3 | 1 m^4*kg^2/s^4*A^4 | 1 kg*cd/s^2*A^2 | 1 m^4*kg/s^4*A^2 | 1 m^2*kg*mol/s^3*A^2 1 lx | 1 lx | 1 cd/m | 1 kg*cd/m^2 | 1 s*cd/m^2 | 1 A*cd/m^2 | 1 K*cd/m^2 | 1 mol*cd/m^2 | 1 cd^2/m^2 | 1 cd*B/m^2 | 1 cd/m^2*s | 1 kg*cd/m*s^2 | 1 kg*cd/m^3*s^2 | 1 kg*cd/s^2 | 1 kg*cd/s^3 | 1 s*A*cd/m^2 | 1 kg*cd/s^3*A | 1 s^4*A^2*cd/m^4*kg | 1 kg*cd/s^3*A^2 | 1 s^3*A^2*cd/m^4*kg | 1 kg*cd/s^2*A | 1 kg*cd/m^2*s^2*A | 1 kg*cd/s^2*A^2 | 1 cd^2/m^4 | 1 cd/s^2 | 1 mol*cd/m^2*s 1 Gy | 1 Gy | 1 m^3/s^2 | 1 J | 1 m^2/s | 1 m^2*A/s^2 | 1 m^2*K/s^2 | 1 m^2*mol/s^2 | 1 m^2*cd/s^2 | 1 m^2*B/s^2 | 1 m^2/s^3 | 1 m^3*kg/s^4 | 1 m*kg/s^4 | 1 m^4*kg/s^4 | 1 m^4*kg/s^5 | 1 m^2*A/s | 1 m^4*kg/s^5*A | 1 s^2*A^2/kg | 1 m^4*kg/s^5*A^2 | 1 s*A^2/kg | 1 m^4*kg/s^4*A | 1 m^2*kg/s^4*A | 1 m^4*kg/s^4*A^2 | 1 cd/s^2 | 1 m^4/s^4 | 1 m^2*mol/s^3 1 kat | 1 kat | 1 m*mol/s | 1 kg*mol/s | 1 mol | 1 A*mol/s | 1 K*mol/s | 1 mol^2/s | 1 mol*cd/s | 1 mol*B/s | 1 mol/s^2 | 1 m*kg*mol/s^3 | 1 kg*mol/m*s^3 | 1 m^2*kg*mol/s^3 | 1 m^2*kg*mol/s^4 | 1 A*mol | 1 m^2*kg*mol/s^4*A | 1 s^3*A^2*mol/m^2*kg | 1 m^2*kg*mol/s^4*A^2 | 1 s^2*A^2*mol/m^2*kg | 1 m^2*kg*mol/s^3*A | 1 kg*mol/s^3*A | 1 m^2*kg*mol/s^3*A^2 | 1 mol*cd/m^2*s | 1 m^2*mol/s^3 | 1 mol^2/s^2 (25 rows) SELECT f, unit, f * unit FROM factors CROSS JOIN units WHERE (base OR coherent) AND NOT duplicate \crosstabview f | 1 | 1 m | 1 kg | 1 s | 1 A | 1 K | 1 mol | 1 cd | 1 B | 1 Hz | 1 N | 1 Pa | 1 J | 1 W | 1 C | 1 V | 1 F | 1 Ω | 1 S | 1 Wb | 1 T | 1 H | 1 lx | 1 Gy | 1 kat ---------------+---------------+---------+----------+---------+---------+---------+-----------+----------+---------+----------+---------+----------+---------+---------+---------+---------+---------+---------+---------+----------+---------+---------+----------+----------+----------- 1e+33 | 1e+33 | 1e+33 m | 1e+33 kg | 1e+33 s | 1e+33 A | 1e+33 K | 1e+33 mol | 1e+33 cd | 1e+33 B | 1e+33 Hz | 1e+33 N | 1e+33 Pa | 1e+33 J | 1e+33 W | 1e+33 C | 1e+33 V | 1e+33 F | 1e+33 Ω | 1e+33 S | 1e+33 Wb | 1e+33 T | 1e+33 H | 1e+33 lx | 1e+33 Gy | 1e+33 kat 1e+30 | 1e+30 | 1 Qm | 1e+30 kg | 1 Qs | 1 QA | 1 QK | 1 Qmol | 1 Qcd | 1 QB | 1 QHz | 1 QN | 1 QPa | 1 QJ | 1 QW | 1 QC | 1 QV | 1 QF | 1 QΩ | 1 QS | 1 QWb | 1 QT | 1 QH | 1 Qlx | 1 QGy | 1 Qkat 1e+27 | 1e+27 | 1 Rm | 1 Qg | 1 Rs | 1 RA | 1 RK | 1 Rmol | 1 Rcd | 1 RB | 1 RHz | 1 RN | 1 RPa | 1 RJ | 1 RW | 1 RC | 1 RV | 1 RF | 1 RΩ | 1 RS | 1 RWb | 1 RT | 1 RH | 1 Rlx | 1 RGy | 1 Rkat 1e+24 | 1e+24 | 1 Ym | 1 Rg | 1 Ys | 1 YA | 1 YK | 1 Ymol | 1 Ycd | 1 YB | 1 YHz | 1 YN | 1 YPa | 1 YJ | 1 YW | 1 YC | 1 YV | 1 YF | 1 YΩ | 1 YS | 1 YWb | 1 YT | 1 YH | 1 Ylx | 1 YGy | 1 Ykat 1e+21 | 1e+21 | 1 Zm | 1 Yg | 1 Zs | 1 ZA | 1 ZK | 1 Zmol | 1 Zcd | 1 ZB | 1 ZHz | 1 ZN | 1 ZPa | 1 ZJ | 1 ZW | 1 ZC | 1 ZV | 1 ZF | 1 ZΩ | 1 ZS | 1 ZWb | 1 ZT | 1 ZH | 1 Zlx | 1 ZGy | 1 Zkat 1e+18 | 1e+18 | 1 Em | 1 Zg | 1 Es | 1 EA | 1 EK | 1 Emol | 1 Ecd | 1 EB | 1 EHz | 1 EN | 1 EPa | 1 EJ | 1 EW | 1 EC | 1 EV | 1 EF | 1 EΩ | 1 ES | 1 EWb | 1 ET | 1 EH | 1 Elx | 1 EGy | 1 Ekat 1e+15 | 1e+15 | 1 Pm | 1 Eg | 1 Ps | 1 PA | 1 PK | 1 Pmol | 1 Pcd | 1 PB | 1 PHz | 1 PN | 1 PPa | 1 PJ | 1 PW | 1 PC | 1 PV | 1 PF | 1 PΩ | 1 PS | 1 PWb | 1 PT | 1 PH | 1 Plx | 1 PGy | 1 Pkat 1000000000000 | 1000000000000 | 1 Tm | 1 Pg | 1 Ts | 1 TA | 1 TK | 1 Tmol | 1 Tcd | 1 TB | 1 THz | 1 TN | 1 TPa | 1 TJ | 1 TW | 1 TC | 1 TV | 1 TF | 1 TΩ | 1 TS | 1 TWb | 1 TT | 1 TH | 1 Tlx | 1 TGy | 1 Tkat 1000000000 | 1000000000 | 1 Gm | 1 Tg | 1 Gsec | 1 GA | 1 GK | 1 Gmol | 1 Gcd | 1 GB | 1 GHz | 1 GN | 1 GPa | 1 GJ | 1 GW | 1 GC | 1 GV | 1 GF | 1 GΩ | 1 GS | 1 GWb | 1 GT | 1 GH | 1 Glx | 1 GGy | 1 Gkat 1000000 | 1000000 | 1 Mm | 1 Gg | 1 Ms | 1 MA | 1 MK | 1 Mmol | 1 Mcd | 1 MB | 1 MHz | 1 MN | 1 MPa | 1 MJ | 1 MW | 1 MC | 1 MV | 1 MF | 1 MΩ | 1 MS | 1 MWb | 1 MT | 1 MH | 1 Mlx | 1 MGy | 1 Mkat 1000 | 1000 | 1 km | 1 Mg | 1 ks | 1 kA | 1 kK | 1 kmol | 1 kcd | 1 kB | 1 kHz | 1 kN | 1 kPa | 1 kJ | 1 kW | 1 kC | 1 kV | 1 kF | 1 kΩ | 1 kS | 1 kWb | 1 kT | 1 kH | 1 klx | 1 kGy | 1 kkat 1 | 1 | 1 m | 1 kg | 1 s | 1 A | 1 K | 1 mol | 1 cd | 1 B | 1 Hz | 1 N | 1 Pa | 1 J | 1 W | 1 C | 1 V | 1 F | 1 Ω | 1 S | 1 Wb | 1 T | 1 H | 1 lx | 1 Gy | 1 kat 0.001 | 0.001 | 1 mm | 1 g | 1 ms | 1 mA | 1 mK | 1 mmol | 1 mcd | 1 mB | 1 mHz | 1 mN | 1 mPa | 1 mJ | 1 mW | 1 mC | 1 mV | 1 mF | 1 mΩ | 1 mS | 1 mWb | 1 mT | 1 mH | 1 mlx | 1 mGy | 1 mkat 1e-06 | 1e-06 | 1 µm | 1 mg | 1 µs | 1 µA | 1 µK | 1 µmol | 1 µcd | 1 µB | 1 µHz | 1 µN | 1 µPa | 1 µJ | 1 µW | 1 µC | 1 µV | 1 µF | 1 µΩ | 1 µS | 1 µWb | 1 µT | 1 µH | 1 µlx | 1 µGy | 1 µkat 1e-09 | 1e-09 | 1 nm | 1 µg | 1 ns | 1 nA | 1 nK | 1 nmol | 1 ncd | 1 nB | 1 nHz | 1 nN | 1 nPa | 1 nJ | 1 nW | 1 nC | 1 nV | 1 nF | 1 nΩ | 1 nS | 1 nWb | 1 nT | 1 nH | 1 nlx | 1 nGy | 1 nkat 1e-12 | 1e-12 | 1 pm | 1 ng | 1 ps | 1 pA | 1 pK | 1 pmol | 1 pcd | 1 pB | 1 pHz | 1 pN | 1 pPa | 1 pJ | 1 pW | 1 pC | 1 pV | 1 pF | 1 pΩ | 1 pS | 1 pWb | 1 pT | 1 pH | 1 plx | 1 pGy | 1 pkat 1e-15 | 1e-15 | 1 fm | 1 pg | 1 fs | 1 fA | 1 fK | 1 fmol | 1 fcd | 1 fB | 1 fHz | 1 fN | 1 fPa | 1 fJ | 1 fW | 1 fC | 1 fV | 1 fF | 1 fΩ | 1 fS | 1 fWb | 1 fT | 1 fH | 1 flx | 1 fGy | 1 fkat 1e-18 | 1e-18 | 1 am | 1 fg | 1 as | 1 aA | 1 aK | 1 amol | 1 acd | 1 aB | 1 aHz | 1 aN | 1 aPa | 1 aJ | 1 aW | 1 aC | 1 aV | 1 aF | 1 aΩ | 1 aS | 1 aWb | 1 aT | 1 aH | 1 alx | 1 aGy | 1 akat 1e-21 | 1e-21 | 1 zm | 1 ag | 1 zs | 1 zA | 1 zK | 1 zmol | 1 zcd | 1 zB | 1 zHz | 1 zN | 1 zPa | 1 zJ | 1 zW | 1 zC | 1 zV | 1 zF | 1 zΩ | 1 zS | 1 zWb | 1 zT | 1 zH | 1 zlx | 1 zGy | 1 zkat 1e-24 | 1e-24 | 1 ym | 1 zg | 1 ys | 1 yA | 1 yK | 1 ymol | 1 ycd | 1 yB | 1 yHz | 1 yN | 1 yPa | 1 yJ | 1 yW | 1 yC | 1 yV | 1 yF | 1 yΩ | 1 yS | 1 yWb | 1 yT | 1 yH | 1 ylx | 1 yGy | 1 ykat 1e-27 | 1e-27 | 1 rm | 1 yg | 1 rs | 1 rA | 1 rK | 1 rmol | 1 rcd | 1 rB | 1 rHz | 1 rN | 1 rPa | 1 rJ | 1 rW | 1 rC | 1 rV | 1 rF | 1 rΩ | 1 rS | 1 rWb | 1 rT | 1 rH | 1 rlx | 1 rGy | 1 rkat 1e-30 | 1e-30 | 1 qm | 1 rg | 1 qs | 1 qA | 1 qK | 1 qmol | 1 qcd | 1 qB | 1 qHz | 1 qN | 1 qPa | 1 qJ | 1 qW | 1 qC | 1 qV | 1 qF | 1 qΩ | 1 qS | 1 qWb | 1 qT | 1 qH | 1 qlx | 1 qGy | 1 qkat 1e-33 | 1e-33 | 1e-33 m | 1 qg | 1e-33 s | 1e-33 A | 1e-33 K | 1e-33 mol | 1e-33 cd | 1e-33 B | 1e-33 Hz | 1e-33 N | 1e-33 Pa | 1e-33 J | 1e-33 W | 1e-33 C | 1e-33 V | 1e-33 F | 1e-33 Ω | 1e-33 S | 1e-33 Wb | 1e-33 T | 1e-33 H | 1e-33 lx | 1e-33 Gy | 1e-33 kat 1e-36 | 1e-36 | 1e-36 m | 1e-36 kg | 1e-36 s | 1e-36 A | 1e-36 K | 1e-36 mol | 1e-36 cd | 1e-36 B | 1e-36 Hz | 1e-36 N | 1e-36 Pa | 1e-36 J | 1e-36 W | 1e-36 C | 1e-36 V | 1e-36 F | 1e-36 Ω | 1e-36 S | 1e-36 Wb | 1e-36 T | 1e-36 H | 1e-36 lx | 1e-36 Gy | 1e-36 kat 0 | 0 | 0 m | 0 kg | 0 s | 0 A | 0 K | 0 mol | 0 cd | 0 B | 0 Hz | 0 N | 0 Pa | 0 J | 0 W | 0 C | 0 V | 0 F | 0 Ω | 0 S | 0 Wb | 0 T | 0 H | 0 lx | 0 Gy | 0 kat (25 rows) -- test division WITH i(i) AS (VALUES ('-2'::unit), ('-1'), ('1'), ('2')) SELECT unit, i, unit / i FROM units CROSS JOIN i WHERE (base OR coherent) AND NOT duplicate \crosstabview unit | -2 | -1 | 1 | 2 -------+-----------+--------+-------+---------- 1 | -0.5 | -1 | 1 | 0.5 1 m | -500 mm | -1 m | 1 m | 500 mm 1 kg | -500 g | -1 kg | 1 kg | 500 g 1 s | -500 ms | -1 s | 1 s | 500 ms 1 A | -500 mA | -1 A | 1 A | 500 mA 1 K | -500 mK | -1 K | 1 K | 500 mK 1 mol | -500 mmol | -1 mol | 1 mol | 500 mmol 1 cd | -500 mcd | -1 cd | 1 cd | 500 mcd 1 B | -500 mB | -1 B | 1 B | 500 mB 1 Hz | -500 mHz | -1 Hz | 1 Hz | 500 mHz 1 N | -500 mN | -1 N | 1 N | 500 mN 1 Pa | -500 mPa | -1 Pa | 1 Pa | 500 mPa 1 J | -500 mJ | -1 J | 1 J | 500 mJ 1 W | -500 mW | -1 W | 1 W | 500 mW 1 C | -500 mC | -1 C | 1 C | 500 mC 1 V | -500 mV | -1 V | 1 V | 500 mV 1 F | -500 mF | -1 F | 1 F | 500 mF 1 Ω | -500 mΩ | -1 Ω | 1 Ω | 500 mΩ 1 S | -500 mS | -1 S | 1 S | 500 mS 1 Wb | -500 mWb | -1 Wb | 1 Wb | 500 mWb 1 T | -500 mT | -1 T | 1 T | 500 mT 1 H | -500 mH | -1 H | 1 H | 500 mH 1 lx | -500 mlx | -1 lx | 1 lx | 500 mlx 1 Gy | -500 mGy | -1 Gy | 1 Gy | 500 mGy 1 kat | -500 mkat | -1 kat | 1 kat | 500 mkat (25 rows) WITH i(i) AS (VALUES ('-2'::unit), ('-1'), ('0'), ('1'), ('2')) SELECT i, unit, i / unit FROM units CROSS JOIN i WHERE (base OR coherent) AND NOT duplicate \crosstabview i | 1 | 1 m | 1 kg | 1 s | 1 A | 1 K | 1 mol | 1 cd | 1 B | 1 Hz | 1 N | 1 Pa | 1 J | 1 W | 1 C | 1 V | 1 F | 1 Ω | 1 S | 1 Wb | 1 T | 1 H | 1 lx | 1 Gy | 1 kat ----+----+---------+----------+-------+---------+---------+-----------+----------+---------+------+-------------+-------------+---------------+---------------+--------------+-----------------+-------------------+------+------+-----------------+-------------+-------------------+-----------+------------+---------- -2 | -2 | -2 m^-1 | -2 kg^-1 | -2 Hz | -2 A^-1 | -2 K^-1 | -2 mol^-1 | -2 cd^-1 | -2 B^-1 | -2 s | -2 s^2/m*kg | -2 m*s^2/kg | -2 s^2/m^2*kg | -2 s^3/m^2*kg | -2 s^-1*A^-1 | -2 s^3*A/m^2*kg | -2 m^2*kg/s^4*A^2 | -2 S | -2 Ω | -2 s^2*A/m^2*kg | -2 s^2*A/kg | -2 s^2*A^2/m^2*kg | -2 m^2/cd | -2 s^2/m^2 | -2 s/mol -1 | -1 | -1 m^-1 | -1 kg^-1 | -1 Hz | -1 A^-1 | -1 K^-1 | -1 mol^-1 | -1 cd^-1 | -1 B^-1 | -1 s | -1 s^2/m*kg | -1 m*s^2/kg | -1 s^2/m^2*kg | -1 s^3/m^2*kg | -1 s^-1*A^-1 | -1 s^3*A/m^2*kg | -1 m^2*kg/s^4*A^2 | -1 S | -1 Ω | -1 s^2*A/m^2*kg | -1 s^2*A/kg | -1 s^2*A^2/m^2*kg | -1 m^2/cd | -1 s^2/m^2 | -1 s/mol 0 | 0 | 0 m^-1 | 0 kg^-1 | 0 Hz | 0 A^-1 | 0 K^-1 | 0 mol^-1 | 0 cd^-1 | 0 B^-1 | 0 s | 0 s^2/m*kg | 0 m*s^2/kg | 0 s^2/m^2*kg | 0 s^3/m^2*kg | 0 s^-1*A^-1 | 0 s^3*A/m^2*kg | 0 m^2*kg/s^4*A^2 | 0 S | 0 Ω | 0 s^2*A/m^2*kg | 0 s^2*A/kg | 0 s^2*A^2/m^2*kg | 0 m^2/cd | 0 s^2/m^2 | 0 s/mol 1 | 1 | 1 m^-1 | 1 kg^-1 | 1 Hz | 1 A^-1 | 1 K^-1 | 1 mol^-1 | 1 cd^-1 | 1 B^-1 | 1 s | 1 s^2/m*kg | 1 m*s^2/kg | 1 s^2/m^2*kg | 1 s^3/m^2*kg | 1 s^-1*A^-1 | 1 s^3*A/m^2*kg | 1 m^2*kg/s^4*A^2 | 1 S | 1 Ω | 1 s^2*A/m^2*kg | 1 s^2*A/kg | 1 s^2*A^2/m^2*kg | 1 m^2/cd | 1 s^2/m^2 | 1 s/mol 2 | 2 | 2 m^-1 | 2 kg^-1 | 2 Hz | 2 A^-1 | 2 K^-1 | 2 mol^-1 | 2 cd^-1 | 2 B^-1 | 2 s | 2 s^2/m*kg | 2 m*s^2/kg | 2 s^2/m^2*kg | 2 s^3/m^2*kg | 2 s^-1*A^-1 | 2 s^3*A/m^2*kg | 2 m^2*kg/s^4*A^2 | 2 S | 2 Ω | 2 s^2*A/m^2*kg | 2 s^2*A/kg | 2 s^2*A^2/m^2*kg | 2 m^2/cd | 2 s^2/m^2 | 2 s/mol (5 rows) SELECT a.unit AS a, b.unit AS b, a.unit / b.unit AS div FROM units AS a CROSS JOIN units AS b WHERE (a.base OR a.coherent) AND NOT a.duplicate AND (b.base OR b.coherent) AND NOT b.duplicate \crosstabview a | 1 | 1 m | 1 kg | 1 s | 1 A | 1 K | 1 mol | 1 cd | 1 B | 1 Hz | 1 N | 1 Pa | 1 J | 1 W | 1 C | 1 V | 1 F | 1 Ω | 1 S | 1 Wb | 1 T | 1 H | 1 lx | 1 Gy | 1 kat -------+-------+------------------+--------------------+------------------+------------------+--------------------+----------------------+---------------------+--------------------+------------------+--------------------+------------------+--------------------+--------------------+------------------+--------------------+----------------------+----------------------+----------------------+--------------------+--------------------+----------------------+---------------------+------------------+---------------------- 1 | 1 | 1 m^-1 | 1 kg^-1 | 1 Hz | 1 A^-1 | 1 K^-1 | 1 mol^-1 | 1 cd^-1 | 1 B^-1 | 1 s | 1 s^2/m*kg | 1 m*s^2/kg | 1 s^2/m^2*kg | 1 s^3/m^2*kg | 1 s^-1*A^-1 | 1 s^3*A/m^2*kg | 1 m^2*kg/s^4*A^2 | 1 S | 1 Ω | 1 s^2*A/m^2*kg | 1 s^2*A/kg | 1 s^2*A^2/m^2*kg | 1 m^2/cd | 1 s^2/m^2 | 1 s/mol 1 m | 1 m | 1 | 1 m/kg | 1 m/s | 1 m/A | 1 m/K | 1 m/mol | 1 m/cd | 1 m/B | 1 m*s | 1 s^2/kg | 1 m^2*s^2/kg | 1 s^2/m*kg | 1 s^3/m*kg | 1 m/s*A | 1 s^3*A/m*kg | 1 m^3*kg/s^4*A^2 | 1 s^3*A^2/m*kg | 1 m^3*kg/s^3*A^2 | 1 s^2*A/m*kg | 1 m*s^2*A/kg | 1 s^2*A^2/m*kg | 1 m^3/cd | 1 s^2/m | 1 m*s/mol 1 kg | 1 kg | 1 kg/m | 1 | 1 kg/s | 1 kg/A | 1 kg/K | 1 kg/mol | 1 kg/cd | 1 kg/B | 1 kg*s | 1 s^2/m | 1 m*s^2 | 1 s^2/m^2 | 1 s^3/m^2 | 1 kg/s*A | 1 s^3*A/m^2 | 1 m^2*kg^2/s^4*A^2 | 1 s^3*A^2/m^2 | 1 m^2*kg^2/s^3*A^2 | 1 s^2*A/m^2 | 1 s^2*A | 1 s^2*A^2/m^2 | 1 m^2*kg/cd | 1 kg*s^2/m^2 | 1 kg*s/mol 1 s | 1 s | 1 s/m | 1 s/kg | 1 | 1 s/A | 1 s/K | 1 s/mol | 1 s/cd | 1 s/B | 1 s^2 | 1 s^3/m*kg | 1 m*s^3/kg | 1 s^3/m^2*kg | 1 s^4/m^2*kg | 1 A^-1 | 1 s^4*A/m^2*kg | 1 Ω | 1 F | 1 H | 1 s^3*A/m^2*kg | 1 s^3*A/kg | 1 S | 1 m^2*s/cd | 1 s^3/m^2 | 1 s^2/mol 1 A | 1 A | 1 A/m | 1 A/kg | 1 A/s | 1 | 1 A/K | 1 A/mol | 1 A/cd | 1 A/B | 1 C | 1 s^2*A/m*kg | 1 m*s^2*A/kg | 1 s^2*A/m^2*kg | 1 s^3*A/m^2*kg | 1 Hz | 1 S | 1 m^2*kg/s^4*A | 1 s^3*A^3/m^2*kg | 1 V | 1 s^2*A^2/m^2*kg | 1 s^2*A^2/kg | 1 s^2*A^3/m^2*kg | 1 m^2*A/cd | 1 s^2*A/m^2 | 1 s*A/mol 1 K | 1 K | 1 K/m | 1 K/kg | 1 K/s | 1 K/A | 1 | 1 K/mol | 1 K/cd | 1 K/B | 1 s*K | 1 s^2*K/m*kg | 1 m*s^2*K/kg | 1 s^2*K/m^2*kg | 1 s^3*K/m^2*kg | 1 K/s*A | 1 s^3*A*K/m^2*kg | 1 m^2*kg*K/s^4*A^2 | 1 s^3*A^2*K/m^2*kg | 1 m^2*kg*K/s^3*A^2 | 1 s^2*A*K/m^2*kg | 1 s^2*A*K/kg | 1 s^2*A^2*K/m^2*kg | 1 m^2*K/cd | 1 s^2*K/m^2 | 1 s*K/mol 1 mol | 1 mol | 1 mol/m | 1 mol/kg | 1 kat | 1 mol/A | 1 mol/K | 1 | 1 mol/cd | 1 mol/B | 1 s*mol | 1 s^2*mol/m*kg | 1 m*s^2*mol/kg | 1 s^2*mol/m^2*kg | 1 s^3*mol/m^2*kg | 1 mol/s*A | 1 s^3*A*mol/m^2*kg | 1 m^2*kg*mol/s^4*A^2 | 1 s^3*A^2*mol/m^2*kg | 1 m^2*kg*mol/s^3*A^2 | 1 s^2*A*mol/m^2*kg | 1 s^2*A*mol/kg | 1 s^2*A^2*mol/m^2*kg | 1 m^2*mol/cd | 1 s^2*mol/m^2 | 1 s 1 cd | 1 cd | 1 cd/m | 1 cd/kg | 1 cd/s | 1 cd/A | 1 cd/K | 1 cd/mol | 1 | 1 cd/B | 1 s*cd | 1 s^2*cd/m*kg | 1 m*s^2*cd/kg | 1 s^2*cd/m^2*kg | 1 s^3*cd/m^2*kg | 1 cd/s*A | 1 s^3*A*cd/m^2*kg | 1 m^2*kg*cd/s^4*A^2 | 1 s^3*A^2*cd/m^2*kg | 1 m^2*kg*cd/s^3*A^2 | 1 s^2*A*cd/m^2*kg | 1 s^2*A*cd/kg | 1 s^2*A^2*cd/m^2*kg | 1 m^2 | 1 s^2*cd/m^2 | 1 s*cd/mol 1 B | 1 B | 1 B/m | 1 B/kg | 1 B/s | 1 B/A | 1 B/K | 1 B/mol | 1 B/cd | 1 | 1 s*B | 1 s^2*B/m*kg | 1 m*s^2*B/kg | 1 s^2*B/m^2*kg | 1 s^3*B/m^2*kg | 1 B/s*A | 1 s^3*A*B/m^2*kg | 1 m^2*kg*B/s^4*A^2 | 1 s^3*A^2*B/m^2*kg | 1 m^2*kg*B/s^3*A^2 | 1 s^2*A*B/m^2*kg | 1 s^2*A*B/kg | 1 s^2*A^2*B/m^2*kg | 1 m^2*B/cd | 1 s^2*B/m^2 | 1 s*B/mol 1 Hz | 1 Hz | 1 m^-1*s^-1 | 1 kg^-1*s^-1 | 1 s^-2 | 1 s^-1*A^-1 | 1 s^-1*K^-1 | 1 s^-1*mol^-1 | 1 s^-1*cd^-1 | 1 s^-1*B^-1 | 1 | 1 s/m*kg | 1 m*s/kg | 1 s/m^2*kg | 1 s^2/m^2*kg | 1 s^-2*A^-1 | 1 s^2*A/m^2*kg | 1 m^2*kg/s^5*A^2 | 1 s^2*A^2/m^2*kg | 1 m^2*kg/s^4*A^2 | 1 s*A/m^2*kg | 1 s*A/kg | 1 s*A^2/m^2*kg | 1 m^2/s*cd | 1 s/m^2 | 1 mol^-1 1 N | 1 N | 1 kg/s^2 | 1 m/s^2 | 1 m*kg/s^3 | 1 m*kg/s^2*A | 1 m*kg/s^2*K | 1 m*kg/s^2*mol | 1 m*kg/s^2*cd | 1 m*kg/s^2*B | 1 m*kg/s | 1 | 1 m^2 | 1 m^-1 | 1 s/m | 1 m*kg/s^3*A | 1 s*A/m | 1 m^3*kg^2/s^6*A^2 | 1 s*A^2/m | 1 m^3*kg^2/s^5*A^2 | 1 A/m | 1 m*A | 1 A^2/m | 1 m^3*kg/s^2*cd | 1 kg/m | 1 m*kg/s*mol 1 Pa | 1 Pa | 1 kg/m^2*s^2 | 1 m^-1*s^-2 | 1 kg/m*s^3 | 1 kg/m*s^2*A | 1 kg/m*s^2*K | 1 kg/m*s^2*mol | 1 kg/m*s^2*cd | 1 kg/m*s^2*B | 1 kg/m*s | 1 m^-2 | 1 | 1 m^-3 | 1 s/m^3 | 1 kg/m*s^3*A | 1 s*A/m^3 | 1 m*kg^2/s^6*A^2 | 1 s*A^2/m^3 | 1 m*kg^2/s^5*A^2 | 1 A/m^3 | 1 A/m | 1 A^2/m^3 | 1 m*kg/s^2*cd | 1 kg/m^3 | 1 kg/m*s*mol 1 J | 1 J | 1 N | 1 Gy | 1 W | 1 Wb | 1 m^2*kg/s^2*K | 1 m^2*kg/s^2*mol | 1 m^2*kg/s^2*cd | 1 m^2*kg/s^2*B | 1 m^2*kg/s | 1 m | 1 m^3 | 1 | 1 s | 1 V | 1 C | 1 m^4*kg^2/s^6*A^2 | 1 s*A^2 | 1 m^4*kg^2/s^5*A^2 | 1 A | 1 m^2*A | 1 A^2 | 1 m^4*kg/s^2*cd | 1 kg | 1 m^2*kg/s*mol 1 W | 1 W | 1 m*kg/s^3 | 1 m^2/s^3 | 1 m^2*kg/s^4 | 1 V | 1 m^2*kg/s^3*K | 1 m^2*kg/s^3*mol | 1 m^2*kg/s^3*cd | 1 m^2*kg/s^3*B | 1 J | 1 m/s | 1 m^3/s | 1 Hz | 1 | 1 m^2*kg/s^4*A | 1 A | 1 m^4*kg^2/s^7*A^2 | 1 A^2 | 1 m^4*kg^2/s^6*A^2 | 1 A/s | 1 m^2*A/s | 1 A^2/s | 1 m^4*kg/s^3*cd | 1 kg/s | 1 m^2*kg/s^2*mol 1 C | 1 C | 1 s*A/m | 1 s*A/kg | 1 A | 1 s | 1 s*A/K | 1 s*A/mol | 1 s*A/cd | 1 s*A/B | 1 s^2*A | 1 s^3*A/m*kg | 1 m*s^3*A/kg | 1 s^3*A/m^2*kg | 1 s^4*A/m^2*kg | 1 | 1 F | 1 V | 1 s^4*A^3/m^2*kg | 1 Wb | 1 S | 1 s^3*A^2/kg | 1 s^3*A^3/m^2*kg | 1 m^2*s*A/cd | 1 s^3*A/m^2 | 1 s^2*A/mol 1 V | 1 V | 1 m*kg/s^3*A | 1 m^2/s^3*A | 1 m^2*kg/s^4*A | 1 Ω | 1 m^2*kg/s^3*A*K | 1 m^2*kg/s^3*A*mol | 1 m^2*kg/s^3*A*cd | 1 m^2*kg/s^3*A*B | 1 Wb | 1 m/s*A | 1 m^3/s*A | 1 s^-1*A^-1 | 1 A^-1 | 1 m^2*kg/s^4*A^2 | 1 | 1 m^4*kg^2/s^7*A^3 | 1 A | 1 m^4*kg^2/s^6*A^3 | 1 Hz | 1 m^2/s | 1 A/s | 1 m^4*kg/s^3*A*cd | 1 kg/s*A | 1 m^2*kg/s^2*A*mol 1 F | 1 F | 1 s^4*A^2/m^3*kg | 1 s^4*A^2/m^2*kg^2 | 1 S | 1 s^4*A/m^2*kg | 1 s^4*A^2/m^2*kg*K | 1 s^4*A^2/m^2*kg*mol | 1 s^4*A^2/m^2*kg*cd | 1 s^4*A^2/m^2*kg*B | 1 s^5*A^2/m^2*kg | 1 s^6*A^2/m^3*kg^2 | 1 s^6*A^2/m*kg^2 | 1 s^6*A^2/m^4*kg^2 | 1 s^7*A^2/m^4*kg^2 | 1 s^3*A/m^2*kg | 1 s^7*A^3/m^4*kg^2 | 1 | 1 s^7*A^4/m^4*kg^2 | 1 s | 1 s^6*A^3/m^4*kg^2 | 1 s^6*A^3/m^2*kg^2 | 1 s^6*A^4/m^4*kg^2 | 1 s^4*A^2/kg*cd | 1 s^6*A^2/m^4*kg | 1 s^5*A^2/m^2*kg*mol 1 Ω | 1 Ω | 1 m*kg/s^3*A^2 | 1 m^2/s^3*A^2 | 1 m^2*kg/s^4*A^2 | 1 m^2*kg/s^3*A^3 | 1 m^2*kg/s^3*A^2*K | 1 m^2*kg/s^3*A^2*mol | 1 m^2*kg/s^3*A^2*cd | 1 m^2*kg/s^3*A^2*B | 1 H | 1 m/s*A^2 | 1 m^3/s*A^2 | 1 s^-1*A^-2 | 1 A^-2 | 1 m^2*kg/s^4*A^3 | 1 A^-1 | 1 m^4*kg^2/s^7*A^4 | 1 | 1 m^4*kg^2/s^6*A^4 | 1 s^-1*A^-1 | 1 m^2/s*A | 1 Hz | 1 m^4*kg/s^3*A^2*cd | 1 kg/s*A^2 | 1 m^2*kg/s^2*A^2*mol 1 S | 1 S | 1 s^3*A^2/m^3*kg | 1 s^3*A^2/m^2*kg^2 | 1 s^2*A^2/m^2*kg | 1 s^3*A/m^2*kg | 1 s^3*A^2/m^2*kg*K | 1 s^3*A^2/m^2*kg*mol | 1 s^3*A^2/m^2*kg*cd | 1 s^3*A^2/m^2*kg*B | 1 F | 1 s^5*A^2/m^3*kg^2 | 1 s^5*A^2/m*kg^2 | 1 s^5*A^2/m^4*kg^2 | 1 s^6*A^2/m^4*kg^2 | 1 s^2*A/m^2*kg | 1 s^6*A^3/m^4*kg^2 | 1 Hz | 1 s^6*A^4/m^4*kg^2 | 1 | 1 s^5*A^3/m^4*kg^2 | 1 s^5*A^3/m^2*kg^2 | 1 s^5*A^4/m^4*kg^2 | 1 s^3*A^2/kg*cd | 1 s^5*A^2/m^4*kg | 1 s^4*A^2/m^2*kg*mol 1 Wb | 1 Wb | 1 m*kg/s^2*A | 1 m^2/s^2*A | 1 V | 1 H | 1 m^2*kg/s^2*A*K | 1 m^2*kg/s^2*A*mol | 1 m^2*kg/s^2*A*cd | 1 m^2*kg/s^2*A*B | 1 m^2*kg/s*A | 1 m/A | 1 m^3/A | 1 A^-1 | 1 s/A | 1 Ω | 1 s | 1 m^4*kg^2/s^6*A^3 | 1 C | 1 m^4*kg^2/s^5*A^3 | 1 | 1 m^2 | 1 A | 1 m^4*kg/s^2*A*cd | 1 kg/A | 1 m^2*kg/s*A*mol 1 T | 1 T | 1 kg/m*s^2*A | 1 s^-2*A^-1 | 1 kg/s^3*A | 1 kg/s^2*A^2 | 1 kg/s^2*A*K | 1 kg/s^2*A*mol | 1 kg/s^2*A*cd | 1 kg/s^2*A*B | 1 kg/s*A | 1 m^-1*A^-1 | 1 m/A | 1 m^-2*A^-1 | 1 s/m^2*A | 1 kg/s^3*A^2 | 1 s/m^2 | 1 m^2*kg^2/s^6*A^3 | 1 s*A/m^2 | 1 m^2*kg^2/s^5*A^3 | 1 m^-2 | 1 | 1 A/m^2 | 1 m^2*kg/s^2*A*cd | 1 kg/m^2*A | 1 kg/s*A*mol 1 H | 1 H | 1 m*kg/s^2*A^2 | 1 m^2/s^2*A^2 | 1 Ω | 1 m^2*kg/s^2*A^3 | 1 m^2*kg/s^2*A^2*K | 1 m^2*kg/s^2*A^2*mol | 1 m^2*kg/s^2*A^2*cd | 1 m^2*kg/s^2*A^2*B | 1 m^2*kg/s*A^2 | 1 m/A^2 | 1 m^3/A^2 | 1 A^-2 | 1 s/A^2 | 1 m^2*kg/s^3*A^3 | 1 s/A | 1 m^4*kg^2/s^6*A^4 | 1 s | 1 m^4*kg^2/s^5*A^4 | 1 A^-1 | 1 m^2/A | 1 | 1 m^4*kg/s^2*A^2*cd | 1 kg/A^2 | 1 m^2*kg/s*A^2*mol 1 lx | 1 lx | 1 cd/m^3 | 1 cd/m^2*kg | 1 cd/m^2*s | 1 cd/m^2*A | 1 cd/m^2*K | 1 cd/m^2*mol | 1 m^-2 | 1 cd/m^2*B | 1 s*cd/m^2 | 1 s^2*cd/m^3*kg | 1 s^2*cd/m*kg | 1 s^2*cd/m^4*kg | 1 s^3*cd/m^4*kg | 1 cd/m^2*s*A | 1 s^3*A*cd/m^4*kg | 1 kg*cd/s^4*A^2 | 1 s^3*A^2*cd/m^4*kg | 1 kg*cd/s^3*A^2 | 1 s^2*A*cd/m^4*kg | 1 s^2*A*cd/m^2*kg | 1 s^2*A^2*cd/m^4*kg | 1 | 1 s^2*cd/m^4 | 1 s*cd/m^2*mol 1 Gy | 1 Gy | 1 m/s^2 | 1 m^2/kg*s^2 | 1 m^2/s^3 | 1 m^2/s^2*A | 1 m^2/s^2*K | 1 m^2/s^2*mol | 1 m^2/s^2*cd | 1 m^2/s^2*B | 1 m^2/s | 1 m/kg | 1 m^3/kg | 1 kg^-1 | 1 s/kg | 1 m^2/s^3*A | 1 s*A/kg | 1 m^4*kg/s^6*A^2 | 1 s*A^2/kg | 1 m^4*kg/s^5*A^2 | 1 A/kg | 1 m^2*A/kg | 1 A^2/kg | 1 m^4/s^2*cd | 1 | 1 m^2/s*mol 1 kat | 1 kat | 1 mol/m*s | 1 mol/kg*s | 1 mol/s^2 | 1 mol/s*A | 1 mol/s*K | 1 Hz | 1 mol/s*cd | 1 mol/s*B | 1 mol | 1 s*mol/m*kg | 1 m*s*mol/kg | 1 s*mol/m^2*kg | 1 s^2*mol/m^2*kg | 1 mol/s^2*A | 1 s^2*A*mol/m^2*kg | 1 m^2*kg*mol/s^5*A^2 | 1 s^2*A^2*mol/m^2*kg | 1 m^2*kg*mol/s^4*A^2 | 1 s*A*mol/m^2*kg | 1 s*A*mol/kg | 1 s*A^2*mol/m^2*kg | 1 m^2*mol/s*cd | 1 s*mol/m^2 | 1 (25 rows) -- test comparisons WITH v(u) AS (VALUES ('-2'::unit), ('-1'::unit), (-kilogram()), (-meter()), ('-0'::unit), ('0'::unit), ('1'::unit), (kilogram()), (meter()), ('2'::unit), (kilogram(2)), (meter(2)) ), va(a) AS (SELECT * FROM v), vb(b) AS (SELECT * FROM v) SELECT a, b, CASE WHEN unit_cmp(a, b) < 0 THEN '<' WHEN unit_cmp(a, b) = 0 THEN '=' WHEN unit_cmp(a, b) > 0 THEN '>' END AS cmp FROM va CROSS JOIN vb \crosstabview a | -2 | -1 | -1 kg | -1 m | -0 | 0 | 1 | 1 kg | 1 m | 2 | 2 kg | 2 m -------+----+----+-------+------+----+---+---+------+-----+---+------+----- -2 | = | < | < | < | < | < | < | < | < | < | < | < -1 | > | = | < | < | < | < | < | < | < | < | < | < -1 kg | > | > | = | < | < | < | < | < | < | < | < | < -1 m | > | > | > | = | < | < | < | < | < | < | < | < -0 | > | > | > | > | = | = | < | < | < | < | < | < 0 | > | > | > | > | = | = | < | < | < | < | < | < 1 | > | > | > | > | > | > | = | < | < | < | < | < 1 kg | > | > | > | > | > | > | > | = | < | < | < | < 1 m | > | > | > | > | > | > | > | > | = | < | < | < 2 | > | > | > | > | > | > | > | > | > | = | < | < 2 kg | > | > | > | > | > | > | > | > | > | > | = | < 2 m | > | > | > | > | > | > | > | > | > | > | > | = (12 rows) -- test all prefix/unit combinations SELECT u, p, (p||u)::unit FROM prefixes CROSS JOIN units WHERE u <> 'kg' AND (p||u) <> 'dat' -- ambiguous \crosstabview u | q | r | y | z | a | f | p | n | µ | mu | m | c | d | | da | h | k | M | G | T | P | E | Z | Y | R | Q -----+--------------------+---------------------+-----------------+-----------------+-----------------+-----------------+--------------------+-----------------+-----------------+-----------------+-----------------+-----------------+----------------+----------------+----------------+-------------------------------+-----------------+-----------------+------------------+---------------------+-------------------+-----------------+-----------------+-----------------+-----------------+----------------- m/m | 1e-30 | 1e-27 | 1e-24 | 1e-21 | 1e-18 | 1e-15 | 1e-12 | 1e-09 | 1e-06 | 1e-06 | 0.001 | 0.01 | 0.1 | 1 | 10 | 100 | 1000 | 1000000 | 1000000000 | 1000000000000 | 1e+15 | 1e+18 | 1e+21 | 1e+24 | 1e+27 | 1e+30 m | 1 qm | 1 rm | 1 ym | 1 zm | 1 am | 1 fm | 1 pm | 1 nm | 1 µm | 1 µm | 1 mm | 10 mm | 100 mm | 1 m | 10 m | 100 m | 1 km | 1 Mm | 1 Gm | 1 Tm | 1 Pm | 1 Em | 1 Zm | 1 Ym | 1 Rm | 1 Qm s | 1 qs | 1 rs | 1 ys | 1 zs | 1 as | 1 fs | 1 ps | 1 ns | 1 µs | 1 µs | 1 ms | 10 ms | 100 ms | 1 s | 10 s | 100 s | 1 ks | 1 Ms | 100 µT | 1 Ts | 1 Ps | 1 Es | 1 Zs | 1 Ys | 1 Rs | 1 Qs A | 1 qA | 1 rA | 1 yA | 1 zA | 1 aA | 1 fA | 1 pA | 1 nA | 1 µA | 1 µA | 1 mA | 10 mA | 100 mA | 1 A | 10 A | 100 A | 1 kA | 1 MA | 1 GA | 1 TA | 1 PA | 1 EA | 1 ZA | 1 YA | 1 RA | 1 QA K | 1 qK | 1 rK | 1 yK | 1 zK | 1 aK | 1 fK | 1 pK | 1 nK | 1 µK | 1 µK | 1 mK | 10 mK | 100 mK | 1 K | 10 K | 100 K | 1 kK | 1 MK | 1 GK | 1 TK | 1 PK | 1 EK | 1 ZK | 1 YK | 1 RK | 1 QK mol | 1 qmol | 1 rmol | 1 ymol | 1 zmol | 1 amol | 1 fmol | 1 pmol | 1 nmol | 1 µmol | 1 µmol | 1 mmol | 10 mmol | 100 mmol | 1 mol | 10 mol | 100 mol | 1 kmol | 1 Mmol | 1 Gmol | 1 Tmol | 1 Pmol | 1 Emol | 1 Zmol | 1 Ymol | 1 Rmol | 1 Qmol cd | 1 qcd | 1 rcd | 1 ycd | 1 zcd | 1 acd | 1 fcd | 1 pcd | 1 ncd | 1 µcd | 1 µcd | 1 mcd | 10 mcd | 100 mcd | 1 cd | 10 cd | 100 cd | 1 kcd | 1 Mcd | 1 Gcd | 1 Tcd | 1 Pcd | 1 Ecd | 1 Zcd | 1 Ycd | 1 Rcd | 1 Qcd B | 1 qB | 1 rB | 1 yB | 1 zB | 1 aB | 1 fB | 1 pB | 1 nB | 1 µB | 1 µB | 1 mB | 10 mB | 100 mB | 1 B | 10 B | 100 B | 1 kB | 1 MB | 1 GB | 1 TB | 1 PB | 1 EB | 1 ZB | 1 YB | 1 RB | 1 QB sr | 1e-30 | 1e-27 | 1e-24 | 1e-21 | 1e-18 | 1e-15 | 1e-12 | 1e-09 | 1e-06 | 1e-06 | 0.001 | 0.01 | 0.1 | 1 | 10 | 100 | 1000 | 1000000 | 1000000000 | 1000000000000 | 1e+15 | 1e+18 | 1e+21 | 1e+24 | 1e+27 | 1e+30 Hz | 1 qHz | 1 rHz | 1 yHz | 1 zHz | 1 aHz | 1 fHz | 1 pHz | 1 nHz | 1 µHz | 1 µHz | 1 mHz | 10 mHz | 100 mHz | 1 Hz | 10 Hz | 100 Hz | 1 kHz | 1 MHz | 1 GHz | 1 THz | 1 PHz | 1 EHz | 1 ZHz | 1 YHz | 1 RHz | 1 QHz N | 1 qN | 1 rN | 1 yN | 1 zN | 1 aN | 1 fN | 1 pN | 1 nN | 1 µN | 1 µN | 1 mN | 10 mN | 100 mN | 1 N | 10 N | 100 N | 1 kN | 1 MN | 1 GN | 1 TN | 1 PN | 1 EN | 1 ZN | 1 YN | 1 RN | 1 QN Pa | 1 qPa | 1 rPa | 1 yPa | 1 zPa | 1 aPa | 1 fPa | 1 pPa | 1 nPa | 1 µPa | 1 µPa | 1 mPa | 10 mPa | 100 mPa | 1 Pa | 10 Pa | 100 Pa | 1 kPa | 1 MPa | 1 GPa | 1 TPa | 1 PPa | 1 EPa | 1 ZPa | 1 YPa | 1 RPa | 1 QPa J | 1 qJ | 1 rJ | 1 yJ | 1 zJ | 1 aJ | 1 fJ | 1 pJ | 1 nJ | 1 µJ | 1 µJ | 1 mJ | 10 mJ | 100 mJ | 1 J | 10 J | 100 J | 1 kJ | 1 MJ | 1 GJ | 1 TJ | 1 PJ | 1 EJ | 1 ZJ | 1 YJ | 1 RJ | 1 QJ W | 1 qW | 1 rW | 1 yW | 1 zW | 1 aW | 1 fW | 1 pW | 1 nW | 1 µW | 1 µW | 1 mW | 10 mW | 100 mW | 1 W | 10 W | 100 W | 1 kW | 1 MW | 1 GW | 1 TW | 1 PW | 1 EW | 1 ZW | 1 YW | 1 RW | 1 QW C | 1 qC | 1 rC | 1 yC | 1 zC | 1 aC | 1 fC | 1 pC | 1 nC | 1 µC | 1 µC | 1 mC | 10 mC | 100 mC | 1 C | 10 C | 100 C | 1 kC | 1 MC | 1 GC | 1 TC | 1 PC | 1 EC | 1 ZC | 1 YC | 1 RC | 1 QC V | 1 qV | 1 rV | 1 yV | 1 zV | 1 aV | 1 fV | 1 pV | 1 nV | 1 µV | 1 µV | 1 mV | 10 mV | 100 mV | 1 V | 10 V | 100 V | 1 kV | 1 MV | 1 GV | 1 TV | 1 PV | 1 EV | 1 ZV | 1 YV | 1 RV | 1 QV F | 1 qF | 1 rF | 1 yF | 1 zF | 1 aF | 1 fF | 1 pF | 1 nF | 1 µF | 1 µF | 1 mF | 10 mF | 100 mF | 1 F | 10 F | 100 F | 1 kF | 1 MF | 1 GF | 1 TF | 1 PF | 1 EF | 1 ZF | 1 YF | 1 RF | 1 QF Ω | 1 qΩ | 1 rΩ | 1 yΩ | 1 zΩ | 1 aΩ | 1 fΩ | 1 pΩ | 1 nΩ | 1 µΩ | 1 µΩ | 1 mΩ | 10 mΩ | 100 mΩ | 1 Ω | 10 Ω | 100 Ω | 1 kΩ | 1 MΩ | 1 GΩ | 1 TΩ | 1 PΩ | 1 EΩ | 1 ZΩ | 1 YΩ | 1 RΩ | 1 QΩ ohm | 1 qΩ | 1 rΩ | 1 yΩ | 1 zΩ | 1 aΩ | 1 fΩ | 1 pΩ | 1 nΩ | 1 µΩ | 1 µΩ | 1 mΩ | 10 mΩ | 100 mΩ | 1 Ω | 10 Ω | 100 Ω | 1 kΩ | 1 MΩ | 1 GΩ | 1 TΩ | 1 PΩ | 1 EΩ | 1 ZΩ | 1 YΩ | 1 RΩ | 1 QΩ S | 1 qS | 1 rS | 1 yS | 1 zS | 1 aS | 1 fS | 1 pS | 1 nS | 1 µS | 1 µS | 1 mS | 10 mS | 100 mS | 1 S | 10 S | 100 S | 1 kS | 1 MS | 1 GS | 1 TS | 1 PS | 1 ES | 1 ZS | 1 YS | 1 RS | 1 QS Wb | 1 qWb | 1 rWb | 1 yWb | 1 zWb | 1 aWb | 1 fWb | 1 pWb | 1 nWb | 1 µWb | 1 µWb | 1 mWb | 10 mWb | 100 mWb | 1 Wb | 10 Wb | 100 Wb | 1 kWb | 1 MWb | 1 GWb | 1 TWb | 1 PWb | 1 EWb | 1 ZWb | 1 YWb | 1 RWb | 1 QWb T | 1 qT | 1 rT | 1 yT | 1 zT | 1 aT | 1 fT | 1 pT | 1 nT | 1 µT | 1 µT | 1 mT | 10 mT | 100 mT | 1 T | 10 T | 100 T | 1 kT | 1 MT | 1 GT | 1 TT | 1 PT | 1 ET | 1 ZT | 1 YT | 1 RT | 1 QT H | 1 qH | 1 rH | 1 yH | 1 zH | 1 aH | 1 fH | 1 pH | 1 nH | 1 µH | 1 µH | 1 mH | 10 mH | 100 mH | 1 H | 10 H | 100 H | 1 kH | 1 MH | 1 GH | 1 TH | 1 PH | 1 EH | 1 ZH | 1 YH | 1 RH | 1 QH °C | 1 qK | 1 rK | 1 yK | 1 zK | 1 aK | 1 fK | 1 pK | 1 nK | 1 µK | 1 µK | 1 mK | 10 mK | 100 mK | 1 K | 10 K | 100 K | 1 kK | 1 MK | 1 GK | 1 TK | 1 PK | 1 EK | 1 ZK | 1 YK | 1 RK | 1 QK lm | 1 qcd | 1 rcd | 1 ycd | 1 zcd | 1 acd | 1 fcd | 1 pcd | 1 ncd | 1 µcd | 1 µcd | 1 mcd | 10 mcd | 100 mcd | 1 cd | 10 cd | 100 cd | 1 kcd | 1 Mcd | 1 Gcd | 1 Tcd | 1 Pcd | 1 Ecd | 1 Zcd | 1 Ycd | 1 Rcd | 1 Qcd lx | 1 qlx | 1 rlx | 1 ylx | 1 zlx | 1 alx | 1 flx | 1 plx | 1 nlx | 1 µlx | 1 µlx | 1 mlx | 10 mlx | 100 mlx | 1 lx | 10 lx | 100 lx | 1 klx | 1 Mlx | 1 Glx | 1 Tlx | 1 Plx | 1 Elx | 1 Zlx | 1 Ylx | 1 Rlx | 1 Qlx Bq | 1 qHz | 1 rHz | 1 yHz | 1 zHz | 1 aHz | 1 fHz | 1 pHz | 1 nHz | 1 µHz | 1 µHz | 1 mHz | 10 mHz | 100 mHz | 1 Hz | 10 Hz | 100 Hz | 1 kHz | 1 MHz | 1 GHz | 1 THz | 1 PHz | 1 EHz | 1 ZHz | 1 YHz | 1 RHz | 1 QHz Gy | 1 qGy | 1 rGy | 1 yGy | 1 zGy | 1 aGy | 1 fGy | 1 pGy | 1 nGy | 1 µGy | 1 µGy | 1 mGy | 10 mGy | 100 mGy | 1 Gy | 10 Gy | 100 Gy | 1 kGy | 1 MGy | 1 GGy | 1 TGy | 1 PGy | 1 EGy | 1 ZGy | 1 YGy | 1 RGy | 1 QGy rad | 1e-32 Gy | 10 qGy | 10 rGy | 10 yGy | 10 zGy | 10 aGy | 10 fGy | 10 pGy | 10 nGy | 10 nGy | 10 µGy | 100 µGy | 1 mGy | 10 mGy | 100 mGy | 1 Gy | 10 Gy | 10 kGy | 10 MGy | 10 GGy | 10 TGy | 10 PGy | 10 EGy | 10 ZGy | 10 YGy | 10 RGy Sv | 1 qGy | 1 rGy | 1 yGy | 1 zGy | 1 aGy | 1 fGy | 1 pGy | 1 nGy | 1 µGy | 1 µGy | 1 mGy | 10 mGy | 100 mGy | 1 Gy | 10 Gy | 100 Gy | 1 kGy | 1 MGy | 1 GGy | 1 TGy | 1 PGy | 1 EGy | 1 ZGy | 1 YGy | 1 RGy | 1 QGy kat | 1 qkat | 1 rkat | 1 ykat | 1 zkat | 1 akat | 1 fkat | 1 pkat | 1 nkat | 1 µkat | 1 µkat | 1 mkat | 10 mkat | 100 mkat | 1 kat | 10 kat | 100 kat | 1 kkat | 1 Mkat | 1 Gkat | 1 Tkat | 1 Pkat | 1 Ekat | 1 Zkat | 1 Ykat | 1 Rkat | 1 Qkat g | 1 qg | 1 rg | 1 yg | 1 zg | 1 ag | 1 fg | 1 pg | 1 ng | 1 µg | 1 µg | 1 mg | 10 mg | 100 mg | 1 g | 10 g | 100 g | 1 kg | 1 Mg | 1 Gg | 1 Tg | 1 Pg | 1 Eg | 1 Zg | 1 Yg | 1 Rg | 1 Qg a | 1e-28 m^2 | 1e-25 m^2 | 1e-22 m^2 | 1e-19 m^2 | 1e-16 m^2 | 1e-13 m^2 | 1 Pa | 1e-07 m^2 | 0.0001 m^2 | 0.0001 m^2 | 0.1 m^2 | 1 m^2 | 86.4 ks | 100 m^2 | 1000 m^2 | 10000 m^2 | 100000 m^2 | 100000000 m^2 | 100000000000 m^2 | 100000000000000 m^2 | 1 Pa | 1e+20 m^2 | 1e+23 m^2 | 1e+26 m^2 | 1e+29 m^2 | 1e+32 m^2 l | 1e-33 m^3 | 1e-30 m^3 | 1e-27 m^3 | 1e-24 m^3 | 1e-21 m^3 | 1e-18 m^3 | 1e-15 m^3 | 1e-12 m^3 | 1e-09 m^3 | 1e-09 m^3 | 1e-06 m^3 | 1e-05 m^3 | 0.0001 m^3 | 0.001 m^3 | 0.01 m^3 | 0.1 m^3 | 1 m^3 | 1000 m^3 | 1000000 m^3 | 1000000000 m^3 | 1000000000000 m^3 | 1e+15 m^3 | 1e+18 m^3 | 1e+21 m^3 | 1e+24 m^3 | 1e+27 m^3 t | 0.000946352946 m^3 | 1 zg | 1 ag | 1 fg | 98.0665 kPa | 304.8 mm | 0.000473176473 m^3 | 1 N | 1 g | 1 g | 1 kg | 200 mg | 100 kg | 1 Mg | | 100 Mg | 1 Gg | 1 Tg | 1 Pg | 1 Eg | 1 Zg | 1 Yg | 1 Rg | 1 Qg | 1e+30 kg | 1e+33 kg bar | 100 rPa | 100 yPa | 100 zPa | 100 aPa | 100 fPa | 100 pPa | 100 nPa | 100 µPa | 100 mPa | 100 mPa | 100 Pa | 1 kPa | 10 kPa | 100 kPa | 1 MPa | 1.05457181764616e-34 m^2*kg/s | 100 MPa | 100 GPa | 100 TPa | 100 PPa | 100 EPa | 100 ZPa | 100 YPa | 100 RPa | 100 QPa | 1e+35 Pa min | 60 qs | 60 rs | 60 ys | 60 zs | 60 as | 60 fs | 60 ps | 60 ns | 60 µs | 60 µs | 60 ms | 600 ms | 6 s | 60 s | 600 s | 6 ks | 60 ks | 60 Ms | 60 Gsec | 60 Ts | 60 Ps | 60 Es | 60 Zs | 60 Ys | 60 Rs | 60 Qs hr | 3.6 rs | 3.6 ys | 3.6 zs | 3.6 as | 3.6 fs | 3.6 ps | 3.6 ns | 3.6 µs | 3.6 ms | 3.6 ms | 3.6 s | 36 s | 360 s | 3.6 ks | 36 ks | 360 ks | 3.6 Ms | 3.6 Gsec | 3.6 Ts | 3.6 Ps | 3.6 Es | 3.6 Zs | 3.6 Ys | 3.6 Rs | 3.6 Qs | 3.6e+33 s d | 86.4 rs | 5.0292 m | 914.4 mm | 86.4 as | 86.4 fs | 86.4 ps | 86.4 ns | 86.4 µs | 86.4 ms | 86.4 ms | 86.4 s | 1 cd | 8.64 ks | 86.4 ks | 864 ks | 0.238480942392 m^3 | 86.4 Ms | 86.4 Gsec | 86.4 Ts | 86.4 Ps | 86.4 Es | 86.4 Zs | 86.4 Ys | 86.4 Rs | 86.4 Qs | 8.64e+34 s in | 2.54e-32 m | 303.030303030303 µm | 25.4 rm | 25.4 ym | 25.4 zm | 25.4 am | 0.020457405 m^3 | 25.4 pm | 25.4 nm | 25.4 nm | 60 s | 254 µm | 2.54 mm | 25.4 mm | 254 mm | 2.54 m | 600 g | 25.4 km | 25.4 Mm | 25.4 Gm | 25.4 Tm | 25.4 Pm | 25.4 Em | 25.4 Zm | 25.4 Ym | 25.4 Rm ft | 3.048e-31 m | 304.8 qm | 304.8 rm | 304.8 ym | 304.8 zm | 304.8 am | 304.8 fm | 304.8 pm | 304.8 nm | 304.8 nm | 304.8 µm | 3.048 mm | 30.48 mm | 304.8 mm | 3.048 m | 30.48 m | 304.8 m | 304.8 km | 304.8 Mm | 304.8 Gm | 304.8 Tm | 304.8 Pm | 304.8 Em | 304.8 Zm | 304.8 Ym | 304.8 Rm yd | 9.144e-31 m | 914.4 qm | 914.4 rm | 914.4 ym | 914.4 zm | 914.4 am | 914.4 fm | 914.4 pm | 914.4 nm | 914.4 nm | 914.4 µm | 9.144 mm | 91.44 mm | 914.4 mm | 9.144 m | 91.44 m | 914.4 m | 914.4 km | 914.4 Mm | 914.4 Gm | 914.4 Tm | 914.4 Pm | 914.4 Em | 914.4 Zm | 914.4 Ym | 914.4 Rm mi | 1.609344 rm | 1.609344 ym | 1.609344 zm | 1.609344 am | 1.609344 fm | 1.609344 pm | 1.609344 nm | 1.852 km | 1.609344 mm | 1.609344 mm | 1.609344 m | 16.09344 m | 160.9344 m | 1.609344 km | 16.09344 km | 160.9344 km | 1.609344 Mm | 1.609344 Gm | 1.609344 Tm | 1.609344 Pm | 1.609344 Em | 1.609344 Zm | 1.609344 Ym | 1.609344 Rm | 1.609344 Qm | 1.609344e+33 m oz | 28.349523125 qg | 28.349523125 rg | 28.349523125 yg | 28.349523125 zg | 28.349523125 ag | 28.349523125 fg | 28.349523125 pg | 28.349523125 ng | 28.349523125 µg | 28.349523125 µg | 28.349523125 mg | 283.49523125 mg | 2.8349523125 g | 28.349523125 g | 283.49523125 g | 2.8349523125 kg | 28.349523125 kg | 28.349523125 Mg | 28.349523125 Gg | 28.349523125 Tg | 28.349523125 Pg | 28.349523125 Eg | 28.349523125 Zg | 28.349523125 Yg | 28.349523125 Rg | 28.349523125 Qg lb | 453.59237 qg | 453.59237 rg | 453.59237 yg | 453.59237 zg | 453.59237 ag | 453.59237 fg | 453.59237 pg | 453.59237 ng | 453.59237 µg | 453.59237 µg | 453.59237 mg | 4.5359237 g | 45.359237 g | 453.59237 g | 4.5359237 kg | 45.359237 kg | 453.59237 kg | 453.59237 Mg | 453.59237 Gg | 453.59237 Tg | 453.59237 Pg | 453.59237 Eg | 453.59237 Zg | 453.59237 Yg | 453.59237 Rg | 453.59237 Qg (45 rows) postgresql-unit-7.8/expected/custom.out000066400000000000000000000027021450213077700204230ustar00rootroot00000000000000SELECT '1 foobar'::unit; ERROR: unit "foobar" is not known LINE 1: SELECT '1 foobar'::unit; ^ SELECT unit_is_hashed('foobar'); unit_is_hashed ---------------- f (1 row) INSERT INTO unit_prefixes VALUES ('foo', 42); SELECT '1 foobar'::unit; unit --------- 4.2 MPa (1 row) SELECT unit_is_hashed('foobar'); unit_is_hashed ---------------- t (1 row) SELECT * FROM unit_prefixes WHERE dump; prefix | factor | definition | dump --------+--------+------------+------ foo | 42 | | t (1 row) INSERT INTO unit_units VALUES ('legobrick', '9.6 mm'); SELECT unit_is_hashed('legobricks'); unit_is_hashed ---------------- f (1 row) SELECT '1 m'::unit @ 'legobricks' AS one_meter; one_meter ----------------------------- 104.166666666667 legobricks (1 row) SELECT unit_is_hashed('legobricks'); unit_is_hashed ---------------- t (1 row) SELECT * FROM unit_units WHERE dump; name | unit | shift | definition | dump -----------+--------+-------+------------+------ legobrick | 9.6 mm | | | t (1 row) UPDATE unit_units SET unit = '19.1 mm' WHERE name = 'legobrick'; -- Duplo size SELECT '2 legobricks'::unit AS old_size; old_size ---------- 19.2 mm (1 row) SELECT unit_reset(); unit_reset ------------ (1 row) SELECT unit_is_hashed('legobricks'); unit_is_hashed ---------------- f (1 row) SELECT '2 legobricks'::unit AS new_size; new_size ---------- 38.2 mm (1 row) postgresql-unit-7.8/expected/derived.out000066400000000000000000000232631450213077700205400ustar00rootroot00000000000000-- derived units SELECT radian(); radian -------- 1 (1 row) SELECT steradian(); steradian ----------- 1 (1 row) SELECT hertz(); hertz ------- 1 Hz (1 row) SELECT newton(); newton -------- 1 N (1 row) SELECT pascal(); pascal -------- 1 Pa (1 row) SELECT joule(); joule ------- 1 J (1 row) SELECT watt(); watt ------ 1 W (1 row) SELECT coulomb(); coulomb --------- 1 C (1 row) SELECT volt(); volt ------ 1 V (1 row) SELECT farad(); farad ------- 1 F (1 row) SELECT ohm(); ohm ----- 1 Ω (1 row) SELECT siemens(); siemens --------- 1 S (1 row) SELECT weber(); weber ------- 1 Wb (1 row) SELECT tesla(); tesla ------- 1 T (1 row) SELECT henry(); henry ------- 1 H (1 row) SELECT celsius(); celsius ---------- 273.15 K (1 row) SELECT lumen(); lumen ------- 1 cd (1 row) SELECT lux(); lux ------ 1 lx (1 row) SELECT becquerel(); becquerel ----------- 1 Hz (1 row) SELECT gray(); gray ------ 1 Gy (1 row) SELECT sievert(); sievert --------- 1 Gy (1 row) SELECT katal(); katal ------- 1 kat (1 row) SELECT radian(2); radian -------- 2 (1 row) SELECT steradian(2); steradian ----------- 2 (1 row) SELECT hertz(2); hertz ------- 2 Hz (1 row) SELECT newton(2); newton -------- 2 N (1 row) SELECT pascal(2); pascal -------- 2 Pa (1 row) SELECT joule(2); joule ------- 2 J (1 row) SELECT watt(2); watt ------ 2 W (1 row) SELECT coulomb(2); coulomb --------- 2 C (1 row) SELECT volt(2); volt ------ 2 V (1 row) SELECT farad(2); farad ------- 2 F (1 row) SELECT ohm(2); ohm ----- 2 Ω (1 row) SELECT siemens(2); siemens --------- 2 S (1 row) SELECT weber(2); weber ------- 2 Wb (1 row) SELECT tesla(2); tesla ------- 2 T (1 row) SELECT henry(2); henry ------- 2 H (1 row) SELECT celsius(100); celsius ---------- 373.15 K (1 row) SELECT lumen(2); lumen ------- 2 cd (1 row) SELECT lux(2); lux ------ 2 lx (1 row) SELECT becquerel(2); becquerel ----------- 2 Hz (1 row) SELECT gray(2); gray ------ 2 Gy (1 row) SELECT sievert(2); sievert --------- 2 Gy (1 row) SELECT katal(2); katal ------- 2 kat (1 row) /* revert to pre-12 default for decibel() tests */ SET extra_float_digits = 0; -- Non-SI units accepted for use with the SI SELECT minute(); minute ------------ 00:01:00 s (1 row) SELECT hour(); hour ------------ 01:00:00 s (1 row) SELECT day(); day ----- 1 d (1 row) SELECT degree_arc(); degree_arc -------------------- 0.0174532925199433 (1 row) SELECT minute_arc(); minute_arc ---------------------- 0.000290888208665722 (1 row) SELECT second_arc(); second_arc ---------------------- 4.84813681109536e-06 (1 row) SELECT hectare(); hectare ----------- 10000 m^2 (1 row) SELECT liter(); liter ----------- 0.001 m^3 (1 row) SELECT tonne(); tonne ------- 1 Mg (1 row) SELECT au(); au ---------------- 149.5978707 Gm (1 row) SELECT decibel(); decibel --------- 1 (1 row) SELECT minute(60); minute ------------ 01:00:00 s (1 row) SELECT hour(24); hour ------ 1 d (1 row) SELECT day(1/24.0); day ------------ 01:00:00 s (1 row) SELECT degree_arc(360); degree_arc ------------------ 6.28318530717959 (1 row) SELECT minute_arc(60); minute_arc -------------------- 0.0174532925199433 (1 row) SELECT second_arc(60); second_arc ---------------------- 0.000290888208665722 (1 row) SELECT hectare(1/100.0); hectare --------- 100 m^2 (1 row) SELECT liter(1000); liter ------- 1 m^3 (1 row) SELECT tonne(1/1000.0); tonne ------- 1 kg (1 row) SELECT au(10); au ---------------- 1.495978707 Tm (1 row) SELECT decibel(-3); decibel ------------------- 0.501187233627272 (1 row) SELECT decibel(3); decibel ------------------ 1.99526231496888 (1 row) SELECT decibel(10); decibel --------- 10 (1 row) SELECT decibel(20); decibel --------- 100 (1 row) SET client_min_messages = warning; DROP TABLE IF EXISTS u; RESET client_min_messages; CREATE TABLE u AS SELECT unit AS u, 2000 * unit AS "2k", unit/5000 AS "200µ", 0.002/unit AS "500th_inverse", (40*unit)^2 AS "1600_square" FROM units WHERE base OR coherent; SELECT * FROM u; u | 2k | 200µ | 500th_inverse | 1600_square -------+------------+----------+----------------------+----------------------- 1 | 2000 | 0.0002 | 0.002 | 1600 1 m | 2 km | 200 µm | 0.002 m^-1 | 1600 m^2 1 kg | 2 Mg | 200 mg | 0.002 kg^-1 | 1600 kg^2 1 s | 00:33:20 s | 200 µs | 2 mHz | 1600 s^2 1 A | 2 kA | 200 µA | 0.002 A^-1 | 1600 A^2 1 K | 2 kK | 200 µK | 0.002 K^-1 | 1600 K^2 1 mol | 2 kmol | 200 µmol | 0.002 mol^-1 | 1600 mol^2 1 cd | 2 kcd | 200 µcd | 0.002 cd^-1 | 1600 cd^2 1 B | 2 kB | 200 µB | 0.002 B^-1 | 1600 B^2 1 | 2000 | 0.0002 | 0.002 | 1600 1 Hz | 2 kHz | 200 µHz | 2 ms | 1600 s^-2 1 N | 2 kN | 200 µN | 0.002 s^2/m*kg | 1600 m^2*kg^2/s^4 1 Pa | 2 kPa | 200 µPa | 0.002 m*s^2/kg | 1600 kg^2/m^2*s^4 1 J | 2 kJ | 200 µJ | 0.002 s^2/m^2*kg | 1600 m^4*kg^2/s^4 1 W | 2 kW | 200 µW | 0.002 s^3/m^2*kg | 1600 m^4*kg^2/s^6 1 C | 2 kC | 200 µC | 0.002 s^-1*A^-1 | 1600 s^2*A^2 1 V | 2 kV | 200 µV | 0.002 s^3*A/m^2*kg | 1600 m^4*kg^2/s^6*A^2 1 F | 2 kF | 200 µF | 0.002 m^2*kg/s^4*A^2 | 1600 s^8*A^4/m^4*kg^2 1 Ω | 2 kΩ | 200 µΩ | 2 mS | 1600 m^4*kg^2/s^6*A^4 1 Ω | 2 kΩ | 200 µΩ | 2 mS | 1600 m^4*kg^2/s^6*A^4 1 S | 2 kS | 200 µS | 2 mΩ | 1600 s^6*A^4/m^4*kg^2 1 Wb | 2 kWb | 200 µWb | 0.002 s^2*A/m^2*kg | 1600 m^4*kg^2/s^4*A^2 1 T | 2 kT | 200 µT | 0.002 s^2*A/kg | 1600 kg^2/s^4*A^2 1 H | 2 kH | 200 µH | 0.002 s^2*A^2/m^2*kg | 1600 m^4*kg^2/s^4*A^4 1 K | 2 kK | 200 µK | 0.002 K^-1 | 1600 K^2 1 cd | 2 kcd | 200 µcd | 0.002 cd^-1 | 1600 cd^2 1 lx | 2 klx | 200 µlx | 0.002 m^2/cd | 1600 cd^2/m^4 1 Hz | 2 kHz | 200 µHz | 2 ms | 1600 s^-2 1 Gy | 2 kGy | 200 µGy | 0.002 s^2/m^2 | 1600 m^4/s^4 1 Gy | 2 kGy | 200 µGy | 0.002 s^2/m^2 | 1600 m^4/s^4 1 kat | 2 kkat | 200 µkat | 2 ms/mol | 1600 mol^2/s^2 (31 rows) SELECT u, u::text::unit AS "text::unit", "2k"::text::unit, "200µ"::text::unit, "500th_inverse"::text::unit, "1600_square"::text::unit FROM u; u | text::unit | 2k | 200µ | 500th_inverse | 1600_square -------+------------+------------+----------+----------------------+----------------------- 1 | 1 | 2000 | 0.0002 | 0.002 | 1600 1 m | 1 m | 2 km | 200 µm | 0.002 m^-1 | 1600 m^2 1 kg | 1 kg | 2 Mg | 200 mg | 0.002 kg^-1 | 1600 kg^2 1 s | 1 s | 00:33:20 s | 200 µs | 2 mHz | 1600 s^2 1 A | 1 A | 2 kA | 200 µA | 0.002 A^-1 | 1600 A^2 1 K | 1 K | 2 kK | 200 µK | 0.002 K^-1 | 1600 K^2 1 mol | 1 mol | 2 kmol | 200 µmol | 0.002 mol^-1 | 1600 mol^2 1 cd | 1 cd | 2 kcd | 200 µcd | 0.002 cd^-1 | 1600 cd^2 1 B | 1 B | 2 kB | 200 µB | 0.002 B^-1 | 1600 B^2 1 | 1 | 2000 | 0.0002 | 0.002 | 1600 1 Hz | 1 Hz | 2 kHz | 200 µHz | 2 ms | 1600 s^-2 1 N | 1 N | 2 kN | 200 µN | 0.002 s^2/m*kg | 1600 m^2*kg^2/s^4 1 Pa | 1 Pa | 2 kPa | 200 µPa | 0.002 m*s^2/kg | 1600 kg^2/m^2*s^4 1 J | 1 J | 2 kJ | 200 µJ | 0.002 s^2/m^2*kg | 1600 m^4*kg^2/s^4 1 W | 1 W | 2 kW | 200 µW | 0.002 s^3/m^2*kg | 1600 m^4*kg^2/s^6 1 C | 1 C | 2 kC | 200 µC | 0.002 s^-1*A^-1 | 1600 s^2*A^2 1 V | 1 V | 2 kV | 200 µV | 0.002 s^3*A/m^2*kg | 1600 m^4*kg^2/s^6*A^2 1 F | 1 F | 2 kF | 200 µF | 0.002 m^2*kg/s^4*A^2 | 1600 s^8*A^4/m^4*kg^2 1 Ω | 1 Ω | 2 kΩ | 200 µΩ | 2 mS | 1600 m^4*kg^2/s^6*A^4 1 Ω | 1 Ω | 2 kΩ | 200 µΩ | 2 mS | 1600 m^4*kg^2/s^6*A^4 1 S | 1 S | 2 kS | 200 µS | 2 mΩ | 1600 s^6*A^4/m^4*kg^2 1 Wb | 1 Wb | 2 kWb | 200 µWb | 0.002 s^2*A/m^2*kg | 1600 m^4*kg^2/s^4*A^2 1 T | 1 T | 2 kT | 200 µT | 0.002 s^2*A/kg | 1600 kg^2/s^4*A^2 1 H | 1 H | 2 kH | 200 µH | 0.002 s^2*A^2/m^2*kg | 1600 m^4*kg^2/s^4*A^4 1 K | 1 K | 2 kK | 200 µK | 0.002 K^-1 | 1600 K^2 1 cd | 1 cd | 2 kcd | 200 µcd | 0.002 cd^-1 | 1600 cd^2 1 lx | 1 lx | 2 klx | 200 µlx | 0.002 m^2/cd | 1600 cd^2/m^4 1 Hz | 1 Hz | 2 kHz | 200 µHz | 2 ms | 1600 s^-2 1 Gy | 1 Gy | 2 kGy | 200 µGy | 0.002 s^2/m^2 | 1600 m^4/s^4 1 Gy | 1 Gy | 2 kGy | 200 µGy | 0.002 s^2/m^2 | 1600 m^4/s^4 1 kat | 1 kat | 2 kkat | 200 µkat | 2 ms/mol | 1600 mol^2/s^2 (31 rows) -- test i/o SELECT a.u, b.u, (a.u::unit*b.u::unit)::text, (a.u::unit*b.u::unit)::text::unit FROM units a CROSS JOIN units b WHERE (a.u::unit*b.u::unit)::text != (a.u::unit*b.u::unit)::text::unit::text; u | u | text | unit ---+---+------+------ (0 rows) postgresql-unit-7.8/expected/extension.out000066400000000000000000000001431450213077700211220ustar00rootroot00000000000000SET client_min_messages = warning; CREATE EXTENSION IF NOT EXISTS unit; RESET client_min_messages; postgresql-unit-7.8/expected/functions.out000066400000000000000000000216171450213077700211270ustar00rootroot00000000000000-- test functions SELECT value('2'::unit); value ------- 2 (1 row) SELECT value(meter(2)); value ------- 2 (1 row) SELECT dimension('2'::unit); dimension ----------- 1 (1 row) SELECT dimension(kilogram(2)); dimension ----------- 1 kg (1 row) -- test unit addition/subtraction SELECT '1'::unit + '2' AS sum; sum ----- 3 (1 row) SELECT '1'::unit - '2' AS difference; difference ------------ -1 (1 row) SELECT '3 m'::unit - '1 µm' AS difference; difference ------------ 2.999999 m (1 row) SELECT '0' + meter() AS error; ERROR: dimension mismatch in "+" operation: "0", "1 m" SELECT meter() + '0' AS error; ERROR: dimension mismatch in "+" operation: "1 m", "0" SELECT meter() + kilogram() AS error; ERROR: dimension mismatch in "+" operation: "1 m", "1 kg" SELECT meter() - kilogram() AS error; ERROR: dimension mismatch in "-" operation: "1 m", "1 kg" -- test unit multiplication/division SELECT - '1'::unit AS negative; negative ---------- -1 (1 row) SELECT '2'::unit * '2' AS product; product --------- 4 (1 row) SELECT '5'::unit / '2' AS fraction; fraction ---------- 2.5 (1 row) SELECT '0'::unit / '2' AS zero; zero ------ 0 (1 row) SELECT '5'::unit / '0' AS division_by_zero; ERROR: division by zero-valued unit: "0" SELECT - second() AS minus_second; minus_second -------------- -1 s (1 row) SELECT meter() * '2' AS two_meters; two_meters ------------ 2 m (1 row) SELECT '3' * meter() AS three_meters; three_meters -------------- 3 m (1 row) SELECT meter() * meter() AS square_meter; square_meter -------------- 1 m^2 (1 row) SELECT meter() * kilogram() AS meter_kilogram; meter_kilogram ---------------- 1 m*kg (1 row) SELECT '1' / second(.02) AS hertz; hertz ------- 50 Hz (1 row) SELECT meter(9.81) / (second() * second()) AS acceleration; acceleration -------------- 9.81 m/s^2 (1 row) -- test unit/double operators SELECT 2 * meter() AS two_meters; two_meters ------------ 2 m (1 row) SELECT ampere() * 3 AS three_ampere; three_ampere -------------- 3 A (1 row) SELECT 4 / second() AS four_hertz; four_hertz ------------ 4 Hz (1 row) SELECT kelvin(10) / 5 AS two_kelvin; two_kelvin ------------ 2 K (1 row) SELECT 0 / candela() AS zero_by_candela; zero_by_candela ----------------- 0 cd^-1 (1 row) SELECT 1 / mole(0) AS error; ERROR: division by zero-valued unit: "0 mol" SELECT byte(0) / 2 AS zero_byte; zero_byte ----------- 0 B (1 row) SELECT kilogram(1) / 0 AS error; ERROR: division of unit by zero -- test exponentiation SELECT '6'::unit ^ 2 AS square; square -------- 36 (1 row) SELECT meter(100) ^ 2 AS square_meter; square_meter -------------- 10000 m^2 (1 row) SELECT kilogram(100) ^ 2 AS square_kilogram; square_kilogram ----------------- 10000 kg^2 (1 row) SELECT second(.02) ^ -1 AS hertz; hertz ------- 50 Hz (1 row) SELECT ampere(4) ^ 0 AS unity; unity ------- 1 (1 row) SELECT '0'::unit ^ 0 AS unity; unity ------- 1 (1 row) -- test roots SELECT sqrt('4'::unit); sqrt ------ 2 (1 row) SELECT sqrt('4 m^2'::unit); sqrt ------ 2 m (1 row) SELECT |/'16 s^-4'::unit; ?column? ---------- 4 s^-2 (1 row) SELECT sqrt('-4 m^2'::unit) AS error; ERROR: cannot take square root of a negative-valued unit SELECT sqrt('4 m'::unit) AS error; ERROR: cannot take square root of a unit with odd "m" exponent SELECT cbrt('8'::unit); cbrt ------ 2 (1 row) SELECT cbrt('8 m^3'::unit); cbrt ------ 2 m (1 row) SELECT ||/'-27 s^-6'::unit; ?column? ---------- -3 s^-2 (1 row) SELECT cbrt('-4 m'::unit) AS error; ERROR: cannot take cube root of a unit with "m" exponent not divisible by three WITH v(u) AS (VALUES (NULL), ('0'::unit), ('1'::unit), ('2'::unit), (meter(0)), (meter()), (meter() * '2'), (kilogram(0)), (kilogram()), (kilogram() * '2') ), va(a) AS (SELECT * FROM v), vb(b) AS (SELECT * FROM v) SELECT a, b, -a AS neg, a * b AS mul, CASE WHEN value(b) = 0 THEN NULL ELSE a / b END AS div FROM va CROSS JOIN vb; a | b | neg | mul | div ------+------+-------+--------+----------- | | | | | 0 | | | | 1 | | | | 2 | | | | 0 m | | | | 1 m | | | | 2 m | | | | 0 kg | | | | 1 kg | | | | 2 kg | | | 0 | | -0 | | 0 | 0 | -0 | 0 | 0 | 1 | -0 | 0 | 0 0 | 2 | -0 | 0 | 0 0 | 0 m | -0 | 0 m | 0 | 1 m | -0 | 0 m | 0 m^-1 0 | 2 m | -0 | 0 m | 0 m^-1 0 | 0 kg | -0 | 0 kg | 0 | 1 kg | -0 | 0 kg | 0 kg^-1 0 | 2 kg | -0 | 0 kg | 0 kg^-1 1 | | -1 | | 1 | 0 | -1 | 0 | 1 | 1 | -1 | 1 | 1 1 | 2 | -1 | 2 | 0.5 1 | 0 m | -1 | 0 m | 1 | 1 m | -1 | 1 m | 1 m^-1 1 | 2 m | -1 | 2 m | 0.5 m^-1 1 | 0 kg | -1 | 0 kg | 1 | 1 kg | -1 | 1 kg | 1 kg^-1 1 | 2 kg | -1 | 2 kg | 0.5 kg^-1 2 | | -2 | | 2 | 0 | -2 | 0 | 2 | 1 | -2 | 2 | 2 2 | 2 | -2 | 4 | 1 2 | 0 m | -2 | 0 m | 2 | 1 m | -2 | 2 m | 2 m^-1 2 | 2 m | -2 | 4 m | 1 m^-1 2 | 0 kg | -2 | 0 kg | 2 | 1 kg | -2 | 2 kg | 2 kg^-1 2 | 2 kg | -2 | 4 kg | 1 kg^-1 0 m | | -0 m | | 0 m | 0 | -0 m | 0 m | 0 m | 1 | -0 m | 0 m | 0 m 0 m | 2 | -0 m | 0 m | 0 m 0 m | 0 m | -0 m | 0 m^2 | 0 m | 1 m | -0 m | 0 m^2 | 0 0 m | 2 m | -0 m | 0 m^2 | 0 0 m | 0 kg | -0 m | 0 m*kg | 0 m | 1 kg | -0 m | 0 m*kg | 0 m/kg 0 m | 2 kg | -0 m | 0 m*kg | 0 m/kg 1 m | | -1 m | | 1 m | 0 | -1 m | 0 m | 1 m | 1 | -1 m | 1 m | 1 m 1 m | 2 | -1 m | 2 m | 500 mm 1 m | 0 m | -1 m | 0 m^2 | 1 m | 1 m | -1 m | 1 m^2 | 1 1 m | 2 m | -1 m | 2 m^2 | 0.5 1 m | 0 kg | -1 m | 0 m*kg | 1 m | 1 kg | -1 m | 1 m*kg | 1 m/kg 1 m | 2 kg | -1 m | 2 m*kg | 500 mm/kg 2 m | | -2 m | | 2 m | 0 | -2 m | 0 m | 2 m | 1 | -2 m | 2 m | 2 m 2 m | 2 | -2 m | 4 m | 1 m 2 m | 0 m | -2 m | 0 m^2 | 2 m | 1 m | -2 m | 2 m^2 | 2 2 m | 2 m | -2 m | 4 m^2 | 1 2 m | 0 kg | -2 m | 0 m*kg | 2 m | 1 kg | -2 m | 2 m*kg | 2 m/kg 2 m | 2 kg | -2 m | 4 m*kg | 1 m/kg 0 kg | | -0 kg | | 0 kg | 0 | -0 kg | 0 kg | 0 kg | 1 | -0 kg | 0 kg | 0 kg 0 kg | 2 | -0 kg | 0 kg | 0 kg 0 kg | 0 m | -0 kg | 0 m*kg | 0 kg | 1 m | -0 kg | 0 m*kg | 0 kg/m 0 kg | 2 m | -0 kg | 0 m*kg | 0 kg/m 0 kg | 0 kg | -0 kg | 0 kg^2 | 0 kg | 1 kg | -0 kg | 0 kg^2 | 0 0 kg | 2 kg | -0 kg | 0 kg^2 | 0 1 kg | | -1 kg | | 1 kg | 0 | -1 kg | 0 kg | 1 kg | 1 | -1 kg | 1 kg | 1 kg 1 kg | 2 | -1 kg | 2 kg | 500 g 1 kg | 0 m | -1 kg | 0 m*kg | 1 kg | 1 m | -1 kg | 1 m*kg | 1 kg/m 1 kg | 2 m | -1 kg | 2 m*kg | 500 g/m 1 kg | 0 kg | -1 kg | 0 kg^2 | 1 kg | 1 kg | -1 kg | 1 kg^2 | 1 1 kg | 2 kg | -1 kg | 2 kg^2 | 0.5 2 kg | | -2 kg | | 2 kg | 0 | -2 kg | 0 kg | 2 kg | 1 | -2 kg | 2 kg | 2 kg 2 kg | 2 | -2 kg | 4 kg | 1 kg 2 kg | 0 m | -2 kg | 0 m*kg | 2 kg | 1 m | -2 kg | 2 m*kg | 2 kg/m 2 kg | 2 m | -2 kg | 4 m*kg | 1 kg/m 2 kg | 0 kg | -2 kg | 0 kg^2 | 2 kg | 1 kg | -2 kg | 2 kg^2 | 2 2 kg | 2 kg | -2 kg | 4 kg^2 | 1 (100 rows) WITH v(a) AS (VALUES (NULL), ('1'::unit), ('2'::unit), (meter()), (meter() * '2'), (kilogram()), (kilogram() * '2') ) SELECT a, a ^ -2 AS pow_2, a ^ -1 AS pow_1, a ^ 0 AS pow0, a ^ 1 AS pow1, a ^ 2 AS pow2 FROM v; a | pow_2 | pow_1 | pow0 | pow1 | pow2 ------+------------+-----------+------+------+-------- | | | | | 1 | 1 | 1 | 1 | 1 | 1 2 | 0.25 | 0.5 | 1 | 2 | 4 1 m | 1 m^-2 | 1 m^-1 | 1 | 1 m | 1 m^2 2 m | 0.25 m^-2 | 0.5 m^-1 | 1 | 2 m | 4 m^2 1 kg | 1 kg^-2 | 1 kg^-1 | 1 | 1 kg | 1 kg^2 2 kg | 0.25 kg^-2 | 0.5 kg^-1 | 1 | 2 kg | 4 kg^2 (7 rows) -- test conversion SELECT '1m'::unit @ 'mm'; ?column? ---------- 1000 mm (1 row) SELECT '10g'::unit @ 'mg'; ?column? ---------- 10000 mg (1 row) SELECT '5dm^3'::unit @ 'l'; ?column? ---------- 5 l (1 row) SELECT '9.81 m/s^2'::unit @ 'N/kg', '9.81 m/s^2'::unit @@ 'N/kg'; ?column? | ?column? -----------+---------- 9.81 N/kg | 9.81 (1 row) SELECT '16384 B'::unit @ '8192 B', '16384 B'::unit @@ '8192 B'; ?column? | ?column? ------------+---------- 2 * 8192 B | 2 (1 row) SELECT '1 hl'::unit @ '0.5 l'; ?column? ------------- 200 * 0.5 l (1 row) SELECT '5MB/min'::unit @ 'GB/d'; ?column? ---------- 7.2 GB/d (1 row) SELECT '5m'::unit @ 's' AS error; ERROR: dimension mismatch in "@" operation: "5 m", "1 s" postgresql-unit-7.8/expected/iec.out000066400000000000000000000056561450213077700176640ustar00rootroot00000000000000VALUES ('1 mB'::unit), ('1 B'::unit), ('1 KiB'::unit), ('1 MiB'::unit), ('1 GiB'::unit), ('1 TiB'::unit), ('1 PiB'::unit), ('1 EiB'::unit), ('1 ZiB'::unit), ('1 YiB'::unit), ('1 RiB'::unit), ('1 QiB'::unit); column1 --------------------- 1 mB 1 B 1.024 kB 1.048576 MB 1.073741824 GB 1.099511627776 TB 1.12589990684262 PB 1.15292150460685 EB 1.18059162071741 ZB 1.20892581961463 YB 1.23794003928538 RB 1.26765060022823 QB (12 rows) VALUES ('1 B'::unit @ 'B'), ('1 KiB'::unit @ 'KiB'), ('1 MiB'::unit @ 'MiB'), ('1 GiB'::unit @ 'GiB'), ('1 TiB'::unit @ 'TiB'), ('1 PiB'::unit @ 'PiB'), ('1 EiB'::unit @ 'EiB'), ('1 ZiB'::unit @ 'ZiB'), ('1 YiB'::unit @ 'YiB'), ('1 RiB'::unit @ 'RiB'), ('1 QiB'::unit @ 'QiB'); column1 --------- 1 B 1 KiB 1 MiB 1 GiB 1 TiB 1 PiB 1 EiB 1 ZiB 1 YiB 1 RiB 1 QiB (11 rows) VALUES ('1 B'::unit @ 'B'), ('1 kB'::unit @ 'KiB'), ('1 MB'::unit @ 'MiB'), ('1 GB'::unit @ 'GiB'), ('1 TB'::unit @ 'TiB'), ('1 PB'::unit @ 'PiB'), ('1 EB'::unit @ 'EiB'), ('1 ZB'::unit @ 'ZiB'), ('1 YB'::unit @ 'YiB'), ('1 RB'::unit @ 'RiB'), ('1 QB'::unit @ 'QiB'); column1 ----------------------- 1 B 0.9765625 KiB 0.95367431640625 MiB 0.931322574615479 GiB 0.909494701772928 TiB 0.888178419700125 PiB 0.867361737988404 EiB 0.8470329472543 ZiB 0.827180612553028 YiB 0.807793566946316 RiB 0.788860905221012 QiB (11 rows) -- errors SELECT '1 kiB'::unit; ERROR: unit "kiB" is not known LINE 1: SELECT '1 kiB'::unit; ^ SELECT '1 Ki'::unit; ERROR: unit "Ki" is not known LINE 1: SELECT '1 Ki'::unit; ^ -- used to be an error in v2 SELECT '1 Kim'::unit AS "1024 m"; 1024 m ---------- 1.024 km (1 row) -- binary prefix output SET unit.byte_output_iec = 'foobar'; ERROR: parameter "unit.byte_output_iec" requires a Boolean value SET unit.byte_output_iec = on; VALUES ('.001 B'::unit, '.001 B'::unit), ('1 B'::unit, '1 B'::unit), ('1 KiB'::unit, '1 kB'::unit), ('1 MiB'::unit, '1 MB'::unit), ('1 GiB'::unit, '1 GB'::unit), ('1 TiB'::unit, '1 TB'::unit), ('1 PiB'::unit, '1 PB'::unit), ('1 EiB'::unit, '1 EB'::unit), ('1 ZiB'::unit, '1 ZB'::unit), ('1 YiB'::unit, '1 YB'::unit), ('1 RiB'::unit, '1 RB'::unit), ('1 QiB'::unit, '1 QB'::unit), ('1024 QiB'::unit, '1000 QB'::unit); column1 | column2 ------------------------+---------------------- 0.001 B | 0.001 B 1 B | 1 B 1 KiB | 1000 B 1 MiB | 976.5625 KiB 1 GiB | 953.67431640625 MiB 1 TiB | 931.322574615479 GiB 1 PiB | 909.494701772928 TiB 1 EiB | 888.178419700125 PiB 1 ZiB | 867.361737988404 EiB 1 YiB | 847.0329472543 ZiB 1 RiB | 827.180612553028 YiB 1 QiB | 807.793566946316 RiB 1.29807421463371e+33 B | 788.860905221012 QiB (13 rows) postgresql-unit-7.8/expected/language_functions.out000066400000000000000000000027441450213077700227720ustar00rootroot00000000000000select 'sqrt(4 m^2)'::unit; unit ------ 2 m (1 row) select 'sqrt(-4 m^2)'::unit; ERROR: cannot take square root of a negative-valued unit LINE 1: select 'sqrt(-4 m^2)'::unit; ^ select 'sqrt(4 m^3)'::unit; ERROR: cannot take square root of a unit with odd "m" exponent LINE 1: select 'sqrt(4 m^3)'::unit; ^ select 'exp(1)'::unit; unit ------------------ 2.71828182845905 (1 row) select 'exp(1 A)'::unit; ERROR: cannot take base-e exponent of value that is not dimension-less LINE 1: select 'exp(1 A)'::unit; ^ select 'ln(2.7)'::unit; unit ------------------- 0.993251773010283 (1 row) select 'ln(-2.7)'::unit; ERROR: cannot take ln of a negative-valued unit LINE 1: select 'ln(-2.7)'::unit; ^ select 'ln(2.7 s)'::unit; ERROR: cannot take ln of value that is not dimension-less LINE 1: select 'ln(2.7 s)'::unit; ^ select 'asin(1)'::unit; unit ----------------- 1.5707963267949 (1 row) select 'asin(2)'::unit; ERROR: cannot asin of values outside the range -1 to 1 LINE 1: select 'asin(2)'::unit; ^ select 'asin(1 kg)'::unit; ERROR: cannot take asin of value that is not dimension-less LINE 1: select 'asin(1 kg)'::unit; ^ select 'tan(1)'::unit; unit ----------------- 1.5574077246549 (1 row) select 'tan(1 mol)'::unit; ERROR: cannot take tan of value that is not dimension-less LINE 1: select 'tan(1 mol)'::unit; ^ postgresql-unit-7.8/expected/prefix.out000066400000000000000000000064761450213077700204220ustar00rootroot00000000000000SELECT f, meter(f), kilogram(f) FROM factors; f | meter | kilogram ---------------+---------+---------- 1e+33 | 1e+33 m | 1e+33 kg 1e+30 | 1 Qm | 1e+30 kg 1e+27 | 1 Rm | 1 Qg 1e+24 | 1 Ym | 1 Rg 1e+21 | 1 Zm | 1 Yg 1e+18 | 1 Em | 1 Zg 1e+15 | 1 Pm | 1 Eg 1000000000000 | 1 Tm | 1 Pg 1000000000 | 1 Gm | 1 Tg 1000000 | 1 Mm | 1 Gg 1000 | 1 km | 1 Mg 1 | 1 m | 1 kg 0.001 | 1 mm | 1 g 1e-06 | 1 µm | 1 mg 1e-09 | 1 nm | 1 µg 1e-12 | 1 pm | 1 ng 1e-15 | 1 fm | 1 pg 1e-18 | 1 am | 1 fg 1e-21 | 1 zm | 1 ag 1e-24 | 1 ym | 1 zg 1e-27 | 1 rm | 1 yg 1e-30 | 1 qm | 1 rg 1e-33 | 1e-33 m | 1 qg 1e-36 | 1e-36 m | 1e-36 kg 0 | 0 m | 0 kg (25 rows) SELECT p, (p||'m/m')::unit AS factor, ('0.001 '||p||'m')::unit AS "0.001 m", (p||'m')::unit AS "meter", ('1000 '||p||'m')::unit AS "1000 m", ('0.001 '||p||'g')::unit AS "0.001 g", (p||'g')::unit AS "gram", ('1000 '||p||'g')::unit AS "1000 g" FROM prefixes; p | factor | 0.001 m | meter | 1000 m | 0.001 g | gram | 1000 g ----+---------------+---------+--------+---------+----------+--------+---------- q | 1e-30 | 1e-33 m | 1 qm | 1 rm | 1e-36 kg | 1 qg | 1 rg r | 1e-27 | 1 qm | 1 rm | 1 ym | 1 qg | 1 rg | 1 yg y | 1e-24 | 1 rm | 1 ym | 1 zm | 1 rg | 1 yg | 1 zg z | 1e-21 | 1 ym | 1 zm | 1 am | 1 yg | 1 zg | 1 ag a | 1e-18 | 1 zm | 1 am | 1 fm | 1 zg | 1 ag | 1 fg f | 1e-15 | 1 am | 1 fm | 1 pm | 1 ag | 1 fg | 1 pg p | 1e-12 | 1 fm | 1 pm | 1 nm | 1 fg | 1 pg | 1 ng n | 1e-09 | 1 pm | 1 nm | 1 µm | 1 pg | 1 ng | 1 µg µ | 1e-06 | 1 nm | 1 µm | 1 mm | 1 ng | 1 µg | 1 mg mu | 1e-06 | 1 nm | 1 µm | 1 mm | 1 ng | 1 µg | 1 mg m | 0.001 | 1 µm | 1 mm | 1 m | 1 µg | 1 mg | 1 g c | 0.01 | 10 µm | 10 mm | 10 m | 10 µg | 10 mg | 10 g d | 0.1 | 100 µm | 100 mm | 100 m | 100 µg | 100 mg | 100 g | 1 | 1 mm | 1 m | 1 km | 1 mg | 1 g | 1 kg da | 10 | 10 mm | 10 m | 10 km | 10 mg | 10 g | 10 kg h | 100 | 100 mm | 100 m | 100 km | 100 mg | 100 g | 100 kg k | 1000 | 1 m | 1 km | 1 Mm | 1 g | 1 kg | 1 Mg M | 1000000 | 1 km | 1 Mm | 1 Gm | 1 kg | 1 Mg | 1 Gg G | 1000000000 | 1 Mm | 1 Gm | 1 Tm | 1 Mg | 1 Gg | 1 Tg T | 1000000000000 | 1 Gm | 1 Tm | 1 Pm | 1 Gg | 1 Tg | 1 Pg P | 1e+15 | 1 Tm | 1 Pm | 1 Em | 1 Tg | 1 Pg | 1 Eg E | 1e+18 | 1 Pm | 1 Em | 1 Zm | 1 Pg | 1 Eg | 1 Zg Z | 1e+21 | 1 Em | 1 Zm | 1 Ym | 1 Eg | 1 Zg | 1 Yg Y | 1e+24 | 1 Zm | 1 Ym | 1 Rm | 1 Zg | 1 Yg | 1 Rg R | 1e+27 | 1 Ym | 1 Rm | 1 Qm | 1 Yg | 1 Rg | 1 Qg Q | 1e+30 | 1 Rm | 1 Qm | 1e+33 m | 1 Rg | 1 Qg | 1e+30 kg (26 rows) postgresql-unit-7.8/expected/round.out000066400000000000000000000026421450213077700202430ustar00rootroot00000000000000SELECT round(ampere(1.5)); round ------- 2 A (1 row) SELECT round(candela(-0.5)); round ------- -1 cd (1 row) SELECT round(meter(1500.5)); round ---------- 1.501 km (1 row) SET extra_float_digits = 0; SELECT '1|3m'::unit, '25m'::unit @ 'ft', '25m'::unit @@ 'ft'; unit | ?column? | ?column? ---------------------+---------------------+------------------ 333.333333333333 mm | 82.0209973753281 ft | 82.0209973753281 (1 row) SET extra_float_digits = 3; SELECT '1|3m'::unit, '25m'::unit @ 'ft', '25m'::unit @@ 'ft'; unit | ?column? | ?column? ------------------------+------------------------+--------------------- 333.333333333333314 mm | 82.0209973753280792 ft | 82.0209973753280792 (1 row) SET extra_float_digits = -3; SELECT '1|3m'::unit, '25m'::unit @ 'ft', '25m'::unit @@ 'ft'; unit | ?column? | ?column? ------------------+------------------+--------------- 333.333333333 mm | 82.0209973753 ft | 82.0209973753 (1 row) SET extra_float_digits = -12; SELECT '1|3m'::unit, '25m'::unit @ 'ft', '25m'::unit @@ 'ft'; unit | ?column? | ?column? --------+----------+---------- 333 mm | 82 ft | 82 (1 row) SET extra_float_digits = -15; SELECT '1|3m'::unit, '25m'::unit @ 'ft', '25m'::unit @@ 'ft'; unit | ?column? | ?column? ----------+----------+---------- 3e+02 mm | 8e+01 ft | 8e+01 (1 row) postgresql-unit-7.8/expected/round_1.out000066400000000000000000000026341450213077700204640ustar00rootroot00000000000000SELECT round(ampere(1.5)); round ------- 2 A (1 row) SELECT round(candela(-0.5)); round ------- -1 cd (1 row) SELECT round(meter(1500.5)); round ---------- 1.501 km (1 row) SET extra_float_digits = 0; SELECT '1|3m'::unit, '25m'::unit @ 'ft', '25m'::unit @@ 'ft'; unit | ?column? | ?column? ---------------------+---------------------+------------------ 333.333333333333 mm | 82.0209973753281 ft | 82.0209973753281 (1 row) SET extra_float_digits = 3; SELECT '1|3m'::unit, '25m'::unit @ 'ft', '25m'::unit @@ 'ft'; unit | ?column? | ?column? ------------------------+------------------------+------------------- 333.333333333333314 mm | 82.0209973753280792 ft | 82.02099737532808 (1 row) SET extra_float_digits = -3; SELECT '1|3m'::unit, '25m'::unit @ 'ft', '25m'::unit @@ 'ft'; unit | ?column? | ?column? ------------------+------------------+--------------- 333.333333333 mm | 82.0209973753 ft | 82.0209973753 (1 row) SET extra_float_digits = -12; SELECT '1|3m'::unit, '25m'::unit @ 'ft', '25m'::unit @@ 'ft'; unit | ?column? | ?column? --------+----------+---------- 333 mm | 82 ft | 82 (1 row) SET extra_float_digits = -15; SELECT '1|3m'::unit, '25m'::unit @ 'ft', '25m'::unit @@ 'ft'; unit | ?column? | ?column? ----------+----------+---------- 3e+02 mm | 8e+01 ft | 8e+01 (1 row) postgresql-unit-7.8/expected/tables.out000066400000000000000000000061261450213077700203670ustar00rootroot00000000000000SET client_min_messages = warning; DROP TABLE IF EXISTS prefixes; CREATE TABLE prefixes (p text); DELETE FROM prefixes; INSERT INTO prefixes VALUES ('q'),('r'),('y'),('z'),('a'),('f'),('p'),('n'),('µ'),('mu'),('m'),('c'),('d'), (''), ('da'),('h'),('k'),('M'),('G'),('T'),('P'),('E'),('Z'),('Y'),('R'),('Q'); DROP TABLE IF EXISTS factors; CREATE TABLE factors (f double precision); DELETE FROM factors; INSERT INTO factors VALUES (1e33), (1e30), (1e27), (1e24), (1e21), (1e18), (1e15), (1e12), (1e9), (1e6), (1e3), (1), (1e-3), (1e-6), (1e-9), (1e-12), (1e-15), (1e-18), (1e-21), (1e-24), (1e-27), (1e-30), (1e-33), (1e-36), (0); DROP TABLE IF EXISTS units; CREATE TABLE units (u text, unit unit, base boolean, coherent boolean, duplicate boolean); COMMENT ON COLUMN units.duplicate IS 'For coherent units, this unit has the same dimension as some other base or coherent unit'; DELETE FROM units; COPY units (u, base, coherent, duplicate) FROM STDIN; UPDATE units SET unit = u::unit; SELECT * FROM units; u | unit | base | coherent | duplicate -----+----------------+------+----------+----------- m/m | 1 | t | f | f m | 1 m | t | f | f kg | 1 kg | t | f | f s | 1 s | t | f | f A | 1 A | t | f | f K | 1 K | t | f | f mol | 1 mol | t | f | f cd | 1 cd | t | f | f B | 1 B | t | f | f sr | 1 | f | t | t Hz | 1 Hz | f | t | f N | 1 N | f | t | f Pa | 1 Pa | f | t | f J | 1 J | f | t | f W | 1 W | f | t | f C | 1 C | f | t | f V | 1 V | f | t | f F | 1 F | f | t | f Ω | 1 Ω | f | t | f ohm | 1 Ω | f | t | t S | 1 S | f | t | f Wb | 1 Wb | f | t | f T | 1 T | f | t | f H | 1 H | f | t | f °C | 1 K | f | t | t lm | 1 cd | f | t | t lx | 1 lx | f | t | f Bq | 1 Hz | f | t | t Gy | 1 Gy | f | t | f rad | 10 mGy | f | f | t Sv | 1 Gy | f | t | t kat | 1 kat | f | t | f g | 1 g | f | f | t a | 100 m^2 | f | f | f l | 0.001 m^3 | f | f | f t | 1 Mg | f | f | f bar | 100 kPa | f | f | f min | 00:01:00 s | f | f | f hr | 01:00:00 s | f | f | f d | 1 d | f | f | f in | 25.4 mm | f | f | f ft | 304.8 mm | f | f | f yd | 914.4 mm | f | f | f mi | 1.609344 km | f | f | f oz | 28.349523125 g | f | f | f lb | 453.59237 g | f | f | f (46 rows) postgresql-unit-7.8/expected/temperature.out000066400000000000000000000123621450213077700214510ustar00rootroot00000000000000/* revert to pre-12 default */ SET extra_float_digits = 0; SELECT * FROM unit_units WHERE name IN ( 'K', 'kelvin', '℃', '°C', 'degC', 'degcelsius', '℉', '°F', 'degF', 'degfahrenheit', '°R', 'degR', 'degrankine', 'degreerankine', 'degreesrankine', 'tempR', 'temprankine', 'degreaumur') ORDER BY name COLLATE "C"; name | unit | shift | definition | dump ----------------+---------------------+------------------+----------------+------ K | 1 K | | K | degC | 1 K | 273.15 | K | degF | 555.555555555556 mK | 255.372222222222 | 5|9 * degC | degR | 555.555555555556 mK | | degrankine | degcelsius | 1 K | 273.15 | K | degfahrenheit | 555.555555555556 mK | 255.372222222222 | 5|9 * degC | degrankine | 555.555555555556 mK | | degreesrankine | degreaumur | 1.25 K | 273.15 | 10|8 * degC | degreerankine | 555.555555555556 mK | | degF | degreesrankine | 555.555555555556 mK | | degF | kelvin | 1 K | | K | tempR | 555.555555555556 mK | | degrankine | temprankine | 555.555555555556 mK | | degrankine | °C | 1 K | 273.15 | degC | °F | 555.555555555556 mK | 255.372222222222 | degF | °R | 555.555555555556 mK | | degR | ℃ | 1 K | 273.15 | degC | ℉ | 555.555555555556 mK | 255.372222222222 | degF | (18 rows) RESET extra_float_digits; -- Kelvin SELECT '0 K'::unit, 'K'::unit, '1 K'::unit, '273.15 K'::unit; unit | unit | unit | unit ------+------+------+---------- 0 K | 1 K | 1 K | 273.15 K (1 row) -- Celsius SELECT '-273.15 ℃'::unit, '0 ℃'::unit, '1 ℃'::unit, '℃'::unit; unit | unit | unit | unit ------+----------+----------+------ 0 K | 273.15 K | 274.15 K | 1 K (1 row) SELECT '-273.15 °C'::unit, '0 °C'::unit, '1 °C'::unit, '°C'::unit; unit | unit | unit | unit ------+----------+----------+------ 0 K | 273.15 K | 274.15 K | 1 K (1 row) SELECT '-273.15 degC'::unit, '0 degC'::unit, '1 degC'::unit, 'degC'::unit; unit | unit | unit | unit ------+----------+----------+------ 0 K | 273.15 K | 274.15 K | 1 K (1 row) SELECT '-273.15 degcelsius'::unit, '0 degcelsius'::unit, '1 degcelsius'::unit, 'degcelsius'::unit; unit | unit | unit | unit ------+----------+----------+------ 0 K | 273.15 K | 274.15 K | 1 K (1 row) -- Fahrenheit SELECT '-459.67 ℉'::unit, '0 ℉'::unit, '1 ℉'::unit, '℉'::unit; unit | unit | unit | unit ------+--------------------+--------------------+--------------------- 0 K | 255.372222222222 K | 255.927777777778 K | 555.555555555556 mK (1 row) SELECT '-459.67 °F'::unit, '0 °F'::unit, '1 °F'::unit, '°F'::unit; unit | unit | unit | unit ------+--------------------+--------------------+--------------------- 0 K | 255.372222222222 K | 255.927777777778 K | 555.555555555556 mK (1 row) SELECT '-459.67 degF'::unit, '0 degF'::unit, '1 degF'::unit, 'degF'::unit; unit | unit | unit | unit ------+--------------------+--------------------+--------------------- 0 K | 255.372222222222 K | 255.927777777778 K | 555.555555555556 mK (1 row) SELECT '-459.67 degfahrenheit'::unit, '0 degfahrenheit'::unit, '1 degfahrenheit'::unit, 'degfahrenheit'::unit; unit | unit | unit | unit ------+--------------------+--------------------+--------------------- 0 K | 255.372222222222 K | 255.927777777778 K | 555.555555555556 mK (1 row) -- Rankine SELECT '491.67 degR'::unit, '0 degR'::unit, '1 degR'::unit, 'degR'::unit; unit | unit | unit | unit ----------+------+---------------------+--------------------- 273.15 K | 0 K | 555.555555555556 mK | 555.555555555556 mK (1 row) -- Réaumur SELECT '-218.52 degreaumur'::unit, '0 degreaumur'::unit, '1 degreaumur'::unit, 'degreaumur'::unit; unit | unit | unit | unit ---------------------+----------+---------+-------- -56.843418860808 fK | 273.15 K | 274.4 K | 1.25 K (1 row) SELECT '0 K'::unit @ 'K', '0 K'::unit @ '°C', '0 K'::unit @ '°F', '0 K'::unit @ '°R', '0 K'::unit @ 'degreaumur'; ?column? | ?column? | ?column? | ?column? | ?column? ----------+------------+------------+----------+-------------------- 0 K | -273.15 °C | -459.67 °F | 0 °R | -218.52 degreaumur (1 row) SELECT '273.15 K'::unit @ 'K', '273.15 K'::unit @ '°C', '273.15 K'::unit @ '°F', '273.15 K'::unit @ '°R', '273.15 K'::unit @ 'degreaumur'; ?column? | ?column? | ?column? | ?column? | ?column? ----------+----------+---------------------+-----------+-------------- 273.15 K | 0 °C | 31.9999999999999 °F | 491.67 °R | 0 degreaumur (1 row) postgresql-unit-7.8/expected/time.out000066400000000000000000000313171450213077700200530ustar00rootroot00000000000000SELECT '1.1 s'::unit; unit ------- 1.1 s (1 row) SELECT '61.1 s'::unit; unit -------------- 00:01:01.1 s (1 row) SELECT '71.1 s'::unit; unit -------------- 00:01:11.1 s (1 row) SELECT '601 s'::unit; unit ------------ 00:10:01 s (1 row) SELECT '3601 s'::unit; unit ------------ 01:00:01 s (1 row) SELECT '86400 s'::unit; unit ------ 1 d (1 row) SELECT '-86400 s'::unit; unit ------ -1 d (1 row) SELECT '86401 s'::unit; unit ------------------ 1 d + 00:00:01 s (1 row) SELECT '-86401 s'::unit; unit ------------------- -1 d - 00:00:01 s (1 row) SELECT '365 d'::unit; unit -------------- 1 commonyear (1 row) SELECT '-365 d'::unit; unit --------------- -1 commonyear (1 row) SELECT '3650 d'::unit; unit --------------- 10 commonyear (1 row) SELECT '3651 d'::unit; unit --------------------- 10 commonyear + 1 d (1 row) SELECT '3651.5 d'::unit; unit ---------------------------------- 10 commonyear + 1 d + 12:00:00 s (1 row) SELECT '00:00:00.1'::unit; unit ------ 0.1 (1 row) SELECT '00:00:01'::unit; unit ------ 1 (1 row) SELECT '00:01:00'::unit; unit ------ 60 (1 row) SELECT '01:00:00'::unit; unit ------ 3600 (1 row) SELECT '0:0:0'::unit; unit ------ 0 (1 row) SELECT '00:00:01 s'::unit; unit ------ 1 s (1 row) SELECT '00:00:01s'::unit; unit ------ 1 s (1 row) SELECT '00:00:01 m'::unit; unit ------ 1 m (1 row) SELECT '00:01:00 s'::unit; unit ------------ 00:01:00 s (1 row) SELECT '00:01:00.5 s'::unit; unit -------------- 00:01:00.5 s (1 row) SELECT '01:00:00 s'::unit; unit ------------ 01:00:00 s (1 row) SELECT '1 d + 02:03:04.5 s'::unit; unit -------------------- 1 d + 02:03:04.5 s (1 row) SELECT '1.1 d'::unit; -- needs ULP clamping unit ------------------ 1 d + 02:24:00 s (1 row) SELECT name, unit, definition FROM unit_units WHERE dimension(unit) = 'TIME' ORDER BY unit, name COLLATE "C"; name | unit | definition ---------------------+-----------------------------------------------+----------------------------------------------- plancktime | 5.3912464483136e-44 s | hbar / planckenergy t_P | 5.3912464483136e-44 s | plancktime plancktime_red | 2.70277015656937e-43 s | hbar / planckenergy_red atomictime | 24.1888432658572 as | atomicaction / atomicenergy natural_time | 658.211956950907 as | hbar / natural_energy svedberg | 100 fs | 1e-13 s ㎰ | 1 ps | ps ㎱ | 1 ns | ns shake | 10 ns | 1e-8 sec ㎲ | 1 µs | µs ㎳ | 1 ms | ms jiffies | 10 ms | jiffy jiffy | 10 ms | 0.01 sec timeatom | 159.574468085106 ms | 1|47 timeounce Tim | 173.611111111111 ms | 12^-4 hour blink | 864 ms | 1e-5 day decimalsecond | 864 ms | 1|100 decimalminute siderealsecond | 997.269566435185 ms | 1|60 siderealminute TIME | 1 s | second s | 1 s | s sec | 1 s | s second | 1 s | s timeounce | 7.5 s | 1|8 timeostent siderealminute | 59.8361739861111 s | 1|60 siderealhour min | 00:01:00 s | minute minute | 00:01:00 s | 60 s timeostent | 00:01:00 s | 1|60 hour beat | 00:01:26.4 s | decimalminute decimalminute | 00:01:26.4 s | 1|100 decimalhour timeminute | 00:06:00 s | 1|10 hour timepoint | 00:12:00 s | 1|5 hour ce | 00:14:24 s | 1e-2 day bell | 00:30:00 s | 1|8 watch lunour | 00:59:03.67055555555 s | 1|24 lune siderealhour | 00:59:50.17043916667 s | 1|24 siderealday hour | 01:00:00 s | 60 min hr | 01:00:00 s | hour decimalhour | 02:24:00 s | 1|10 day watch | 04:00:00 s | 4 hours jupiterday | 09:55:30 s | jupiterday_sidereal jupiterday_sidereal | 09:55:30 s | 9.9250 hr jupiterday_solar | 09:55:33.24 s | 9.9259 hr saturnday | 10:39:21.6 s | saturnday_sidereal saturnday_sidereal | 10:39:21.6 s | 10.656 hr saturnday_solar | 10:39:21.6 s | 10.656 hr neptuneday | 16:06:36 s | neptuneday_sidereal neptuneday_sidereal | 16:06:36 s | 16.11 hr neptuneday_solar | 16:06:36 s | 16.11 hr uranusday | 17:14:24 s | uranusday_sidereal uranusday_sidereal | 17:14:24 s | 17.24 hr uranusday_solar | 17:14:24 s | 17.24 hr lune | 23:37:28.0933333333 s | 1|30 lunation earthday | 23:56:04.09054 s | earthday_sidereal earthday_sidereal | 23:56:04.09054 s | siderealday siderealday | 23:56:04.09054 s | 86164.09054 s d | 1 d | day da | 1 d | day day | 1 d | 24 hr earthday_solar | 1 d | 24 hr solarday | 1 d | day ㍲ | 1 d | da marsday | 1 d + 00:37:22.44 s | marsday_sidereal marsday_sidereal | 1 d + 00:37:22.44 s | 24.6229 hr marsday_solar | 1 d + 00:39:34.92 s | 24.6597 hr plutoday_solar | 6 d + 09:16:55.2 s | 153.2820 hr plutoday | 6 d + 09:17:34.08 s | plutoday_sidereal plutoday_sidereal | 6 d + 09:17:34.08 s | 153.2928 hr sennight | 7 d | 7 day week | 7 d | 7 day wk | 7 d | week fortnight | 14 d | 14 day draconicmonth | 27 d + 05:05:35.79936 s | nodicalmonth draconiticmonth | 27 d + 05:05:35.79936 s | nodicalmonth nodicalmonth | 27 d + 05:05:35.79936 s | 27.2122199 day siderealmonth | 27 d + 07:43:11.5104 s | 27.321661 day anomalisticmonth | 27 d + 13:18:33.100128 s | 27.55454977 day islamicmonth | 29 d + 12:00:00 s | 1|12 islamicyear lunarmonth | 29 d + 12:44:02.8 s | 29 days + 12 hours + 44 minutes + 2.8 seconds lunation | 29 d + 12:44:02.8 s | synodicmonth synodicmonth | 29 d + 12:44:02.8 s | lunarmonth mo | 30 d + 10:29:03.8312232 s | month month | 30 d + 10:29:03.8312232 s | 1|12 year mercuryday | 58 d + 15:36:00 s | mercuryday_sidereal mercuryday_sidereal | 58 d + 15:36:00 s | 1407.6 hr mercuryyear | 87 d + 23:15:21.6 s | 87.969 day venusday_solar | 116 d + 18:00:00 s | 2802.0 hr mercuryday_solar | 175 d + 22:36:00 s | 4222.6 hr venusyear | 224 d + 16:49:26.4 s | 224.701 day venusday | 243 d + 00:36:00 s | venusday_sidereal venusday_sidereal | 243 d + 00:36:00 s | 5832.6 hr eclipseyear | 346 d + 14:52:48 s | 346.62 days islamicyear | 354 d | 354 day lunaryear | 354 d + 08:48:33.6 s | 12 lunarmonth islamicleapyear | 355 d | 355 day calendaryear | 1 commonyear | 365 day commonyear | 1 commonyear | 365 day solaryear | 1 commonyear + 05:48:45.9746784 s | year tropicalyear | 1 commonyear + 05:48:45.9746784 s | 365.242198781 day year | 1 commonyear + 05:48:45.9746784 s | tropicalyear yr | 1 commonyear + 05:48:45.9746784 s | year gregorianyear | 1 commonyear + 05:49:12 s | 365.2425 day julianyear | 1 commonyear + 06:00:00 s | 365.25 day earthyear | 1 commonyear + 06:09:09.5400288 s | siderealyear siderealyear | 1 commonyear + 06:09:09.5400288 s | 365.256360417 day gaussianyear | 1 commonyear + 06:09:56.0153947 s | (2 pi / gauss_k) days anomalisticyear | 1 commonyear + 06:13:49.44 s | 365.2596 days leapyear | 1 commonyear + 1 d | 366 day marsyear | 1 commonyear + 321 d + 23:31:12 s | 686.980 day lustrum | 5 commonyear + 1 d + 05:03:49.873392 s | 5 years decade | 10 commonyear + 2 d + 10:07:39.746784 s | 10 years jupiteryear | 11 commonyear + 317 d + 14:08:09.6 s | 4332.589 day saros | 18 commonyear + 15 d + 07:42:24.4 s | 223 synodicmonth saturnyear | 29 commonyear + 174 d + 05:16:48 s | 10759.22 day uranusyear | 84 commonyear + 25 d + 09:36:00 s | 30685.4 day century | 100 commonyear + 24 d + 05:16:37.46784 s | 100 years neptuneyear | 164 commonyear + 329 d | 60189 day plutoyear | 248 commonyear + 40 d | 90560 day millennia | 1000 commonyear + 242 d + 04:46:14.6784 s | millennium millennium | 1000 commonyear + 242 d + 04:46:14.6784 s | 1000 years cron | 1.00066e+06 commonyear + 203 d + 18:44:38.4 s | 1e6 years (120 rows) -- units that differ when pushed through output-input functions -- (same test as in units.sql, but with time_output_custom = true) SELECT name, unit, unit::text::unit, definition FROM unit_units WHERE unit::text::unit::text <> unit::text; name | unit | unit | definition ------+------+------+------------ (0 rows) /* custom time format is only used if dimension is time */ SELECT '1000 s'::unit, '1000 s/m'::unit; unit | unit ------------+-------- 00:16:40 s | 1 ks/m (1 row) SET unit.time_output_custom = false; SELECT '1000 s'::unit, '1000 s/m'::unit; unit | unit ------+-------- 1 ks | 1 ks/m (1 row) -- test if 'Gs' is avoided on output SELECT '1 Gsec'::unit, '1 Gsec/m'::unit; unit | unit --------+---------- 1 Gsec | 1 Gsec/m (1 row) postgresql-unit-7.8/expected/unicode.out000066400000000000000000000014241450213077700205370ustar00rootroot00000000000000SET unit.output_superscript = on; SELECT 'm⁰'::unit; unit ------ 1 (1 row) SELECT 'm¹'::unit; unit ------ 1 m (1 row) SELECT 'm²'::unit; unit ------ 1 m² (1 row) SELECT 'm⁻²'::unit; unit ------- 1 m⁻² (1 row) SELECT 'm³'::unit; unit ------ 1 m³ (1 row) SELECT 'm⁴'::unit; unit ------ 1 m⁴ (1 row) SELECT 'm⁵'::unit; unit ------ 1 m⁵ (1 row) SELECT 'm⁶'::unit; unit ------ 1 m⁶ (1 row) SELECT 'm⁷'::unit; unit ------ 1 m⁷ (1 row) SELECT 'm⁸'::unit; unit ------ 1 m⁸ (1 row) SELECT 'm⁹'::unit; unit ------ 1 m⁹ (1 row) SELECT 'm³⁴'::unit; unit ------- 1 m³⁴ (1 row) SELECT 'm⁻⁵⁶'::unit; unit -------- 1 m⁻⁵⁶ (1 row) SELECT 'm⁺⁷⁸'::unit; unit ------- 1 m⁷⁸ (1 row) postgresql-unit-7.8/expected/unit.out000066400000000000000000000144611450213077700200750ustar00rootroot00000000000000-- test input and output SELECT '1'::unit; -- unit_in unit ------ 1 (1 row) SELECT unit(1); -- dbl2unit unit ------ 1 (1 row) CREATE TEMP TABLE u (u unit); INSERT INTO u VALUES ('1'); SELECT * FROM u; u --- 1 (1 row) -- test constructors SELECT meter(); meter ------- 1 m (1 row) SELECT meter(2.0) AS two_meters; two_meters ------------ 2 m (1 row) SELECT kilogram(); kilogram ---------- 1 kg (1 row) SELECT kilogram(3.0) AS three_kilogram; three_kilogram ---------------- 3 kg (1 row) SELECT second(); second -------- 1 s (1 row) SELECT second(4.0) AS four_seconds; four_seconds -------------- 4 s (1 row) SELECT ampere(); ampere -------- 1 A (1 row) SELECT ampere(5.0) AS five_ampere; five_ampere ------------- 5 A (1 row) SELECT kelvin(); kelvin -------- 1 K (1 row) SELECT kelvin(6.0) AS six_kelvin; six_kelvin ------------ 6 K (1 row) SELECT mole(); mole ------- 1 mol (1 row) SELECT mole(7.0) AS seven_mole; seven_mole ------------ 7 mol (1 row) SELECT candela(); candela --------- 1 cd (1 row) SELECT candela(8.0) AS eight_candela; eight_candela --------------- 8 cd (1 row) SELECT byte(); byte ------ 1 B (1 row) SELECT byte(9.0) AS nine_byte; nine_byte ----------- 9 B (1 row) -- test dimensionless scales SELECT unit(0) AS zero, unit(1e-6) AS "1e-6", unit(0.001) AS "0.001", unit(1.0) AS "1", unit(1000.0) AS "1000"; zero | 1e-6 | 0.001 | 1 | 1000 ------+-------+-------+---+------ 0 | 1e-06 | 0.001 | 1 | 1000 (1 row) -- test SI prefixes SELECT meter(0) AS zero, meter(1e-6) AS "µm", meter(0.001) AS mm, meter(1.0) AS m, meter(1000.0) AS km; zero | µm | mm | m | km ------+------+------+-----+------ 0 m | 1 µm | 1 mm | 1 m | 1 km (1 row) SELECT kilogram(0) AS zero, kilogram(1e-6) AS mg, kilogram(0.001) AS g, kilogram(1.0) AS kg, kilogram(1000.0) AS "Mg"; zero | mg | g | kg | Mg ------+------+-----+------+------ 0 kg | 1 mg | 1 g | 1 kg | 1 Mg (1 row) -- test combined units (exactly one unit with exponent 1 in numerator) SELECT meter(0)/second() AS zero, meter(1e-6)/second() AS "µm", meter(0.001)/second() AS mm, meter(1.0)/second() AS m, meter(1000.0)/second() AS km; zero | µm | mm | m | km -------+--------+--------+-------+-------- 0 m/s | 1 µm/s | 1 mm/s | 1 m/s | 1 km/s (1 row) SELECT kilogram(0)/second() AS zero, kilogram(1e-6)/second() AS mg, kilogram(0.001)/second() AS g, kilogram(1.0)/second() AS kg, kilogram(1000.0)/second() AS "Mg"; zero | mg | g | kg | Mg --------+--------+-------+--------+-------- 0 kg/s | 1 mg/s | 1 g/s | 1 kg/s | 1 Mg/s (1 row) -- test parser SELECT '1 m'::unit; unit ------ 1 m (1 row) SELECT '-1 m/s'::unit; unit -------- -1 m/s (1 row) SELECT '10 dm^3'::unit, '10l'::unit; unit | unit ----------+---------- 0.01 m^3 | 0.01 m^3 (1 row) SELECT '9.81 kg*m/s^2'::unit, '9.81 kg*m/s*s'::unit, '9.81 kg*m/s/s'::unit; unit | unit | unit --------+--------+-------- 9.81 N | 9.81 N | 9.81 N (1 row) SELECT '1 foobar'::unit AS error; ERROR: unit "foobar" is not known LINE 1: SELECT '1 foobar'::unit AS error; ^ -- special values SELECT '-0'::unit, -'0'::unit, '-0 m'::unit, -'0 m'::unit; unit | ?column? | unit | ?column? ------+----------+------+---------- -0 | -0 | -0 m | -0 m (1 row) SELECT 'infinity'::unit, 'Infinity m'::unit, 'inf A'::unit; unit | unit | unit ----------+------------+------------ Infinity | Infinity m | Infinity A (1 row) SELECT '-infinity'::unit, '-Infinity m'::unit, 'Inf A'::unit; unit | unit | unit -----------+-------------+------------ -Infinity | -Infinity m | Infinity A (1 row) SELECT 'nan'::unit, 'NaN'::unit; unit | unit ------+------ NaN | NaN (1 row) -- test parser arithmetic SELECT '1|10'::unit, '1|10 m'::unit; unit | unit ------+-------- 0.1 | 100 mm (1 row) SELECT '2 m + 3 m - 4 m'::unit, '6 m - 3 m - 2 m'::unit, '6 m - 3 m + 1 m'::unit; unit | unit | unit ------+------+------ 1 m | 1 m | 4 m (1 row) SELECT '2 m * 3 m'::unit, '2 m / 3 m'::unit, '10 m / 5 m / 2 m'::unit; unit | unit | unit -------+-------------------+-------- 6 m^2 | 0.666666666666667 | 1 m^-1 (1 row) SELECT '2 m^2 + 3 m * 4 m'::unit, '2 m * 3 m / 4 m * 5 m'::unit; unit | unit --------+------ 14 m^2 | 0.3 (1 row) SELECT '2 m * (1 m + 3 m)'::unit; unit ------- 8 m^2 (1 row) SELECT '- m'::unit, '/ m'::unit; unit | unit ------+-------- -1 m | 1 m^-1 (1 row) SELECT '4+5'::unit, '4-5'::unit, '4(-5)'::unit, '4*5'::unit, '4/5'::unit; unit | unit | unit | unit | unit ------+------+------+------+------ 9 | -1 | -20 | 20 | 0.8 (1 row) -- problematic cases SELECT '1 cd'::unit AS candela; -- candela vs centiday candela --------- 1 cd (1 row) SELECT '1 Pa'::unit AS pascal; -- pascal vs petayear pascal -------- 1 Pa (1 row) SELECT '1 yg'::unit AS yoctogram, '1.00001 yg'::unit AS actual_yoctogram; -- "yg" had rounding problems in the past yoctogram | actual_yoctogram -----------+------------------ 1 yg | 1.00001 yg (1 row) SELECT '1 min'::unit AS minute; -- minute vs milliinch minute ------------ 00:01:00 s (1 row) SELECT '1 ft'::unit AS foot; -- foot vs femtotonne foot ---------- 304.8 mm (1 row) SELECT '1 yd'::unit AS yard; -- yard vs yoctoday yard ---------- 914.4 mm (1 row) -- units whose definition changed between v2 and 3 SELECT 'a'::unit AS are; are --------- 100 m^2 (1 row) SELECT 'da'::unit AS day; day ----- 1 d (1 row) SELECT 'rad'::unit AS radiation; radiation ----------- 10 mGy (1 row) -- check which prefix/unit combinations produce other dimensions (parser conflicts) SELECT p, u, (p||u)::unit FROM prefixes CROSS JOIN units WHERE u <> 'kg' AND dimension(u::unit) != dimension((p||u)::unit) AND p||u NOT IN ('dat') -- skip ambiguous unit ORDER BY lower(p) COLLATE "C", lower(u) COLLATE "C"; p | u | unit ---+-----+------------------------------- a | t | 98.0665 kPa c | d | 1 cd d | a | 1 d f | t | 304.8 mm G | s | 100 µT h | bar | 1.05457181764616e-34 m^2*kg/s h | d | 0.238480942392 m^3 k | in | 600 g m | in | 00:01:00 s n | t | 1 N P | a | 1 Pa p | a | 1 Pa p | in | 0.020457405 m^3 p | t | 0.000473176473 m^3 q | t | 0.000946352946 m^3 r | d | 5.0292 m y | d | 914.4 mm (17 rows) postgresql-unit-7.8/expected/units.out000066400000000000000000010502701450213077700202570ustar00rootroot00000000000000SET unit.time_output_custom = false; /* revert to pre-12 default */ SET extra_float_digits = 0; SELECT prefix, factor, definition FROM unit_prefixes ORDER BY factor, prefix COLLATE "C"; prefix | factor | definition ----------+----------------------+------------ q | 1e-30 | quecto quecto | 1e-30 | 1e-30 r | 1e-27 | ronto ronto | 1e-27 | 1e-27 y | 1e-24 | yocto yocto | 1e-24 | 1e-24 z | 1e-21 | zepto zepto | 1e-21 | 1e-21 a | 1e-18 | atto atto | 1e-18 | 1e-18 f | 1e-15 | femto femto | 1e-15 | 1e-15 Zennili | 1.12156654784615e-13 | 12^-12 p | 1e-12 | pico pico | 1e-12 | 1e-12 Lefi | 1.34587985741538e-12 | 12^-11 Dexi | 1.61505582889846e-11 | 12^-10 Neeni | 1.93806699467815e-10 | 12^-9 n | 1e-09 | nano nano | 1e-09 | 1e-9 Aki | 2.32568039361378e-09 | 12^-8 Sevi | 2.79081647233653e-08 | 12^-7 Hesi | 3.34897976680384e-07 | 12^-6 micro | 1e-06 | 1e-6 mu | 1e-06 | micro u | 1e-06 | micro µ | 1e-06 | micro μ | 1e-06 | micro Queni | 4.01877572016461e-06 | 12^-5 Quedri | 4.82253086419753e-05 | 12^-4 Trini | 0.000578703703703704 | 12^-3 m | 0.001 | milli milli | 0.001 | 1e-3 Duni | 0.00694444444444444 | 12^-2 c | 0.01 | centi centi | 0.01 | 1e-2 Zeni | 0.0833333333333333 | 12^-1 d | 0.1 | deci deci | 0.1 | 1e-1 ⅛ | 0.125 | 1|8 ⅙ | 0.166666666666667 | 1|6 ⅕ | 0.2 | 1|5 quarter | 0.25 | 1|4 ¼ | 0.25 | 1|4 ⅓ | 0.333333333333333 | 1|3 ⅜ | 0.375 | 3|8 ⅖ | 0.4 | 2|5 demi | 0.5 | 0.5 half | 0.5 | 0.5 hemi | 0.5 | 0.5 semi | 0.5 | 0.5 ½ | 0.5 | 1|2 ⅗ | 0.6 | 3|5 ⅝ | 0.625 | 5|8 ⅔ | 0.666666666666667 | 2|3 ¾ | 0.75 | 3|4 ⅘ | 0.8 | 4|5 ⅚ | 0.833333333333333 | 5|6 ⅞ | 0.875 | 7|8 int | 0.999998 | int UK | 0.999998261154856 | UK british | 0.999998261154856 | UK US | 1.000002000004 | US geodetic | 1.000002000004 | US survey | 1.000002000004 | US double | 2 | 2 treble | 3 | 3 triple | 3 | 3 da | 10 | deka deca | 10 | 1e1 deka | 10 | deca Zena | 12 | 12 h | 100 | hecto hecto | 100 | 1e2 Duna | 144 | 12^2 k | 1000 | kilo kilo | 1000 | 1e3 Ki | 1024 | kibi kibi | 1024 | 2^10 Trina | 1728 | 12^3 myria | 10000 | 1e4 Quedra | 20736 | 12^4 Quena | 248832 | 12^5 M | 1000000 | mega mega | 1000000 | 1e6 Mi | 1048576 | mebi mebi | 1048576 | 2^20 Hesa | 2985984 | 12^6 Seva | 35831808 | 12^7 Aka | 429981696 | 12^8 G | 1000000000 | giga giga | 1000000000 | 1e9 Gi | 1073741824 | gibi gibi | 1073741824 | 2^30 Neena | 5159780352 | 12^9 Dexa | 61917364224 | 12^10 Lefa | 743008370688 | 12^11 T | 1000000000000 | tera tera | 1000000000000 | 1e12 Ti | 1099511627776 | tebi tebi | 1099511627776 | 2^40 Zennila | 8916100448256 | 12^12 P | 1e+15 | peta peta | 1e+15 | 1e15 Pi | 1.12589990684262e+15 | pebi pebi | 1.12589990684262e+15 | 2^50 E | 1e+18 | exa exa | 1e+18 | 1e18 Ei | 1.15292150460685e+18 | exbi exbi | 1.15292150460685e+18 | 2^60 Z | 1e+21 | zetta zetta | 1e+21 | 1e21 Zi | 1.18059162071741e+21 | zebi zebi | 1.18059162071741e+21 | 2^70 Y | 1e+24 | yotta yotta | 1e+24 | 1e24 Yi | 1.20892581961463e+24 | yobi yobi | 1.20892581961463e+24 | 2^80 R | 1e+27 | ronna ronna | 1e+27 | 1e27 Ri | 1.23794003928538e+27 | robi robi | 1.23794003928538e+27 | 2^90 Q | 1e+30 | quetta quetta | 1e+30 | 1e30 Qi | 1.26765060022823e+30 | quebi quebi | 1.26765060022823e+30 | 2^100 (126 rows) RESET extra_float_digits; SELECT name, unit, definition FROM unit_units ORDER BY dimension(unit), unit, name COLLATE "C"; name | unit | definition -------------------------------+-------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ sunvmag | -26.74 | -26.74 moonvmag | -12.74 | -12.74 g0000000 | -6 | (-6) g000000 | -5 | (-5) g_h | -4.255250615 | -4.255250615 g00000 | -4 | (-4) g_n | -3.82608545 | -3.82608545 g0000 | -3 | (-3) g_mu | -2.0023318418 | -2.0023318418 g_e | -2.00231930436256 | -2.00231930436256 g000 | -2 | (-2) g00 | -1 | (-1) hbar_SI | 1.05457181764616e-34 | h_SI / 2 pi h_SI | 6.62607015e-34 | 6.62607015e-34 electronmass_SI | 9.10938370154308e-31 | electronmass_u atomicmassunit_SI atomicmassunit_SI | 1.6605390666e-27 | 1.66053906660e-27 k_SI | 1.380649e-23 | 1.380649e-23 e_SI | 1.602176634e-19 | 1.602176634e-19 partspertrillion | 1e-12 | ppt ppt | 1e-12 | 1e-12 epsilon0_SI | 8.85418781277335e-12 | 1/mu0_SI c_SI^2 squarearcsec | 2.35044305390979e-11 | squaresecond squaresecond | 2.35044305390979e-11 | 1|60^2 squareminute G_SI | 6.6743e-11 | 6.67430e-11 partsperbillion | 1e-09 | ppb ppb | 1e-09 | 1e-9 mas | 4.84813681109536e-09 | milliarcsec squarearcmin | 8.46159499407524e-08 | squareminute squareminute | 8.46159499407524e-08 | 1|60^2 squaredegree partspermillion | 1e-06 | ppm ppm | 1e-06 | 1e-6 ㏙ | 1e-06 | ppm mu0_SI | 1.25663706212384e-06 | 2 alpha h_SI / e_SI^2 c_SI centesimalsecond | 1.5707963267949e-06 | 1|100 centesimalminute " | 4.84813681109536e-06 | arcsec '' | 4.84813681109536e-06 | " arcsec | 4.84813681109536e-06 | 1|60 arcmin arcsecond | 4.84813681109536e-06 | arcsec ″ | 4.84813681109536e-06 | " seclongitude | 7.27220521664304e-05 | circle (seconds/day) basispoint | 0.0001 | 0.01 % mou_proportion | 0.0001 | 1|10000 ‱ | 0.0001 | 1|10000 centesimalminute | 0.00015707963267949 | 1|100 grade ' | 0.000290888208665722 | arcmin arcmin | 0.000290888208665722 | 1|60 degree arcminute | 0.000290888208665722 | arcmin ′ | 0.000290888208665722 | ' squaredegree | 0.000304617419786709 | 1|180^2 pi^2 sr electronmass_u | 0.000548579909065 | 5.48579909065e-4 milangle | 0.00098174770424681 | 1|6400 circle fine | 0.001 | 1|1000 mill | 0.001 | 0.001 rin_proportion | 0.001 | 1|1000 ‰ | 0.001 | 1|1000 WGS84_earthflattening | 0.00335281066474748 | 1|298.257223563 IERS_earthflattening | 0.00335281969789619 | 1|298.25642 earthflattening | 0.00335281969789619 | IERS_earthflattening moonsd | 0.00452134735054284 | asin(moonradius / moondist) sunsd | 0.00465248468611326 | asin(sunradius / sundist) proof | 0.005 | 1|200 alpha | 0.0072973525693 | 7.2973525693e-3 α | 0.0072973525693 | alpha % | 0.01 | percent bu_proportion | 0.01 | 1|100 centrad | 0.01 | 0.01 radian percent | 0.01 | 0.01 moonearthmassratio | 0.012300037032734 | moonmass/earthmass gon | 0.015707963267949 | 1|100 rightangle grade | 0.015707963267949 | gon lunarparallax | 0.0165932083670967 | asin(earthradius_equatorial / moondist) moonhp | 0.0165932083670967 | lunarparallax gauss_k | 0.01720209895 | 0.01720209895 arcdeg | 0.0174532925199433 | degree deg | 0.0174532925199433 | degree degree | 0.0174532925199433 | 1|360 circle ° | 0.0174532925199433 | degree caratgold | 0.0416666666666667 | karat karat | 0.0416666666666667 | 1|24 tithe | 0.1 | 1|10 wari | 0.1 | wari_proportion wari_proportion | 0.1 | 1|10 pointangle | 0.196349540849362 | 1|32 circle extinction_coeff | 0.21 | 0.21 sign | 0.523598775598299 | 1|12 circle g_d | 0.8574382338 | 0.8574382338 UKlength_K | 0.999981934326374 | meter / 39.37079 inch UKlength_C | 0.999991028296492 | meter / 1.09362311 yard int | 0.999998 | 3937|1200 ft/m UK | 0.999998261154856 | UKlength_SJJ UKlength_SJJ | 0.999998261154856 | 0.91439841 meter / yard UKlength_B | 0.999999125109361 | 0.9143992 meter / yard ANGLE | 1 | radian SOLID_ANGLE | 1 | steradian STRAIN | 1 | ELONGATION / LENGTH capita | 1 | people death | 1 | people one | 1 | 1 people | 1 | 1 person | 1 | people radian | 1 | 1 sr | 1 | 1 steradian | 1 | sr ㏛ | 1 | sr US | 1.000002000004 | 1200|3937 m/ft hydrogen | 1.00794 | 1.00794 syntoniccomma | 1.0125 | pythagoreanthird / majorthird pythagoreancomma | 1.01364326477051 | musicalfifth^12 / octave^7 sextant | 1.0471975511966 | 1|6 circle majorsecond | 1.125 | musicalfifth^2 / octave dry | 1.16364718614719 | drygallon/gallon minorthird | 1.2 | 6|5 polyexpnt | 1.23496899140441 | (polyndx + 1) / polyndx majorthird | 1.25 | 5|4 quintant | 1.25663706143592 | 1|5 circle pythagoreanthird | 1.265625 | majorsecond musicalfifth^2 / octave musicalfourth | 1.33333333333333 | 4|3 dotted | 1.5 | 3|2 musicalfifth | 1.5 | 3|2 octant | 1.5707963267949 | 0.5 pi sr quadrant | 1.5707963267949 | 1|4 circle rightangle | 1.5707963267949 | 90 degrees sphericalrightangle | 1.5707963267949 | 0.5 pi sr minorsixth | 1.6 | musicalfourth minorthird phi | 1.61803398874989 | (sqrt(5)+1)/2 majorsixth | 1.66666666666667 | musicalfourth majorthird doubledotted | 1.75 | 7|4 minorseventh | 1.8 | musicalfifth minorthird majorseventh | 1.875 | musicalfifth majorthird brace | 2 | 2 couple | 2 | 2 double | 2 | 2 octave | 2 | 2 pair | 2 | 2 two | 2 | 2 deuterium | 2.0141017778 | 2.0141017778 ℯ | 2.71828182845905 | exp(1) hattrick | 3 | 3 nest | 3 | 3 three | 3 | 3 triple | 3 | 3 pi | 3.14159265358979 | 3.14159265358979323846 π | 3.14159265358979 | pi 𝜋 | 3.14159265358979 | pi four | 4 | 4 quadruple | 4 | 4 helium | 4.002602 | 4.002602 polyndx | 4.25588071865567 | polyndx_1976 polyndx_1976 | 4.25588071865567 | air_1976 (kg/kmol) gravity/(R_1976 lapserate) - 1 five | 5 | 5 quintuple | 5 | 5 g_p | 5.5856946893 | 5.5856946893 g_t | 5.957924931 | 5.957924931 six | 6 | 6 circle | 6.28318530717959 | 2 pi radian rev | 6.28318530717959 | turn revolution | 6.28318530717959 | turn tau | 6.28318530717959 | 2 pi turn | 6.28318530717959 | circle τ | 6.28318530717959 | tau lithium | 6.941 | 6.941 seven | 7 | 7 eight | 8 | 8 nine | 9 | 9 beryllium | 9.012182 | 9.012182 dicker | 10 | 10 ten | 10 | 10 boron | 10.811 | 10.811 eleven | 11 | 11 dozen | 12 | 12 twelve | 12 | 12 carbon | 12.011 | 12.011 sphere | 12.5663706143592 | 4 pi sr bakersdozen | 13 | 13 thirteen | 13 | 13 fourteen | 14 | 14 nitrogen | 14.00674 | 14.00674 fifteen | 15 | 15 oxygen | 15.9994 | 15.9994 sixteen | 16 | 16 seventeen | 17 | 17 eighteen | 18 | 18 fluorine | 18.9984032 | 18.9984032 nineteen | 19 | 19 score | 20 | 20 twenty | 20 | 20 neon | 20.1797 | 20.1797 sodium | 22.989768 | 22.989768 shortquire | 24 | 24 magnesium | 24.305 | 24.3050 quire | 25 | 25 aluminium | 26.981539 | aluminum aluminum | 26.981539 | 26.981539 silicon | 28.0855 | 28.0855 air_1976 | 28.964425379591 | 78.084 % 28.0134 + 20.9476 % 31.9988 + 9340 ppm 39.948 + 314 ppm 44.00995 + 18.18 ppm 20.183 + 5.24 ppm 4.0026 + 2 ppm 16.04303 + 1.14 ppm 83.80 + 0.55 ppm 2.01594 + 0.087 ppm 131.30 air | 28.9679037780065 | 78.08% nitrogen 2 + 20.95% oxygen 2 + 9340 ppm argon + 400 ppm (carbon + oxygen 2) + 18.18 ppm neon + 5.24 ppm helium + 1.7 ppm (carbon + 4 hydrogen) + 1.14 ppm krypton + 0.55 ppm hydrogen 2 thirty | 30 | 30 phosphorus | 30.973762 | 30.973762 sulfur | 32.066 | 32.066 sulphur | 32.066 | sulfur chlorine | 35.4527 | 35.4527 potassium | 39.0983 | 39.0983 argon | 39.948 | 39.948 flock | 40 | 40 forty | 40 | 40 timer | 40 | 40 twoscore | 40 | two score calcium | 40.078 | 40.078 scandium | 44.95591 | 44.955910 titanium | 47.867 | 47.867 fifty | 50 | 50 vanadium | 50.9415 | 50.9415 chromium | 51.9961 | 51.9961 manganese | 54.93805 | 54.93805 iron | 55.845 | 55.845 nickel | 58.6934 | 58.6934 cobalt | 58.9332 | 58.93320 shock | 60 | 60 sixty | 60 | 60 threescore | 60 | three score copper | 63.546 | 63.546 zinc | 65.39 | 65.39 gallium | 69.723 | 69.723 seventy | 70 | 70 germanium | 72.61 | 72.61 arsenic | 74.92159 | 74.92159 selenium | 78.96 | 78.96 bromine | 79.904 | 79.904 eighty | 80 | 80 fourscore | 80 | four score krypton | 83.8 | 83.80 rubidium | 85.4678 | 85.4678 strontium | 87.62 | 87.62 yttrium | 88.90585 | 88.90585 ninety | 90 | 90 zirconium | 91.224 | 91.224 niobium | 92.90638 | 92.90638 molybdenum | 95.94 | 95.94 technetium | 97.9072 | 97.9072 fivescore | 100 | five score hundred | 100 | 100 toncount | 100 | 100 ruthenium | 101.07 | 101.07 rhodium | 102.9055 | 102.90550 palladium | 106.42 | 106.42 silver | 107.8682 | 107.8682 cadmium | 112.411 | 112.411 indium | 114.818 | 114.818 tin | 118.71 | 118.710 longhundred | 120 | 120 sixscore | 120 | six score antimony | 121.76 | 121.760 iodine | 126.90447 | 126.90447 tellurium | 127.6 | 127.60 xenon | 131.29 | 131.29 cesium | 132.90543 | 132.90543 barium | 137.327 | 137.327 lanthanum | 138.9055 | 138.9055 sevenscore | 140 | seven score cerium | 140.115 | 140.115 praseodymium | 140.90765 | 140.90765 gross | 144 | 144 neodymium | 144.24 | 144.24 promethium | 144.9127 | 144.9127 baumeconst | 145 | 145 samarium | 150.36 | 150.36 europium | 151.965 | 151.965 gadolinium | 157.25 | 157.25 terbium | 158.92534 | 158.92534 eightscore | 160 | eight score dysprosium | 162.5 | 162.50 holmium | 164.93032 | 164.93032 erbium | 167.26 | 167.26 thullium | 168.93421 | 168.93421 ytterbium | 173.04 | 173.04 lutetium | 174.967 | 174.967 hafnium | 178.49 | 178.49 ninescore | 180 | nine score tantalum | 180.9479 | 180.9479 tungsten | 183.84 | 183.84 rhenium | 186.207 | 186.207 osmium | 190.23 | 190.23 iridium | 192.217 | 192.217 platinum | 195.08 | 195.08 gold | 196.96654 | 196.96654 tenscore | 200 | ten score mercury | 200.59 | 200.59 thallium | 204.3833 | 204.3833 lead | 207.2 | 207.2 bismuth | 208.98037 | 208.98037 polonium | 208.9824 | 208.9824 astatine | 209.9871 | 209.9871 radon | 222.0176 | 222.0176 francium | 223.0197 | 223.0197 radium | 226.0254 | 226.0254 actinium | 227.0278 | 227.0278 protactinium | 231.03588 | 231.03588 thorium | 232.0381 | 232.0381 neptunium | 237.0482 | 237.0482 uranium | 238.0289 | 238.0289 twelvescore | 240 | twelve score americium | 243.0614 | 243.0614 plutonium | 244.0642 | 244.0642 berkelium | 247.0703 | 247.0703 curium | 247.0703 | 247.0703 californium | 251.0796 | 251.0796 einsteinium | 252.083 | 252.083 fermium | 257.0951 | 257.0951 mendelevium | 258.1 | 258.10 nobelium | 259.1009 | 259.1009 lawrencium | 262.11 | 262.11 shortream | 480 | 480 ream | 500 | 500 perfectream | 516 | 516 bundle | 1000 | 2 reams thousand | 1000 | 1000 greatgross | 1728 | 12 gross bale | 5000 | 5 bundles lakh | 100000 | 1e5 million | 1000000 | 1e6 crore | 10000000 | 1e7 c_SI | 299792458 | 299792458 arab | 1000000000 | 1e9 billion | 1000000000 | shortbillion longmilliard | 1000000000 | milliard milliard | 1000000000 | 1000 million shortbillion | 1000000000 | 1e9 kharab | 100000000000 | 1e11 longbillion | 1000000000000 | million^2 shorttrillion | 1000000000000 | 1e12 trillion | 1000000000000 | shorttrillion neel | 10000000000000 | 1e13 billiard | 1e+15 | 1000 million^2 longbilliard | 1e+15 | billiard padm | 1e+15 | 1e15 quadrillion | 1e+15 | shortquadrillion shortquadrillion | 1e+15 | 1e15 shankh | 1e+17 | 1e17 longtrillion | 1e+18 | million^3 quintillion | 1e+18 | shortquintillion shortquintillion | 1e+18 | 1e18 longtrilliard | 1e+21 | trilliard sextillion | 1e+21 | shortsextillion shortsextillion | 1e+21 | 1e21 trilliard | 1e+21 | 1000 million^3 longquadrillion | 1e+24 | million^4 septillion | 1e+24 | shortseptillion shortseptillion | 1e+24 | 1e24 longquadrilliard | 1e+27 | quadrilliard octillion | 1e+27 | shortoctillion quadrilliard | 1e+27 | 1000 million^4 shortoctillion | 1e+27 | 1e27 longquintillion | 1e+30 | million^5 nonillion | 1e+30 | shortnonillion noventillion | 1e+30 | shortnoventillion shortnonillion | 1e+30 | 1e30 shortnoventillion | 1e+30 | shortnonillion decillion | 1e+33 | shortdecillion shortdecillion | 1e+33 | 1e33 longquintilliard | 1e+33 | quintilliard quintilliard | 1e+33 | 1000 million^5 longsextillion | 1e+36 | million^6 shortundecillion | 1e+36 | 1e36 undecillion | 1e+36 | shortundecillion duodecillion | 1e+39 | shortduodecillion shortduodecillion | 1e+39 | 1e39 longsextilliard | 1e+39 | sextilliard sextilliard | 1e+39 | 1000 million^6 longseptillion | 1e+42 | million^7 shorttredecillion | 1e+42 | 1e42 tredecillion | 1e+42 | shorttredecillion quattuordecillion | 1e+45 | shortquattuordecillion shortquattuordecillion | 1e+45 | 1e45 longseptilliard | 1e+45 | septilliard septilliard | 1e+45 | 1000 million^7 longoctillion | 1e+48 | million^8 quindecillion | 1e+48 | shortquindecillion shortquindecillion | 1e+48 | 1e48 longoctilliard | 1e+51 | octilliard octilliard | 1e+51 | 1000 million^8 sexdecillion | 1e+51 | shortsexdecillion shortsexdecillion | 1e+51 | 1e51 longnonillion | 1e+54 | million^9 longnoventillion | 1e+54 | longnonillion septendecillion | 1e+54 | shortseptendecillion shortseptendecillion | 1e+54 | 1e54 longnonilliard | 1e+57 | nonilliard longnoventilliard | 1e+57 | noventilliard nonilliard | 1e+57 | 1000 million^9 noventilliard | 1e+57 | nonilliard octodecillion | 1e+57 | shortoctodecillion shortoctodecillion | 1e+57 | 1e57 longdecillion | 1e+60 | million^10 novemdecillion | 1e+60 | shortnovemdecillion shortnovemdecillion | 1e+60 | 1e60 decilliard | 1e+63 | 1000 million^10 longdecilliard | 1e+63 | decilliard shortvigintillion | 1e+63 | 1e63 vigintillion | 1e+63 | shortvigintillion longundecillion | 1e+66 | million^11 longduodecillion | 1e+72 | million^12 longtredecillion | 1e+78 | million^13 longquattuordecillion | 1e+84 | million^14 longquindecillion | 1e+90 | million^15 longsexdecillion | 1e+96 | million^16 googol | 1e+100 | 1e100 longseptdecillion | 1e+102 | million^17 longoctodecillion | 1e+108 | million^18 longnovemdecillion | 1e+114 | million^19 longvigintillion | 1e+120 | million^20 centillion | 1e+303 | 1e303 INFORMATION | 125 mB | bit bit | 125 mB | 1|8 B nat | 180.33688011112 mB | (1/ln(2)) bits nyp | 250 mB | 2 bits ban | 415.24101186092 mB | hartley dit | 415.24101186092 mB | hartley hartley | 415.24101186092 mB | log2(10) bits nibble | 500 mB | nybble nybble | 500 mB | 4 bits B | 1 B | B byte | 1 B | B octet | 1 B | 8 bits ㎅ | 1 kB | kB meg | 1 MB | megabyte ㎆ | 1 MB | MB gig | 1 GB | gigabyte ㎇ | 1 GB | GB hefnercandle | 918 mcd | hefnerunit hefnerunit | 918 mcd | 0.9 candle LUMINOUS_FLUX | 1 cd | lumen LUMINOUS_INTENSITY | 1 cd | candela candela | 1 cd | cd cd | 1 cd | cd lm | 1 cd | lumen lumen | 1 cd | cd sr ㏅ | 1 cd | cd ㏐ | 1 cd | lm candle | 1.02 cd | 1.02 candela violle | 20.17 cd | 20.17 cd AMOUNT | 1 mol | mole mol | 1 mol | mol mole | 1 mol | mol ㏖ | 1 mol | mol N_A | 6.02214076e+23 mol^-1 | avogadro avogadro | 6.02214076e+23 mol^-1 | 6.02214076e23 / mol degF | 555.555555555556 mK | 5|9 * degC degR | 555.555555555556 mK | degrankine degfahrenheit | 555.555555555556 mK | 5|9 * degC degrankine | 555.555555555556 mK | degreesrankine degreerankine | 555.555555555556 mK | degF degreesrankine | 555.555555555556 mK | degF tempR | 555.555555555556 mK | degrankine temprankine | 555.555555555556 mK | degrankine °F | 555.555555555556 mK | degF °R | 555.555555555556 mK | degR ℉ | 555.555555555556 mK | degF K | 1 K | K TEMPERATURE | 1 K | kelvin TEMPERATURE_DIFFERENCE | 1 K | kelvin degC | 1 K | K degK | 1 K | K degcelsius | 1 K | K kelvin | 1 K | K tempK | 1 K | K thermalvolt | 1 K | K °C | 1 K | degC °K | 1 K | K ℃ | 1 K | degC K | 1 K | K degreaumur | 1.25 K | 10|8 * degC standardtemp | 273.15 K | 273.15 K stdtemp | 273.15 K | standardtemp stdatmT0 | 288.15 K | 288.15 K natural_temp | 11.6045181215501 kK | natural_energy / boltzmann atomictemperature | 315.775024804067 kK | atomicenergy / boltzmann plancktemperature_red | 28.2607552243842 QK | planckenergy_red / k T_P | 141.678416215734 QK | plancktemperature plancktemperature | 141.678416215734 QK | planckenergy / k mired | 1000000 K^-1 | / microK ㎀ | 1 pA | pA hlu_current | 94.0966939781648 pA | hlu_charge / sec stA | 333.564095198152 pA | statampere statA | 333.564095198152 pA | statampere statamp | 333.564095198152 pA | statampere statampere | 333.564095198152 pA | statcoulomb / s ㎁ | 1 nA | nA ㎂ | 1 µA | µA natural_current | 803.816708890999 µA | natural_charge / natural_time ㎃ | 1 mA | mA atomiccurrent | 6.62361823750989 mA | atomiccharge / atomictime Gb | 795.774715023846 mA | gilbert Gi | 795.774715023846 mA | gilbert gilbert | 795.774715023846 mA | gauss cm / mu0 intamp | 999.835 mA | intampere intampere | 999.835 mA | 0.999835 A A | 1 A | A CURRENT | 1 A | ampere amp | 1 A | ampere ampere | 1 A | A galvat | 1 A | ampere ampere90 | 1.00000008887144 A | (K_J90 R_K90 / K_J R_K) A Bi | 10 A | biot abA | 10 A | abampere abamp | 10 A | abampere abampere | 10 A | 10 A biot | 10 A | abampere ㎄ | 1 kA | kA planckcurrent_red | 1.95755368876999 YA | planckcharge_red / plancktime_red planckcurrent | 9.81371885075816 YA | planckcharge / plancktime plancktime | 5.3912464483136e-44 s | hbar / planckenergy t_P | 5.3912464483136e-44 s | plancktime plancktime_red | 2.70277015656937e-43 s | hbar / planckenergy_red atomictime | 24.1888432658572 as | atomicaction / atomicenergy natural_time | 658.211956950907 as | hbar / natural_energy svedberg | 100 fs | 1e-13 s ㎰ | 1 ps | ps ㎱ | 1 ns | ns shake | 10 ns | 1e-8 sec ㎲ | 1 µs | µs ㎳ | 1 ms | ms jiffies | 10 ms | jiffy jiffy | 10 ms | 0.01 sec timeatom | 159.574468085106 ms | 1|47 timeounce Tim | 173.611111111111 ms | 12^-4 hour blink | 864 ms | 1e-5 day decimalsecond | 864 ms | 1|100 decimalminute siderealsecond | 997.269566435185 ms | 1|60 siderealminute TIME | 1 s | second s | 1 s | s sec | 1 s | s second | 1 s | s timeounce | 7.5 s | 1|8 timeostent siderealminute | 59.8361739861111 s | 1|60 siderealhour min | 60 s | minute minute | 60 s | 60 s timeostent | 60 s | 1|60 hour beat | 86.4 s | decimalminute decimalminute | 86.4 s | 1|100 decimalhour timeminute | 360 s | 1|10 hour timepoint | 720 s | 1|5 hour ce | 864 s | 1e-2 day bell | 1.8 ks | 1|8 watch lunour | 3.54367055555555 ks | 1|24 lune siderealhour | 3.59017043916667 ks | 1|24 siderealday hour | 3.6 ks | 60 min hr | 3.6 ks | hour decimalhour | 8.64 ks | 1|10 day watch | 14.4 ks | 4 hours jupiterday | 35.73 ks | jupiterday_sidereal jupiterday_sidereal | 35.73 ks | 9.9250 hr jupiterday_solar | 35.73324 ks | 9.9259 hr saturnday | 38.3616 ks | saturnday_sidereal saturnday_sidereal | 38.3616 ks | 10.656 hr saturnday_solar | 38.3616 ks | 10.656 hr neptuneday | 57.996 ks | neptuneday_sidereal neptuneday_sidereal | 57.996 ks | 16.11 hr neptuneday_solar | 57.996 ks | 16.11 hr uranusday | 62.064 ks | uranusday_sidereal uranusday_sidereal | 62.064 ks | 17.24 hr uranusday_solar | 62.064 ks | 17.24 hr lune | 85.0480933333333 ks | 1|30 lunation earthday | 86.16409054 ks | earthday_sidereal earthday_sidereal | 86.16409054 ks | siderealday siderealday | 86.16409054 ks | 86164.09054 s d | 86.4 ks | day da | 86.4 ks | day day | 86.4 ks | 24 hr earthday_solar | 86.4 ks | 24 hr solarday | 86.4 ks | day ㍲ | 86.4 ks | da marsday | 88.64244 ks | marsday_sidereal marsday_sidereal | 88.64244 ks | 24.6229 hr marsday_solar | 88.77492 ks | 24.6597 hr plutoday_solar | 551.8152 ks | 153.2820 hr plutoday | 551.85408 ks | plutoday_sidereal plutoday_sidereal | 551.85408 ks | 153.2928 hr sennight | 604.8 ks | 7 day week | 604.8 ks | 7 day wk | 604.8 ks | week fortnight | 1.2096 Ms | 14 day draconicmonth | 2.35113579936 Ms | nodicalmonth draconiticmonth | 2.35113579936 Ms | nodicalmonth nodicalmonth | 2.35113579936 Ms | 27.2122199 day siderealmonth | 2.3605915104 Ms | 27.321661 day anomalisticmonth | 2.380713100128 Ms | 27.55454977 day islamicmonth | 2.5488 Ms | 1|12 islamicyear lunarmonth | 2.5514428 Ms | 29 days + 12 hours + 44 minutes + 2.8 seconds lunation | 2.5514428 Ms | synodicmonth synodicmonth | 2.5514428 Ms | lunarmonth mo | 2.6297438312232 Ms | month month | 2.6297438312232 Ms | 1|12 year mercuryday | 5.06736 Ms | mercuryday_sidereal mercuryday_sidereal | 5.06736 Ms | 1407.6 hr mercuryyear | 7.6005216 Ms | 87.969 day venusday_solar | 10.0872 Ms | 2802.0 hr mercuryday_solar | 15.20136 Ms | 4222.6 hr venusyear | 19.4141664 Ms | 224.701 day venusday | 20.99736 Ms | venusday_sidereal venusday_sidereal | 20.99736 Ms | 5832.6 hr eclipseyear | 29.947968 Ms | 346.62 days islamicyear | 30.5856 Ms | 354 day lunaryear | 30.6173136 Ms | 12 lunarmonth islamicleapyear | 30.672 Ms | 355 day calendaryear | 31.536 Ms | 365 day commonyear | 31.536 Ms | 365 day solaryear | 31.5569259746784 Ms | year tropicalyear | 31.5569259746784 Ms | 365.242198781 day year | 31.5569259746784 Ms | tropicalyear yr | 31.5569259746784 Ms | year gregorianyear | 31.556952 Ms | 365.2425 day julianyear | 31.5576 Ms | 365.25 day earthyear | 31.5581495400288 Ms | siderealyear siderealyear | 31.5581495400288 Ms | 365.256360417 day gaussianyear | 31.5581960153947 Ms | (2 pi / gauss_k) days anomalisticyear | 31.55842944 Ms | 365.2596 days leapyear | 31.6224 Ms | 366 day marsyear | 59.355072 Ms | 686.980 day lustrum | 157.784629873392 Ms | 5 years decade | 315.569259746784 Ms | 10 years jupiteryear | 374.3356896 Ms | 4332.589 day saros | 568.9717444 Ms | 223 synodicmonth saturnyear | 929.596608 Ms | 10759.22 day uranusyear | 2.65121856 Gsec | 30685.4 day century | 3.15569259746784 Gsec | 100 years neptuneyear | 5.2003296 Gsec | 60189 day plutoyear | 7.824384 Gsec | 90560 day millennia | 31.5569259746784 Gsec | millennium millennium | 31.5569259746784 Gsec | 1000 years cron | 31.5569259746784 Ts | 1e6 years LUMINOUS_ENERGY | 1 s*cd | talbot lumberg | 1 s*cd | talbot lumerg | 1 s*cd | talbot talbot | 1 s*cd | lumen s atomiccharge | 160.2176634 zC | e e | 160.2176634 zC | 1.602176634e-19 A s natural_charge | 529.081768988982 zC | e / sqrt(4 pi alpha) planckcharge | 529.081768988982 zC | sqrt(epsilon0 hbar c) planckcharge_red | 529.081768988982 zC | sqrt(epsilon0 hbar c) hlu_charge | 94.0966939781648 pC | statcoulomb / sqrt(4 pi) Fr | 333.564095198152 pC | franklin esu | 333.564095198152 pC | statcoulomb franklin | 333.564095198152 pC | statcoulomb stC | 333.564095198152 pC | statcoulomb statC | 333.564095198152 pC | statcoulomb statcoul | 333.564095198152 pC | statcoulomb statcoulomb | 333.564095198152 pC | 10 coulomb cm / s c C | 1 C | coulomb CHARGE | 1 C | coulomb D_FLUX | 1 C | D_FIELD AREA coul | 1 C | C coulomb | 1 C | A s coulomb90 | 1.00000008887144 C | (K_J90 R_K90 / K_J R_K) C abC | 10 C | abcoulomb abcoul | 10 C | abcoulomb abcoulomb | 10 C | abamp sec Ah | 3.6 kC | amp hour faraday | 96.48533212331 kC | N_A e mol faraday_chem | 96.4957 kC | 96495.7 C faraday_phys | 96.5219 kC | 96521.9 C eotvos | 1e-09 s^-2 | 1e-9 Gal/cm H0 | 2.26854550262883 aHz | hubble hubble | 2.26854550262883 aHz | 70 km/s/Mpc FIT | 277.777777777778 fHz | / 1e9 hour rpm | 104.71975511966 mHz | rev/min Bq | 1 Hz | becquerel FREQUENCY | 1 Hz | hertz Hz | 1 Hz | hertz becquerel | 1 Hz | /s hertz | 1 Hz | /s hz | 1 Hz | Hz pulsatance | 1 Hz | radian / sec ㎐ | 1 Hz | Hz ㏃ | 1 Hz | Bq rps | 6.28318530717959 Hz | rev/sec K_apex1961 | 11.4 Hz | 11.4 (cd/m2) / lx s K_apex1971 | 12.5 Hz | 12.5 (cd/m2) / lx s K_lum | 12.5 Hz | K_apex1971 k1250 | 12.5 Hz | 12.5 (cd/m2) / lx s k1400 | 14 Hz | 14 (cd/m2) / lx s C_apex1961 | 224 Hz | 224 lx / lx s C_illum | 224 Hz | C_apex1961 c250 | 250 Hz | 250 lx / lx s C_apex1971 | 322 Hz | 322 lx / lx s ㎑ | 1 kHz | kHz rutherford | 1 MHz | 1e6 Bq ㎒ | 1 MHz | MHz ㎓ | 1 GHz | GHz Ci | 37 GHz | curie curie | 37 GHz | 3.7e10 Bq fresnel | 1 THz | 1e12 Hz ㎔ | 1 THz | THz bps | 125 mB/s | bit/sec cdromspeed | 153.6 kB/s | 75 2048 bytes / sec cdaudiospeed | 176.4 kB/s | 44.1 kHz 2*16 bits dvdspeed | 1.385 MB/s | 1385 kB/s kat | 1 kat | katal katal | 1 kat | mol/sec natural_mass | 1.7826619216279e-36 kg | natural_energy / c^2 atomicmass | 910.938370154308 qg | electronmass electronmass | 910.938370154308 qg | 5.48579909065e-4 u m_e | 910.938370154308 qg | electronmass m_mu | 188.353162739427 rg | muonmass muonmass | 188.353162739427 rg | 0.1134289259 u amu_phys | 1.65981 yg | 1.65981e-27 kg amu_chem | 1.66026 yg | 1.66026e-27 kg Da | 1.6605390666 yg | dalton amu | 1.6605390666 yg | atomicmassunit atomicmassunit | 1.6605390666 yg | 1.66053906660e-27 kg dalton | 1.6605390666 yg | u u | 1.6605390666 yg | atomicmassunit m_p | 1.67262192369098 yg | protonmass protonmass | 1.67262192369098 yg | 1.007276466621 u m_n | 1.67492749804378 yg | neutronmass neutronmass | 1.67492749804378 yg | 1.00866491595 u m_tau | 3.16754469110216 yg | taumass taumass | 3.16754469110216 yg | 1.90754 u deuteronmass | 3.34358377244101 yg | 2.013553212745 u m_d | 3.34358377244101 yg | deuteronmass helionmass | 5.00641277958622 yg | 3.014932247175 u m_h | 5.00641277958622 yg | helionmass m_t | 5.00735674462698 yg | tritonmass tritonmass | 5.00735674462698 yg | 3.01550071621 u alphaparticlemass | 6.64465733568168 yg | 4.001506179127 u m_alpha | 6.64465733568168 yg | alphaparticlemass blanc | 281.245269097222 ng | 1|24 periot iupenicillin | 600 ng | 0.6 microgram gamma | 1 µg | microgram mcg | 1 µg | microgram ㎍ | 1 µg | µg planckmass_red | 4.34135839913936 µg | sqrt(hbar c / 8 pi G) periot | 6.74988645833333 µg | 1|20 droit m_P | 21.764343427179 µg | planckmass planckmass | 21.764343427179 µg | sqrt(hbar c / G) iuinsulin | 41.67 µg | 41.67 microgram iudiptheria | 62.8 µg | 62.8 microgram droit | 134.997729166667 µg | 1|24 mite ㎎ | 1 mg | mg jewelerspoint | 2 mg | 1|100 carat mite | 3.2399455 mg | 1|20 grain rin_weight | 37.5 mg | 1|10 bu_weight towergrain | 45.56173359375 mg | 1|32 towerpennyweight metricgrain | 50 mg | 50 mg frenchgrain | 53.1147837033221 mg | 1|18827.15 kg gr | 64.79891 mg | grain grain | 64.79891 mg | 1|7000 pound crith | 89.885 mg | 0.089885 gram silverkirat | 182.246934375 mg | 1|16 silverdirhem tradekirat | 194.39673 mg | 1|16 tradedirhem carat | 200 mg | metriccarat ct | 200 mg | carat metriccarat | 200 mg | 0.2 gram englishcarat | 205.303477227723 mg | troyounce/151.5 bu_weight | 375 mg | 1|10 monme fun | 375 mg | 1|10 monme paperM | 453.59237 mg | lb / 1000 romanobol | 568.340439791667 mg | 1|2 scrupula atticobol | 728.9877375 mg | 1|6 atticdrachmae g | 1 g | gram gm | 1 g | gram gram | 1 g | millikg gramme | 1 g | gram aeginaobol | 1.03678256 g | 1|6 aeginadrachmae scriptulum | 1.13668087958333 g | 1|24 uncia scrupula | 1.13668087958333 g | scriptulum apscruple | 1.2959782 g | 1|3 apdram scruple | 1.2959782 g | apscruple ℈ | 1.2959782 g | scruple mercpennyweight | 1.457975475 g | 1|20 mercounce towerpennyweight | 1.457975475 g | 1|20 towerounce dwt | 1.55517384 g | pennyweight pennyweight | 1.55517384 g | 1|20 troyounce dr | 1.7718451953125 g | dram dram | 1.7718451953125 g | 1|16 ounce ʒ | 1.7718451953125 g | dram trondrop | 1.9277675725 g | 1|16 tronounce semisextula | 2.27336175916667 g | 1|12 uncia USpennyweight | 2.5 g | 2.5 grams silverdirhem | 2.91595095 g | 45 grain tradedirhem | 3.11034768 g | 48 grain momme | 3.75 g | 3.75 grams monme | 3.75 g | momme taiqian | 3.75 g | monme 台錢 | 3.75 g | taiqian mace | 3.77993641666667 g | 0.1 tael apdram | 3.8879346 g | 1|8 apounce zolotnik | 4.26580395833333 g | 1|96 funt atticdrachmae | 4.373926425 g | 1|2 atticstater sextula | 4.54672351833333 g | 1|6 uncia USnickelweight | 5 g | 5 grams aeginadrachmae | 6.22069536 g | 1|2 aeginastater siscilius | 6.8200852775 g | 1|4 uncia USdollarweight | 8.1 g | 8.1 grams atticstater | 8.74785285 g | 135 grain tola | 11.6638038 g | 1|5 chittak aeginastater | 12.44139072 g | 192 grain semuncia | 13.640170555 g | 1|2 uncia eggyolk | 18.6 g | 18.6 grams metricounce | 25 g | 25 g mounce | 25 g | metricounce romanounce | 27.28034111 g | uncia uncia | 27.28034111 g | 1|12 libra unciae | 27.28034111 g | uncia lid | 28.349523125 g | 1 oz ounce | 28.349523125 g | 1|16 pound oz | 28.349523125 g | ounce ℥ | 28.349523125 g | ounce silverwukiyeh | 29.1595095 g | 10 silverdirhem mercounce | 29.1595095 g | 1|15 mercpound towerounce | 29.1595095 g | 1|12 towerpound assayton | 29.1666666666667 g | mg ton / troyounce usassayton | 29.1666666666667 g | mg uston / troyounce eggwhite | 30 g | 30 grams tronounce | 30.84428116 g | 1|20 tronpound apounce | 31.1034768 g | troyounce fineounce | 31.1034768 g | troyounce ozt | 31.1034768 g | troyounce tradewukiyeh | 31.1034768 g | 10 tradedirhem troyounce | 31.1034768 g | 1|12 troypound brassayton | 32.6666666666667 g | mg brton / troyounce tailiang | 37.5 g | 10 monme 台兩 | 37.5 g | tailiang tael | 37.7993641666667 g | 1|16 oldcatty sescuncia | 40.920511665 g | 1.5 uncia egg | 50 g | 50 grams sextans | 54.56068222 g | 2 uncia mancus | 56.69904625 g | 2 oz chittak | 58.319019 g | 1|16 seer quadrans | 81.84102333 g | 3 uncia etti | 100 g | etto etto | 100 g | 100 g liang | 103.948251458333 g | 11|3 oz triens | 109.12136444 g | 4 uncia stickbutter | 113.3980925 g | 1|4 lb quincunx | 136.40170555 g | 5 uncia semis | 163.68204666 g | 6 uncia seprunx | 190.96238777 g | 7 uncia bes | 218.24272888 g | 8 uncia dodrans | 245.52306999 g | 9 uncia dextans | 272.8034111 g | 10 uncia romanaspound | 272.8034111 g | 4210 grain deunx | 300.08375221 g | 11 uncia libra | 327.36409332 g | 5052 grain librae | 327.36409332 g | libra romanpound | 327.36409332 g | libra arabicsilverpound | 349.914114 g | silverrotl silverrotl | 349.914114 g | 12 silverwukiyeh towerpound | 349.914114 g | 5400 grain appound | 373.2417216 g | troypound arabictradepound | 373.2417216 g | traderotl traderotl | 373.2417216 g | 12 tradewukiyeh troypound | 373.2417216 g | 5760 grain funt | 409.51718 g | 409.51718 grams mercpound | 437.3926425 g | 6750 grain atticmina | 437.3926425 g | 50 atticstaters lb | 453.59237 g | pound lbm | 453.59237 g | lb pound | 453.59237 g | 0.45359237 kg ℔ | 453.59237 g | lb frenchpound | 489.505846609816 g | 9216 frenchgrain catty | 500 g | 0.5 kg pfund | 500 g | 500 g kin | 600 g | 160 monme taijin | 600 g | kin 台斤 | 600 g | taijin oldcatty | 604.789826666667 g | 4|3 lbs tronpound | 616.8856232 g | 9520 grain aeginamina | 622.069536 g | 50 aeginastaters seer | 933.104304 g | 14400 grain ser | 933.104304 g | seer glug | 980.665 g | gram force s^2 / cm MASS | 1 kg | kilogram key | 1 kg | kg kg | 1 kg | kg kilogram | 1 kg | kg pakistanseer | 1 kg | 1 kg ㎏ | 1 kg | kg mast | 1.133980925 kg | 2.5 lb clove | 3.17514659 kg | 7 lb woolclove | 3.17514659 kg | 7 lb kan | 3.75 kg | 1000 monme kwan | 3.75 kg | kan leadstone | 5.669904625 kg | 12.5 lb stone | 6.35029318 kg | 14 lb woolstone | 6.35029318 kg | 2 woolclove hyl | 9.80665 kg | kgf s^2 / m tronstone | 9.8701699712 kg | 16 tronpound brquarterweight | 12.70058636 kg | 1|4 brhundredweight tod | 12.70058636 kg | 28 lb wooltod | 12.70058636 kg | 2 woolstone oatbushel | 14.51495584 kg | 32 lb geepound | 14.5939029372064 kg | slug slug | 14.5939029372064 kg | lbf s^2 / ft canada_oatbushel | 15.42214058 kg | 34 lb pood | 16.3806872 kg | 40 funt ricebushel | 20.41165665 kg | 45 lb barleybushel | 21.77243376 kg | 48 lb cornbushel | 25.40117272 kg | 56 lb oldhaytruss | 25.40117272 kg | 56 lb ryebushel | 25.40117272 kg | 56 lb Maz | 25.8234917881283 kg | Volm kg / oldliter Mz | 25.8234917881283 kg | Maz attictalent | 26.24355855 kg | 60 atticmina newhaytruss | 27.2155422 kg | 60 lb soybeanbushel | 27.2155422 kg | 60 lb wheatbushel | 27.2155422 kg | 60 lb fotmal | 31.7514659 kg | 70 lb aeginatalent | 37.32417216 kg | 60 aeginamina maund | 37.32417216 kg | 40 seer pakistanmaund | 40 kg | 40 pakistanseer cental | 45.359237 kg | 100 pound centner | 45.359237 kg | cental cwt | 45.359237 kg | hundredweight hundredweight | 45.359237 kg | ushundredweight nailkeg | 45.359237 kg | 100 lbs shorthundredweight | 45.359237 kg | ushundredweight ushundredweight | 45.359237 kg | 100 pounds picul | 50 kg | 100 catty zentner | 50 kg | 50 kg brhundredweight | 50.80234544 kg | 8 stone longhundredweight | 50.80234544 kg | brhundredweight oldpicul | 60.4789826666667 kg | 100 oldcatty leadwey | 79.37866475 kg | 14 leadstone woolwey | 82.55381134 kg | 13 woolstone doppelzentner | 100 kg | 2 zentner quintal | 100 kg | 100 kg woolsack | 165.10762268 kg | 2 woolwey slinch | 175.126835246476 kg | lbf s^2 / inch quarter | 226.796185 kg | quarterweight quarterweight | 226.796185 kg | 1|4 uston shortquarter | 226.796185 kg | shortquarterweight shortquarterweight | 226.796185 kg | 1|4 shortton woolsarpler | 330.21524536 kg | 2 woolsack shortton | 907.18474 kg | 2000 lb ton | 907.18474 kg | uston uston | 907.18474 kg | shortton oldhayload | 914.44221792 kg | 36 oldhaytruss fothers | 952.543977 kg | 12 leadwey newhayload | 979.7595192 kg | 36 newhaytruss metricton | 1 Mg | tonne t | 1 Mg | tonne tonne | 1 Mg | 1000 kg brton | 1.0160469088 Mg | longton longton | 1.0160469088 Mg | 20 brhundredweight woollast | 1.98129147216 Mg | 6 woolsarpler ㏏ | 1 Gg | kt vestamass | 259.027088983114 Zg | 17.288245 km^3 / s^2 G ceresmass | 938.359078854711 Zg | 62.62890 km^3 / s^2 G plutomass | 14.6157649491332 Yg | 975.500000 km^3 / s^2 G moonmass | 73.4578924831068 Yg | 4902.800118 km^3 / s^2 G mercurymass | 330.100063692073 Yg | 22031.868551 km^3 / s^2 G marsmass | 641.690901158174 Yg | 42828.375816 km^3 / s^2 G venusmass | 4.86730581484201 Rg | 324858.592000 km^3 / s^2 G earthmass | 5.97216839978724 Rg | 398600.435507 km^3 / s^2 G earthmoonmass | 6.04562629227035 Rg | earthmass+moonmass uranusmass | 86.8189383156286 Rg | 5794556.400000 km^3 / s^2 G neptunemass | 102.430623444856 Rg | 6836527.100580 km^3 / s^2 G saturnmass | 568.457888344845 Rg | 37940584.841800 km^3 / s^2 G jupitermass | 1.8985176587807 Qg | 126712764.100000 km^3 / s^2 G solarmass | 1.98840987131653e+30 kg | GMsun/G sunmass | 1.98840987131653e+30 kg | solarmass pyron | 697.8 kg/s^3 | cal_IT / cm^2 min TSI | 1.36116369462235 Mg/s^3 | solarirradiance solarconstant | 1.36116369462235 Mg/s^3 | solarirradiance solarirradiance | 1.36116369462235 Mg/s^3 | solarluminosity / (4 pi sundist^2) finsenunit | 100 Mg/s^3 | 1e5 W/m^2 sigma | 56.7037441918443 µg/s^3*K^4 | stefanboltzmann stefanboltzmann | 56.7037441918443 µg/s^3*K^4 | pi^2 k^4 / 60 hbar^3 c^2 σ | 56.7037441918443 µg/s^3*K^4 | sigma THERMAL_ADMITTANCE | 1 kg/s^3*K | THERMAL_CONDUCTIVITY / LENGTH europeanUvalue | 1 kg/s^3*K | watt / m^2 K Uvalue | 5.67826334111349 kg/s^3*K | 1/Rvalue Jy | 10 yg/s^2 | jansky fluxunit | 10 yg/s^2 | 1e-26 W/m^2 Hz jansky | 10 yg/s^2 | fluxunit langley | 41.84 Mg/s^2 | thermcalorie/cm^2 Gs | 100 µT | gauss gauss | 100 µT | abvolt sec / cm^2 hlu_bfield | 354.490770181103 µT | sqrt(4 pi) gauss natural_Bfield | 5.11894453153691 mT | natural_Efield / c B_FIELD | 1 T | tesla T | 1 T | tesla tesla | 1 T | Wb/m^2 atomicBfield | 235.05175675837 kT | atomicEfield / atomicvelocity stT | 2.99792458 MT | stattesla statT | 2.99792458 MT | stattesla stattesla | 2.99792458 MT | statWb/cm^2 planckBfield_red | 3.03594380460771e+52 T | planckEfield_red /c planckBfield | 7.63015900261363e+53 T | planckEfield / c mechanicalohm | 1 g/s | dyn s / cm mobileohm | 1 ks/kg | cm / dyn s roentgen | 0.000258 s*A/kg | 2.58e-4 C / kg rontgen | 0.000258 s*A/kg | roentgen röntgen | 0.000258 s*A/kg | roentgen sievertunit | 0.00216204 s*A/kg | 8.38 rontgen ㏆ | 1 s*A/kg | C/kg tog | 0.1 s^3*K/kg | 0.1 * degC m^2 / W clo | 0.155 s^3*K/kg | 0.155 * degC m^2 / W Rvalue | 0.176110183682306 s^3*K/kg | degF ft^2 hr / btu RSI | 1 s^3*K/kg | degC m^2 / W THERMAL_INSULANCE | 1 s^3*K/kg | THERMAL_RESISTIVITY LENGTH THERMAL_INSULATION | 1 s^3*K/kg | THERMAL_RESISTIVITY LENGTH l_P | 1.61625502442371e-35 m | plancklength plancklength | 1.61625502442371e-35 m | plancktime c plancklength_red | 8.10270108646976e-35 m | plancktime_red c protonchargeradius | 875.1 am | 0.8751e-15 m fermi | 1 fm | 1e-15 m ㎙ | 1 fm | fm lambda_C,n | 1.31959090580675 fm | neutronwavelength neutronwavelength | 1.31959090580675 fm | h / m_n c lambda_C,p | 1.32140985538856 fm | protonwavelength protonwavelength | 1.32140985538856 fm | h / m_p c deuteronchargeradius | 2.12799 fm | 2.12799e-15 m electronradius | 2.81794032620009 fm | coulombconst e^2 / electronmass c^2 lambda_C,mu | 11.7344411007418 fm | muonwavelength muonwavelength | 11.7344411007418 fm | h / m_mu c siegbahn | 100.207697 fm | xunit xunit | 100.207697 fm | xunit_cu xunit_cu | 100.207697 fm | 1.00207697e-13 m xunit_mo | 100.209952 fm | 1.00209952e-13 m bicron | 1 pm | picometer electronwavelength | 2.42631023867162 pm | h / m_e c lambda_C | 2.42631023867162 pm | electronwavelength atomiclength | 52.917721090273 pm | atomicvelocity atomictime bohrradius | 52.9177210903471 pm | alpha / 4 pi Rinfinity angstrom | 100 pm | 1e-10 m Å | 100 pm | angstrom ångström | 100 pm | angstrom Å | 100 pm | angstrom angstromstar | 100.001495 pm | 1.00001495 angstrom silicon_d220 | 192.0155716 pm | 1.920155716e-10 m siliconlattice | 543.102051087084 pm | sqrt(8) silicon_d220 ㎚ | 1 nm | nm texscaledpoint | 5.36285100577695 nm | 1|65536 texpoint texsp | 5.36285100577695 nm | texscaledpoint millionth | 25.4 nm | 1e-6 inch natural_length | 197.326980459303 nm | natural_time c micron | 1 µm | micrometer ㎛ | 1 µm | µm tenth | 2.54 µm | 0.0001 inch dmtee | 3 µm | dmteefine dmteefine | 3 µm | 3 micron dmttan | 3 µm | dmteefine hardblackarkansas | 6 µm | 6 micron hardtranslucentarkansas | 6 µm | 6 micron silversmithpoint | 6.35 µm | 1|4000 inch dmtcer | 7 µm | dmtceramic dmtceramic | 7 µm | 7 micron dmtwhite | 7 µm | dmtceramic dmte | 9 µm | dmtefine dmtefine | 9 µm | 9 micron dmtgreen | 9 µm | dmtefine hardwhitearkansas | 11 µm | 11 micron twip | 17.6388888888889 µm | 1|20 point extrafineindia | 22 µm | 22 micron softarkansas | 22 µm | 22 micron dmtf | 25 µm | dmtfine dmtfine | 25 µm | 25 micron dmtred | 25 µm | dmtfine mil | 25.4 µm | 0.001 inch pointthickness | 25.4 µm | 0.001 in thou | 25.4 µm | 0.001 inch ㏕ | 25.4 µm | mil mou | 30.3030303030303 µm | 1|10000 shaku ouncecopper | 34.325278658486 µm | oz / ft^2 copperdensity ozcu | 34.325278658486 µm | ouncecopper fineindia | 35 µm | 35 micron washita | 35 µm | 35 micron dmtblue | 45 µm | dmtcoarse dmtc | 45 µm | dmtcoarse dmtcoarse | 45 µm | 45 micron finecrystolon | 45 µm | 45 micron mediumindia | 53.5 µm | 53.5 micron dmtblack | 60 µm | dmtxcoarse dmtx | 60 µm | dmtxcoarse dmtxcoarse | 60 µm | 60 micron mediumcrystalon | 78 µm | 78 micron coarseindia | 97 µm | 97 micron dmtsilver | 120 µm | dmtxxcoarse dmtxx | 120 µm | dmtxxcoarse dmtxxcoarse | 120 µm | 120 micron coarsecrystalon | 127 µm | 127 micron frenchpoint | 187.985755191415 µm | 1|12 frenchline Q | 250 µm | 1|4 mm australiapoint | 254 µm | 0.01 inch caliber | 254 µm | 0.01 inch rin | 303.030303030303 µm | 1|1000 shaku charriere | 333.333333333333 µm | frenchcathetersize frenchcathetersize | 333.333333333333 µm | 1|3 mm fournierpoint | 348.826666666667 µm | 0.1648 inch / 12 oldpoint | 351.459803514598 µm | 1|72.27 inch printerspoint | 351.459803514598 µm | oldpoint texpoint | 351.459803514598 µm | oldpoint computerpoint | 352.777777777778 µm | 1|72 inch point | 352.777777777778 µm | computerpoint postscriptpoint | 352.777777777778 µm | computerpoint pspoint | 352.777777777778 µm | postscriptpoint metricpoint | 375 µm | 3|8 mm bertholdpoint | 375.93984962406 µm | 1|2660 m frenchprinterspoint | 375.971510382829 µm | olddidotpoint olddidotpoint | 375.971510382829 µm | 1|72 frenchinch didotpoint | 376.065 µm | germandidotpoint europeanpoint | 376.065 µm | didotpoint germandidotpoint | 376.065 µm | 0.376065 mm shoeounce | 396.875 µm | 1|64 inch INpoint | 400 µm | 0.4 mm shoeiron | 529.166666666667 µm | 1|48 inch buttonline | 635 µm | 1|40 inch nonplusultra | 752.13 µm | 2 didotpoint ㎜ | 1 mm | mm excelsior | 1.05437941054379 mm | 3 oldpoint brillant | 1.128195 mm | 3 didotpoint brilliant | 1.23010931230109 mm | 3.5 oldpoint diamondtype | 1.40583921405839 mm | 4 oldpoint diamant | 1.50426 mm | 4 didotpoint pinlength | 1.5875 mm | 1|16 inch pearl | 1.75729901757299 mm | 5 oldpoint perl | 1.880325 mm | 5 didotpoint agate | 1.93302891933029 mm | 5.5 oldpoint ruby | 1.93302891933029 mm | agate verklinje | 2.0618125 mm | 2.0618125 mm nonpareil | 2.10875882108759 mm | 6 oldpoint line | 2.11666666666667 mm | 1|12 inch frenchline | 2.25582906229698 mm | 1|12 frenchinch ligne | 2.25582906229698 mm | frenchline nonpareille | 2.25639 mm | 6 didotpoint emerald | 2.28448872284489 mm | mignonette mignonette | 2.28448872284489 mm | 6.5 oldpoint minion | 2.46021862460219 mm | 7 oldpoint kolonel | 2.632455 mm | 7 didotpoint brevier | 2.81167842811678 mm | 8 oldpoint petit | 3.00852 mm | 8 didotpoint bu_distance | 3.03030303030303 mm | 1|100 shaku bourgeois | 3.16313823163138 mm | 9 oldpoint borgis | 3.384585 mm | 9 didotpoint longprimer | 3.51459803514598 mm | 10 oldpoint corpus | 3.76065 mm | korpus garamond | 3.76065 mm | korpus korpus | 3.76065 mm | 10 didotpoint kujirajakubu | 3.78787878787879 mm | 1|100 kujirajaku smallpica | 3.86605783866058 mm | 11 oldpoint pica | 4.21751764217518 mm | 12 oldpoint computerpica | 4.23333333333333 mm | 12 computerpoint cicero | 4.51278 mm | 12 didotpoint assyriansusi | 4.572 mm | 1|20 assyrianpalm susi | 4.572 mm | assyriansusi english | 4.92043724920437 mm | 14 oldpoint mittel | 5.26491 mm | 14 didotpoint columbian | 5.62335685623357 mm | 16 oldpoint drillA | 5.9436 mm | 0.234 in tertia | 6.01704 mm | 16 didotpoint drillB | 6.0452 mm | 0.238 in drillC | 6.1468 mm | 0.242 in drillD | 6.2484 mm | 0.246 in greatprimer | 6.32627646326276 mm | 18 oldpoint beespace | 6.35 mm | 1|4 inch drillE | 6.35 mm | 0.250 in drillF | 6.5278 mm | 0.257 in drillG | 6.6294 mm | 0.261 in europeshoesize | 6.66666666666667 mm | 2|3 cm drillH | 6.7564 mm | 0.266 in text | 6.76917 mm | 18 didotpoint drillI | 6.9088 mm | 0.272 in paragon | 7.02919607029196 mm | 20 oldpoint drillJ | 7.0358 mm | 0.277 in drillK | 7.1374 mm | 0.281 in drillL | 7.366 mm | 0.290 in drillM | 7.493 mm | 0.295 in drillN | 7.6708 mm | 0.302 in drillO | 8.0264 mm | 0.316 in drillP | 8.2042 mm | 0.323 in drillQ | 8.4328 mm | 0.332 in barleycorn | 8.46665194444445 mm | 1|3 UKinch shoesize_delta | 8.46666666666667 mm | 1|3 inch drillR | 8.6106 mm | 0.339 in drillS | 8.8392 mm | 0.348 in drillT | 9.0932 mm | 0.358 in drillU | 9.3472 mm | 0.368 in drillV | 9.5758 mm | 0.377 in drillW | 9.8044 mm | 0.386 in ㎝ | 10 mm | cm drillX | 10.0838 mm | 0.397 in drillY | 10.2616 mm | 0.404 in drillZ | 10.4902 mm | 0.413 in kleine_kanon | 12.03408 mm | 32 didotpoint kanon | 13.53834 mm | 36 didotpoint meridian | 15.4642313546423 mm | 44 oldpoint grobe_kanon | 15.79473 mm | 42 didotpoint canon | 16.8700705687007 mm | 48 oldpoint missal | 18.05112 mm | 48 didotpoint romandigit | 18.5 mm | 1|16 romanfoot remendigit | 18.5166 mm | 1|40 doubleremen egyptiandigit | 18.7143571428571 mm | 1|4 egyptianpalm olympicdakylos | 19.288125 mm | olympicfinger olympicfinger | 19.288125 mm | 1|16 olympicfoot greekfinger | 19.764375 mm | 1|16 greekfoot finger | 22.225 mm | fingerbreadth fingerbreadth | 22.225 mm | 7|8 in arabicinch | 22.5213333333333 mm | 1|12 arabicfoot romaninch | 24.6666666666667 mm | 1|12 romanfoot verktum | 24.74175 mm | 12 verklinje irishinch | 25.3999558333333 mm | UKinch in | 25.4 mm | inch inch | 25.4 mm | 2.54 cm inches | 25.4 mm | inch ㏌ | 25.4 mm | in scotsinch | 25.5371293108095 mm | 1.00540054 UKinch frenchinch | 27.0699487475637 mm | 1|12 frenchfoot frenchthumb | 27.0699487475637 mm | frenchinch pouce | 27.0699487475637 mm | frenchthumb kleine_sabon | 27.07668 mm | 72 didotpoint kanejakusun | 30.3030303030303 mm | sun sun | 30.3030303030303 mm | 1|10 shaku taicun | 30.3030303030303 mm | sun 台寸 | 30.3030303030303 mm | taicun grobe_sabon | 31.58946 mm | 84 didotpoint sizeAring | 37.5 mm | 37.50 mm kujirajakusun | 37.8787878787879 mm | 1|10 kujirajaku sizeBring | 38.75 mm | 38.75 mm sizeCring | 40 mm | 40.00 mm sizeDring | 41.25 mm | 41.25 mm sizeEring | 42.5 mm | 42.50 mm sizeFring | 43.75 mm | 43.75 mm RU | 44.45 mm | U U | 44.45 mm | retmaunit retmaunit | 44.45 mm | 1.75 in sizeGring | 45 mm | 45.00 mm sizeHring | 46.25 mm | 46.25 mm sizeIring | 47.5 mm | 47.50 mm sizeJring | 48.75 mm | 48.75 mm sizeKring | 50 mm | 50.00 mm stick | 50.8 mm | 2 inches sizeLring | 51.25 mm | 51.25 mm sizeMring | 52.5 mm | 52.50 mm sizeNring | 53.75 mm | 53.75 mm sizeOring | 55 mm | 55.00 mm sizePring | 56.25 mm | 56.25 mm nail | 57.149900625 mm | 1|16 UKyard sizeQring | 57.5 mm | 57.50 mm sizeRring | 58.75 mm | 58.75 mm sizeSring | 60 mm | 60.00 mm sizeTring | 61.25 mm | 61.25 mm sizeUring | 62.5 mm | 62.50 mm sizeVring | 63.75 mm | 63.75 mm sizeWring | 65 mm | 65.00 mm sizeXring | 66.25 mm | 66.25 mm sizeYring | 67.5 mm | 67.50 mm sizeZring | 68.75 mm | 68.75 mm romanpalm | 74 mm | 1|4 romanfoot egyptianpalm | 74.8574285714286 mm | 1|7 egyptianroyalcubit irishpalm | 76.1998675 mm | 3 irishinch olympicpalestra | 77.1525 mm | olympicpalm olympicpalm | 77.1525 mm | 1|4 olympicfoot shoe_girls0 | 91.0166666666667 mm | (3+7|12) inch assyrianpalm | 91.44 mm | 1|3 assyrianfoot shoe_boys0 | 99.4833333333333 mm | (3+11|12) inch hand | 101.6 mm | 4 inch palmwidth | 101.6 mm | hand fingerlength | 114.3 mm | 4.5 in kvarter | 148.4505 mm | 6 verktum shaftment | 152.4 mm | 6 inch shoe_women0 | 201.083333333333 mm | (7+11|12) inch gurleylink | 201.168 mm | 1|50 gurleychain link | 201.168 mm | 1|100 chain surveyorslink | 201.168402336805 mm | 1|100 surveyorschain palmlength | 203.2 mm | 8 in shoe_men0 | 209.55 mm | 8.25 inch scotslink | 226.769708279988 mm | 1|100 scotschain irishspan | 228.5996025 mm | 3 irishpalm span | 228.5996025 mm | 9 UKinch olympicspan | 228.6 mm | olympicspithame olympicspithame | 228.6 mm | 3|4 foot winglink | 251.46 mm | 1|80 wingchain irishlink | 256.0315548 mm | 1|100 irishchain arabicfeet | 270.256 mm | 1|2 blackcubit arabicfoot | 270.256 mm | arabicfeet assyrianfoot | 274.32 mm | 1|2 assyriancubit bavariafoot | 291.859166666667 mm | 1|6 bavariaklafter lateromanfoot | 294.2 mm | 29.42 cm Gf | 295.580451871142 mm | Grafut Grafut | 295.580451871142 mm | gravity Tim^2 ionicfoot | 296 mm | 296 mm pedes | 296 mm | romanfoot pes | 296 mm | romanfoot romanfeet | 296 mm | romanfoot romanfoot | 296 mm | 296 mm fot | 296.901 mm | 2 kvarter earlyromanfoot | 297.3 mm | 29.73 cm swissfoot | 300 mm | 1|6 swissklafter switzerlandfoot | 300 mm | 1|6 switzerlandklafter kanejaku | 303.030303030303 mm | shaku shaku | 303.030303030303 mm | 1|3.3 m taichi | 303.030303030303 mm | shaku 台尺 | 303.030303030303 mm | taichi irishfeet | 304.79947 mm | irishfoot irishfoot | 304.79947 mm | 12 irishinch engineerslink | 304.8 mm | 1|100 engineerschain feet | 304.8 mm | foot foot | 304.8 mm | 12 inch ft | 304.8 mm | foot ramsdenslink | 304.8 mm | engineerslink scotsfeet | 306.445551729714 mm | scotsfoot scotsfoot | 306.445551729714 mm | 12 scotsinch olympicfeet | 308.61 mm | olympicfoot olympicfoot | 308.61 mm | 2|3 olympiccubit prussiafoot | 313.333333333333 mm | 1|6 prussiaklafter austriafoot | 316.08064 mm | 1|6 austriaklafter greekfeet | 316.23 mm | greekfoot greekfoot | 316.23 mm | 12.45 in podes | 316.23 mm | greekfoot pous | 316.23 mm | greekfoot frenchfeet | 324.839384970764 mm | frenchfoot frenchfoot | 324.839384970764 mm | 144|443.296 m pied | 324.839384970764 mm | frenchfoot doricfoot | 326 mm | 326 mm sumerianfoot | 330 mm | 2|3 sumeriancubit pesdrusianus | 333 mm | 33.3 cm northernfoot | 337.82 mm | 1|2 northerncubit shortgreekcubit | 355.75875 mm | 18 greekfingers kujirajaku | 378.787878787879 mm | 10|8 shaku homericcubit | 395.2875 mm | 20 greekfingers hessefoot | 416.666666666667 mm | 1|6 hesseklafter romancubit | 444 mm | 18 romaninch hebrewcubit | 446.532 mm | 17.58 in egyptianshortcubit | 449.144571428571 mm | 6 egyptianpalm irishcubit | 457.199205 mm | 18 irishinch olympiccubit | 462.915 mm | 25 remendigit greekcubit | 474.345 mm | 1.5 greekfoot diamond | 487.68 mm | 8|5 ft kus | 495 mm | sumeriancubit sumeriancubit | 495 mm | 495 mm egyptianroyalcubit | 524.002 mm | 20.63 in blackcubit | 540.512 mm | 21.28 in assyriancubit | 548.64 mm | 21.6 in biblicalcubit | 553.72 mm | 21.8 in aln | 593.802 mm | 2 fot persianroyalcubit | 640.08 mm | 7 assyrianpalm hashimicubit | 649.224 mm | 25.56 in northerncubit | 675.64 mm | 26.6 in flemishell | 685.7988075 mm | 27 UKinch arshin | 711.2 mm | (2 + 1|3) feet sailmakersyard | 723.9 mm | 28.5 in doubleremen | 740.664 mm | 29.16 in pace | 762 mm | 2.5 ft USmilitarypace | 762 mm | 30 in olympicbema | 771.525 mm | 2.5 olympicfeet olympicpace | 771.525 mm | olympicbema irishyard | 914.39841 mm | 3 irishfeet bronzeyard11 | 914.3998 mm | 914.39980 mm USdoubletimepace | 914.4 mm | 36 in internationalyard | 914.4 mm | yard yard | 914.4 mm | 3 ft yd | 914.4 mm | yard mendenhallyard | 914.401828803658 mm | surveyyard troughtonyard | 914.4219 mm | 914.42190 mm scotsell | 944.873784499951 mm | 37 scotsinch DISPLACEMENT | 1 m | LENGTH DISTANCE | 1 m | LENGTH ELONGATION | 1 m | LENGTH LENGTH | 1 m | meter m | 1 m | m meter | 1 m | m metre | 1 m | m ell | 1.1429980125 m | englishell englishell | 1.1429980125 m | 45 UKinch goad | 1.371597615 m | 4.5 UKft standardgauge | 1.4351 m | 4 ft + 8.5 in passus | 1.48 m | romanpace romanpace | 1.48 m | 5 romanfeet irishpace | 1.52399735 m | 5 irishfeet geometricpace | 1.524 m | 5 ft smoot | 1.7018 m | 5 ft + 7 in tomcruise | 1.72085 m | 5 ft + 7.75 in bavariaklafter | 1.751155 m | 1.751155 m famn | 1.781406 m | 3 aln metricklafter | 1.8 m | 1.8 m swissklafter | 1.8 m | switzerlandklafter switzerlandklafter | 1.8 m | metricklafter ken | 1.81818181818182 m | 6 shaku irishfathom | 1.82879682 m | 6 irishfeet fathom | 1.8288 m | 6 ft olympicfathom | 1.85166 m | olympicorguia olympicorguia | 1.85166 m | 6 olympicfeet prussiaklafter | 1.88 m | 1.88 m austriaklafter | 1.89648384 m | 1.89648384 m liechtensteinklafter | 1.89648411540935 m | sqrt(liechtensteinsquareklafter) greekfathom | 1.89738 m | orguia orguia | 1.89738 m | 6 greekfoot toise | 1.94903630982459 m | 6 frenchfeet sazhen | 2.1336 m | 3 arshin hesseklafter | 2.5 m | 2.5 m romanperch | 2.96 m | 10 romanfeet jou | 3.03030303030303 m | jou_distance jou_distance | 3.03030303030303 m | 10 shaku kanejakujou | 3.03030303030303 m | jou akaina | 3.1623 m | 10 greekfeet kujirajakujou | 3.78787878787879 m | 10 kujirajaku pole | 5.029191255 m | 16.5 UKft perch | 5.0292 m | rod rd | 5.0292 m | rod rod | 5.0292 m | 5.5 yard surveyorspole | 5.02921005842012 m | 1|4 surveyorschain scotsfall | 5.66924270699971 m | 6 scotsell rope | 6.0959894 m | 20 UKft irishperch | 6.40078887 m | irishpole irishpole | 6.40078887 m | 7 irishyard gurleychain | 10.0584 m | 33 feet tan_distance | 11.3636363636364 m | 3 kujirajakujou olympicamma | 18.5166 m | olympiccord olympiccord | 18.5166 m | 60 olympicfeet ch | 20.1168 m | chain chain | 20.1168 m | 66 ft wingchain | 20.1168 m | 66 feet gunterschain | 20.1168402336805 m | surveyorschain surveychain | 20.1168402336805 m | surveyorschain surveyorschain | 20.1168402336805 m | 66 surveyft scotschain | 22.6769708279988 m | 4 scotsfall irishchain | 25.60315548 m | 4 irishperch shackle | 27.432 m | 15 fathoms FL | 30.48 m | flightlevel engineerschain | 30.48 m | 100 ft flightlevel | 30.48 m | 100 ft ramsdenschain | 30.48 m | engineerschain olympicplethron | 30.861 m | 100 olympicfeet plethron | 31.623 m | 10 akaina actuslength | 35.52 m | 120 romanfeet bolt | 36.576 m | cottonbolt cottonbolt | 36.576 m | 120 ft woolbolt | 64.008 m | 210 ft footballfield | 91.44 m | usfootballfield usfootballfield | 91.44 m | 100 yards canadafootballfield | 100.584 m | 110 yards chou | 109.090909090909 m | chou_distance chou_distance | 109.090909090909 m | 60 ken skeincotton | 109.728 m | 80*54 inch UScable | 182.880365760732 m | 100 USfathom stade | 185 m | 125 romanpaces stadia | 185 m | stade stadium | 185 m | stade olympicstadion | 185.166 m | 600 olympicfeet cable | 185.2 m | 1|10 nauticalmile cablelength | 185.2 m | cable intcable | 185.2 m | cable admiraltycable | 185.3184 m | brcable brcable | 185.3184 m | 1|10 brnauticalmile stadion | 189.738 m | 100 orguia furlong | 201.168 m | 40 rod navycablelength | 219.456438912878 m | 720 USft scotsfurlong | 226.769708279988 m | 10 scotschain irishfurlong | 256.0315548 m | 10 irishchain cut | 274.32 m | 300 yards lea | 274.32 m | 300 yards heer | 548.64 m | 600 yards li | 578.90071942446 m | 10|27.8 mile click | 1 km | km klick | 1 km | click ㎞ | 1 km | km verst | 1.0668 km | 500 sazhen versta | 1.0668 km | verst romanmile | 1.48 km | 8 stadia mi | 1.609344 km | mile mile | 1.609344 km | 5280 ft smi | 1.609344 km | mile statutemile | 1.609344 km | mile scotsmile | 1.81415766623991 km | 8 scotsfurlong seamile | 1.8288 km | 6000 ft nauticalmile | 1.852 km | 1852 m nmi | 1.852 km | nauticalmile nmile | 1.852 km | nauticalmile admiraltymile | 1.853184 km | brnauticalmile brnauticalmile | 1.853184 km | 6080 ft geographicalmile | 1.853184 km | brnauticalmile irishmile | 2.0482524384 km | 8 irishfurlong borderverst | 2.1336 km | 1000 sazhen arabicmile | 2.162048 km | 4000 blackcubit romanleague | 2.22 km | 1.5 romanmile ri | 3.92727272727273 km | 36 chou league | 4.828032 km | 3 mile marineleague | 5.556 km | 3 nauticalmile parasang | 5.632704 km | 3.5 mile schoenus | 5.92 km | 4 romanmile russianmile | 7.4676 km | 7 verst marathon | 42.194988 km | 26 miles + 385 yards moondist_min | 356.371 km | 356.371 km moondist_max | 406.72 km | 406.720 km plutoradius | 1.188 Mm | 1188 km moonradius | 1.738 Mm | 1738 km mercuryradius | 2.4405 Mm | 2440.5 km marsradius | 3.3962 Mm | 3396.2 km venusradius | 6.0518 Mm | 6051.8 km IERS_earthradius_polar | 6.35675185797165 Mm | (1-IERS_earthflattening) IERS_earthradius_equatorial earthradius_polar | 6.35675185797165 Mm | (1-earthflattening) earthradius_equatorial WGS84_earthradius_polar | 6.35675231424518 Mm | (1-WGS84_earthflattening) WGS84_earthradius_equatorial earthradUSAtm | 6.356766 Mm | 6356766 m earthradius | 6.37101 Mm | 6371.01 km IERS_earthradius_equatorial | 6.3781366 Mm | 6378136.6 m earthradius_equatorial | 6.3781366 Mm | IERS_earthradius_equatorial WGS84_earthradius_equatorial | 6.378137 Mm | 6378137 m neptuneradius | 24.764 Mm | 24764 km uranusradius | 25.559 Mm | 25559 km saturnradius | 60.268 Mm | 60268 km jupiterradius | 71.492 Mm | 71492 km lightsecond | 299.792458 Mm | c s moondist | 384.4 Mm | 3.844e8 m sunradius | 696 Mm | 6.96e8 m lightminute | 17.98754748 Gm | c min mercurysundist_min | 46 Gm | 46.000 Gm mercurysundist_max | 69.818 Gm | 69.818 Gm venussundist_min | 107.48 Gm | 107.480 Gm venussundist_max | 108.941 Gm | 108.941 Gm earthsundist_min | 147.095 Gm | sundist_min sundist_min | 147.095 Gm | sundist_near sundist_near | 147.095 Gm | 147.095 Gm astronomicalunit | 149.5978707 Gm | 149597870700 m au | 149.5978707 Gm | astronomicalunit ㍳ | 149.5978707 Gm | au sundist | 149.598022960713 Gm | 1.0000010178 au earthsundist_max | 152.1 Gm | sundist_max sundist_far | 152.1 Gm | 152.100 Gm sundist_max | 152.1 Gm | sundist_far marssundist_min | 206.65 Gm | 206.650 Gm marssundist_max | 249.261 Gm | 249.261 Gm jupitersundist_min | 740.595 Gm | 740.595 Gm jupitersundist_max | 816.363 Gm | 816.363 Gm spat | 1 Tm | 1e12 m saturnsundist_min | 1.357554 Tm | 1357.554 Gm saturnsundist_max | 1.506527 Tm | 1506.527 Gm uranussundist_min | 2.732696 Tm | 2732.696 Gm uranussundist_max | 3.00139 Tm | 3001.390 Gm plutosundist_min | 4.434987 Tm | 4434.987 Gm neptunesundist_min | 4.47105 Tm | 4471.050 Gm neptunesundist_max | 4.558857 Tm | 4558.857 Gm plutosundist_max | 7.304326 Tm | 7304.326 Gm lightyear | 9.4607304725808 Pm | c julianyear ly | 9.4607304725808 Pm | lightyear parsec | 30.8567758146719 Pm | au / tan(arcsec) pc | 30.8567758146719 Pm | parsec ㍶ | 30.8567758146719 Pm | pc wiendisplacement | 0.00289777195518517 m*K | (h c/k)/4.9651142317442763 H_FLUX | 1 m*A | H_FIELD AREA debye | 3.33564095198152e-30 m*s*A | 1e-10 statC angstrom ELECTRIC_DIPOLE_MOMENT | 1 m*s*A | C m jerk | 304.8 mm/s^3 | ft / s^3 Gal | 10 mm/s^2 | cm / s^2 galileo | 10 mm/s^2 | Gal celo | 304.8 mm/s^2 | ft / s^2 ACCELERATION | 1 m/s^2 | VELOCITY / TIME ㎨ | 1 m/s^2 | m/s^2 moongravity | 1.62 m/s^2 | 1.62 m/s^2 gravity_equatorial | 9.7803263359 m/s^2 | 9.7803263359 m / s^2 force | 9.80665 m/s^2 | gravity gravity | 9.80665 m/s^2 | 9.80665 m/s^2 gravity_polar | 9.8321849378 m/s^2 | 9.8321849378 m / s^2 leo | 10 m/s^2 | 10 m/s^2 ipy | 804.894621877341 pm/s | inch/year fpm | 5.08 mm/s | ft/min lfm | 5.08 mm/s | ft/min kine | 10 mm/s | cm/s kph | 277.777777777778 mm/s | km/hr fps | 304.8 mm/s | ft/s mph | 447.04 mm/s | mile/hr knot | 514.444444444444 mm/s | nauticalmile / hr admiraltyknot | 514.773333333333 mm/s | brknot brknot | 514.773333333333 mm/s | brnauticalmile / hr VELOCITY | 1 m/s | LENGTH / TIME ㎧ | 1 m/s | m/s Vl | 1.70254340277778 m/s | Vlos Vlos | 1.70254340277778 m/s | Grafut/Tim mach | 331.46 m/s | 331.46 m/s atomicvelocity | 2.18769126364 Mm/s | sqrt(atomicenergy / atomicmass) c | 299.792458 Mm/s | 299792458 m/s light | 299.792458 Mm/s | c THERMAL_CONDUCTIVITY | 1 m*kg/s^3*K | POWER / AREA (TEMPERATURE_DIFFERENCE/LENGTH) iron_thermal_conductivity | 79.5 m*kg/s^3*K | 79.5 W / m K aluminum_thermal_conductivity | 205 m*kg/s^3*K | 205 W / m K gold_thermal_conductivity | 314 m*kg/s^3*K | 314 W / m K copper_thermal_conductivity | 385 m*kg/s^3*K | 385 W / m K silver_thermal_conductivity | 406 m*kg/s^3*K | 406 W / m K E_FIELD | 1 m*kg/s^3*A | ELECTRIC_POTENTIAL / LENGTH hlu_efield | 106273.659330906 m*kg/s^3*A | hlu_volt / cm natural_Efield | 1534620.96347511 m*kg/s^3*A | natural_volt / natural_length atomicEfield | 514220674763.521 m*kg/s^3*A | atomicpotential / atomiclength planckEfield_red | 9.10153055533218e+60 m*kg/s^3*A | planckvolt_red / plancklength_red planckEfield | 2.28746412232437e+62 m*kg/s^3*A | planckvolt / plancklength natural_force | 811.939974082986 fN | natural_energy / natural_length atomicforce | 82.3872349825827 nN | atomicenergy / atomiclength dyn | 10 µN | dyne dyne | 10 µN | cm gram / s^2 ouncedal | 8.6409346485 mN | oz ft / s^2 pond | 9.80665 mN | gram force pdl | 138.254954376 mN | poundal poundal | 138.254954376 mN | lb ft / s^2 FORCE | 1 N | newton N | 1 N | newton newton | 1 N | kg m / s^2 nt | 1 N | N lbf | 4.4482216152605 N | lb force kgf | 9.80665 N | kg force kp | 9.80665 N | kilopond slugf | 143.117298239155 N | slug force Mag | 253.241945744049 N | Maz gravity tondal | 309.69109780224 N | longton ft / s^2 funal | 1 kN | sthene sthene | 1 kN | tonne m / s^2 slinchf | 1.71740757886986 kN | slinch force kip | 4.4482216152605 kN | 1000 lbf tonf | 8.896443230521 kN | ton force planckforce_red | 4.81545388672242e+42 N | planckenergy_red / plancklength_red planckforce | 1.21025556433821e+44 N | planckenergy / plancklength mu0 | 1.25663706212384e-06 m*kg/s^2*A^2 | 2 alpha h / e^2 c atomicmomentum | 1.99285191410104e-24 m*kg/s | atomicenergy / atomicvelocity bole | 1e-05 m*kg/s | g cm / s IMPULSE | 1 m*kg/s | FORCE TIME MOMENTUM | 1 m*kg/s | MASS VELOCITY asbestoscut | 201.590692541852 m/kg | 100 yd/lb linenyarncount | 604.772077625556 m/kg | 300 yard/pound yarncut | 604.772077625556 m/kg | 300 yard/pound metricyarncount | 1 km/kg | meter/gram worstedyarncount | 1.12890787823437 km/kg | 1680 ft/pound cottonyarncount | 1.69336181735156 km/kg | 840 yard/pound typp | 2.01590692541852 km/kg | 1000 yd/lb woolyarnrun | 3.22545108066963 km/kg | 1600 yard/pound rhe | 10 m*s/kg | /poise brewster | 1e-12 m*s^2/kg | micron^2/N shed | 1e-52 m^2 | 1e-24 barn barn | 1e-28 m^2 | 1e-28 m^2 darcy | 9.86923266716013e-13 m^2 | centipoise cm^2 / s atm circularmil | 5.06707479097498e-10 m^2 | 1|4 pi mil^2 cmil | 5.06707479097498e-10 m^2 | circularmil mcm | 5.06707479097498e-07 m^2 | 1e3 circularmil ㎟ | 1e-06 m^2 | mm^2 ㎠ | 0.0001 m^2 | cm^2 circleinch | 0.000506707479097498 m^2 | circularinch circularinch | 0.000506707479097498 m^2 | 1|4 pi in^2 A10paper | 0.000962 m^2 | 26 mm 37 mm C10paper | 0.00112 m^2 | 28 mm 40 mm B10paper | 0.001364 m^2 | 31 mm 44 mm A9paper | 0.001924 m^2 | 37 mm 52 mm C9paper | 0.00228 m^2 | 40 mm 57 mm B9paper | 0.002728 m^2 | 44 mm 62 mm envelope00coin | 0.002993945625 m^2 | 1.6875 inch 2.75 inch A8paper | 0.003848 m^2 | 52 mm 74 mm C8paper | 0.004617 m^2 | 57 mm 81 mm envelope1baby | 0.005080635 m^2 | 2.25 inch 3.5 inch envelope1coin | 0.005080635 m^2 | 2.25 inch 3.5 inch B8paper | 0.005456 m^2 | 62 mm 88 mm envelope3coin | 0.006854825 m^2 | 2.5 inch 4.25 inch A7paper | 0.00777 m^2 | 74 mm 105 mm envelope4coin | 0.00870966 m^2 | 3 inch 4.5 inch C7paper | 0.009234 m^2 | 81 mm 114 mm envelope4_5coin | 0.009435465 m^2 | 3 inch 4.875 inch envelope5coin | 0.00973788375 m^2 | 2.875 inch 5.25 inch B7paper | 0.011 m^2 | 88 mm 125 mm envelope5_5coin | 0.0110886875 m^2 | 3.125 inch 5.5 inch envelope4bar | 0.011985863125 m^2 | 3.625 inch 5.125 inch envelopeA1size | 0.011985863125 m^2 | 3.625 inch 5.125 inch envelope6coin | 0.01306449 m^2 | 3.375 inch 6 inch envelope6_25size | 0.01354836 m^2 | 3.5 inch 6 inch envelope7coin | 0.01467739 m^2 | 3.5 inch 6.5 inch envelope6_75size | 0.0152015825 m^2 | 3.625 inch 6.5 inch A6paper | 0.01554 m^2 | 105 mm 148 mm envelope5_5bar | 0.01622980625 m^2 | 4.375 inch 5.75 inch envelopeA2size | 0.01622980625 m^2 | 4.375 inch 5.75 inch envelope7size | 0.0163306125 m^2 | 3.75 inch 6.75 inch C6paper | 0.018468 m^2 | 114 mm 162 mm envelope7_75size | 0.0187499625 m^2 | 3.875 inch 7.5 inch envelope6bar | 0.019919315 m^2 | 4.75 inch 6.5 inch envelopeA6size | 0.019919315 m^2 | 4.75 inch 6.5 inch envelope8_625size | 0.020171330625 m^2 | 3.625 inch 8.625 inch B6paper | 0.022 m^2 | 125 mm 176 mm envelope9size | 0.022187455625 m^2 | 3.875 inch 8.875 inch envelopeA7size | 0.0245564025 m^2 | 5.25 inch 7.25 inch envelope10size | 0.0252822075 m^2 | 4.125 inch 9.5 inch envelopeA8size | 0.0288305875 m^2 | 5.5 inch 8.125 inch envelope11size | 0.0301209075 m^2 | 4.5 inch 10.375 inch A5paper | 0.03108 m^2 | 148 mm 210 mm envelopeA9size | 0.0324596125 m^2 | 5.75 inch 8.75 inch envelope12size | 0.03370961 m^2 | 4.75 inch 11 inch envelopeA10size | 0.03677412 m^2 | 6 inch 9.5 inch envelope14size | 0.0370967 m^2 | 5 inch 11.5 inch C5paper | 0.037098 m^2 | 162 mm 229 mm B5paper | 0.044 m^2 | 176 mm 250 mm envelope16size | 0.04645152 m^2 | 6 inch 12 inch executivesize | 0.049112805 m^2 | 7.25 inch 10.5 inch Apaper | 0.06032246 m^2 | 8.5 inch 11 inch lettersize | 0.06032246 m^2 | 8.5 inch 11 inch A4paper | 0.06237 m^2 | 210 mm 297 mm C4paper | 0.074196 m^2 | 229 mm 324 mm legalsize | 0.07677404 m^2 | 8.5 inch 14 inch Sf | 0.0873678035283485 m^2 | Surf Surf | 0.0873678035283485 m^2 | Grafut^2 B4paper | 0.08825 m^2 | 250 mm 353 mm sabin | 0.09290304 m^2 | ft^2 Bpaper | 0.12064492 m^2 | 11 inch 17 inch ledgersize | 0.12064492 m^2 | 11 inch 17 inch A3paper | 0.12474 m^2 | 297 mm 420 mm C3paper | 0.148392 m^2 | 324 mm 458 mm B3paper | 0.1765 m^2 | 353 mm 500 mm Cpaper | 0.24128984 m^2 | 17 inch 22 inch A2paper | 0.24948 m^2 | 420 mm 594 mm C2paper | 0.296784 m^2 | 458 mm 648 mm gou_area | 0.330578512396694 m^2 | 1|10 tsubo B2paper | 0.3535 m^2 | 500 mm 707 mm flag | 0.4645152 m^2 | 5 ft^2 Dpaper | 0.48257968 m^2 | 22 inch 34 inch A1paper | 0.499554 m^2 | 594 mm 841 mm C1paper | 0.594216 m^2 | 648 mm 917 mm B1paper | 0.707 m^2 | 707 mm 1000 mm Epaper | 0.96515936 m^2 | 34 inch 44 inch A0paper | 0.999949 m^2 | 841 mm 1189 mm AREA | 1 m^2 | LENGTH^2 m2 | 1 m^2 | m^2 ㎡ | 1 m^2 | m^2 C0paper | 1.189349 m^2 | 917 mm 1297 mm B0paper | 1.414 m^2 | 1000 mm 1414 mm edoma | 1.544536271809 m^2 | (5.8*2.9) shaku^2 jou_area | 1.544536271809 m^2 | edoma tatami | 1.544536271809 m^2 | jou_area chuukyouma | 1.65289256198347 m^2 | (6*3) shaku^2 kyouma | 1.82231404958678 m^2 | (6.3*3.15) shaku^2 rollwallpaper | 2.7870912 m^2 | 30 ft^2 ping | 3.30578512396694 m^2 | tsubo tsubo | 3.30578512396694 m^2 | 36 shaku^2 坪 | 3.30578512396694 m^2 | ping liechtensteinsquareklafter | 3.596652 m^2 | 3.596652 m^2 australiasquare | 9.290304 m^2 | (10 ft)^2 basebox | 20.2322176 m^2 | 31360 in^2 actus | 42.05568 m^2 | 120*4 romanfeet^2 se | 99.1735537190083 m^2 | 30 tsubo a | 100 m^2 | are are | 100 m^2 | 100 m^2 fen | 969.917355371901 m^2 | 1|10 jia fen_area | 969.917355371901 m^2 | 1|10 jia 分 | 969.917355371901 m^2 | fen 分地 | 969.917355371901 m^2 | fen_area tan_area | 991.735537190083 m^2 | 10 se rood | 1011.7141056 m^2 | furlong rod acnua | 1261.6704 m^2 | squareactus squareactus | 1261.6704 m^2 | 120^2 romanfeet^2 scotsrood | 1285.61251483477 m^2 | 40 scotsfall^2 irishrood | 1638.80392633263 m^2 | 40 irishpole^2 iugera | 2523.3408 m^2 | iugerum iugerum | 2523.3408 m^2 | 2 squareactus jugera | 2523.3408 m^2 | iugerum jugerum | 2523.3408 m^2 | iugerum arpent | 3418.86828331318 m^2 | 180^2 pied^2 acre | 4046.8564224 m^2 | intacre intacre | 4046.8564224 m^2 | 10 chain^2 USacre | 4046.87260987425 m^2 | 10 surveychain^2 heredia | 5046.6816 m^2 | heredium heredium | 5046.6816 m^2 | 2 iugera scotsacre | 5142.4500593391 m^2 | 4 scotsrood austriayoke | 5754.64152860983 m^2 | 8 austriaklafter * 200 austriaklafter irishacre | 6555.21570533054 m^2 | 4 irishrood jia | 9699.17355371901 m^2 | 2934 ping 甲 | 9699.17355371901 m^2 | jia chou_area | 9917.35537190083 m^2 | 10 tan_area hectare | 10000 m^2 | hectoare ㏊ | 10000 m^2 | ha dessiatine | 10925.397504 m^2 | 2400 sazhen^2 dessjatine | 10925.397504 m^2 | dessiatine nook | 60702.846336 m^2 | 1|2 virgate virgate | 121405.692672 m^2 | 1|4 hide area_vaticancity | 440000 m^2 | 0.44 km^2 hide | 485622.770688 m^2 | 120 acre centuria | 504668.16 m^2 | 100 heredia centurium | 504668.16 m^2 | centuria homestead | 647497.027584 m^2 | 160 acre ㎢ | 1000000 m^2 | km^2 area_monaco | 2020000 m^2 | 2.02 km^2 section | 2589988.110336 m^2 | mile^2 township | 93239571.972096 m^2 | 36 section area_liechtenstein | 160000000 m^2 | 160 km^2 area_districtofcolumbia | 177000000 m^2 | 177.0 km^2 area_malta | 316000000 m^2 | 316 km^2 area_gazastrip | 360000000 m^2 | 360 km^2 area_singapore | 716000000 m^2 | 716 km^2 area_golanheights | 1150000000 m^2 | 1150 km^2 area_luxembourg | 2586000000 m^2 | 2586 km^2 area_hongkong | 2755000000 m^2 | 2755 km^2 area_rhodeisland | 4001200000 m^2 | 4001.2 km^2 area_princeedwardisland | 5660000000 m^2 | 5660 km^2 area_westbank | 5860000000 m^2 | 5860 km^2 area_delaware | 6445800000 m^2 | 6445.8 km^2 area_puertorico | 9104000000 m^2 | 9104 km^2 area_cyprus | 9251000000 m^2 | 9251 km^2 area_lebanon | 10452000000 m^2 | 10452 km^2 area_kosovo | 10887000000 m^2 | 10887 km^2 area_jamaica | 10991000000 m^2 | 10991 km^2 area_gambia | 11295000000 m^2 | 11295 km^2 area_qatar | 11586000000 m^2 | 11586 km^2 area_vanatu | 12189000000 m^2 | 12189 km^2 area_montenegro | 13812000000 m^2 | 13812 km^2 area_bahamas | 13943000000 m^2 | 13943 km^2 area_northernireland | 14133380000 m^2 | 14133.38 km^2 area_connecticut | 14357400000 m^2 | 14357.4 km^2 area_easttimor | 14919000000 m^2 | 14919 km^2 area_eswatini | 17364000000 m^2 | 17364 km^2 area_kuwait | 17818000000 m^2 | 17818 km^2 area_fiji | 18272000000 m^2 | 18272 km^2 area_slovenia | 20273000000 m^2 | 20273 km^2 area_israel | 20770000000 m^2 | 20770 km^2 area_elsalvador | 21041000000 m^2 | 21041 km^2 area_wales | 21224480000 m^2 | 21224.48 km^2 area_newjersey | 22591400000 m^2 | 22591.4 km^2 area_belize | 22966000000 m^2 | 22966 km^2 area_djibouti | 23200000000 m^2 | 23200 km^2 area_newhampshire | 24214200000 m^2 | 24214.2 km^2 area_vermont | 24906300000 m^2 | 24906.3 km^2 area_northmacedonia | 25713000000 m^2 | 25713 km^2 area_rwanda | 26338000000 m^2 | 26338 km^2 area_crimea | 27000000000 m^2 | 27000 km^2 area_massachusetts | 27335700000 m^2 | 27335.7 km^2 area_haiti | 27750000000 m^2 | 27750 km^2 area_burundi | 27834000000 m^2 | 27834 km^2 area_equitorialguinea | 28051000000 m^2 | 28051 km^2 area_hawaii | 28313000000 m^2 | 28313.0 km^2 area_albania | 28748000000 m^2 | 28748 km^2 area_solomonislands | 28896000000 m^2 | 28896 km^2 area_armenia | 29743000000 m^2 | 29743 km^2 area_lesotho | 30355000000 m^2 | 30355 km^2 area_belgium | 30528000000 m^2 | 30528 km^2 area_maryland | 32131200000 m^2 | 32131.2 km^2 area_moldova | 33846000000 m^2 | 33846 km^2 area_guineabissau | 36125000000 m^2 | 36125 km^2 area_taiwan | 36193000000 m^2 | 36193 km^2 area_bhutan | 38394000000 m^2 | 38394 km^2 area_switzerland | 41284000000 m^2 | 41284 km^2 area_netherlands | 41850000000 m^2 | 41850 km^2 area_denmark | 43094000000 m^2 | 43094 km^2 area_estonia | 45227000000 m^2 | 45227 km^2 area_dominicanrepublic | 48671000000 m^2 | 48671 km^2 area_slovakia | 49037000000 m^2 | 49037 km^2 area_costarica | 51100000000 m^2 | 51100 km^2 area_bosnia | 51209000000 m^2 | 51209 km^2 area_novascotia | 55284000000 m^2 | 55284 km^2 area_croatia | 56594000000 m^2 | 56594 km^2 area_togo | 56785000000 m^2 | 56785 km^2 area_westvirginia | 62755500000 m^2 | 62755.5 km^2 area_latvia | 64559000000 m^2 | 64559 km^2 area_lithuania | 65300000000 m^2 | 65300 km^2 area_srilanka | 65610000000 m^2 | 65610 km^2 area_georgia | 69700000000 m^2 | 69700 km^2 area_ireland | 70273000000 m^2 | 70273 km^2 area_sierraleone | 71740000000 m^2 | 71740 km^2 area_newbrunswick | 72908000000 m^2 | 72908 km^2 area_panama | 75417000000 m^2 | 75417 km^2 area_czechia | 78865000000 m^2 | 78865 km^2 area_czechrepublic | 78865000000 m^2 | area_czechia area_scotland | 80226360000 m^2 | 80226.36 km^2 area_southcarolina | 82932700000 m^2 | 82932.7 km^2 area_uae | 83600000000 m^2 | 83600 km^2 area_austria | 83871000000 m^2 | 83871 km^2 area_azerbaijan | 86600000000 m^2 | 86600 km^2 area_serbia | 88361000000 m^2 | 88361 km^2 area_jordan | 89342000000 m^2 | 89342 km^2 area_maine | 91633100000 m^2 | 91633.1 km^2 area_portugal | 92090000000 m^2 | 92090 km^2 area_hungary | 93028000000 m^2 | 93028 km^2 area_indiana | 94326200000 m^2 | 94326.2 km^2 area_southkorea | 100210000000 m^2 | 100210 km^2 area_iceland | 103000000000 m^2 | 103000 km^2 area_kentucky | 104655700000 m^2 | 104655.7 km^2 area_guatemala | 108889000000 m^2 | 108889 km^2 area_tennessee | 109153100000 m^2 | 109153.1 km^2 area_cuba | 109884000000 m^2 | 109884 km^2 area_virginia | 110786600000 m^2 | 110786.6 km^2 area_bulgaria | 110879000000 m^2 | 110879 km^2 area_liberia | 111369000000 m^2 | 111369 km^2 area_honduras | 112492000000 m^2 | 112492 km^2 area_benin | 114763000000 m^2 | 114763 km^2 area_ohio | 116097700000 m^2 | 116097.7 km^2 area_eritrea | 117600000000 m^2 | 117600 km^2 area_malawi | 118484000000 m^2 | 118484 km^2 area_pennsylvania | 119280200000 m^2 | 119280.2 km^2 area_northkorea | 120540000000 m^2 | 120540 km^2 area_mississippi | 125437700000 m^2 | 125437.7 km^2 area_nicaragua | 130373000000 m^2 | 130373 km^2 area_greece | 131990000000 m^2 | 131990 km^2 area_england | 132947760000 m^2 | 132947.76 km^2 area_louisiana | 135658700000 m^2 | 135658.7 km^2 area_alabama | 135767400000 m^2 | 135767.4 km^2 area_arkansas | 137731800000 m^2 | 137731.8 km^2 area_northcarolina | 139391000000 m^2 | 139391.0 km^2 area_newyork | 141296700000 m^2 | 141296.7 km^2 area_tajikistan | 143100000000 m^2 | 143100 km^2 area_iowa | 145745900000 m^2 | 145745.9 km^2 area_nepal | 147181000000 m^2 | 147181 km^2 area_bangladesh | 147570000000 m^2 | 147570 km^2 area_illinois | 149995400000 m^2 | 149995.4 km^2 area_georgia_us | 153910400000 m^2 | 153910.4 km^2 area_englandwales | 154172240000 m^2 | area_england + area_wales area_tunisia | 163610000000 m^2 | 163610 km^2 area_suriname | 163820000000 m^2 | 163820 km^2 area_wisconsin | 169634800000 m^2 | 169634.8 km^2 area_florida | 170311700000 m^2 | 170311.7 km^2 area_somaliland | 176120000000 m^2 | 176120 km^2 area_uruguay | 176215000000 m^2 | 176215 km^2 area_missouri | 180540300000 m^2 | 180540.3 km^2 area_cambodia | 181035000000 m^2 | 181035 km^2 area_oklahoma | 181037200000 m^2 | 181037.2 km^2 area_northdakota | 183107800000 m^2 | 183107.8 km^2 area_washington | 184660800000 m^2 | 184660.8 km^2 area_syria | 185180000000 m^2 | 185180 km^2 area_senegal | 196722000000 m^2 | 196722 km^2 area_southdakota | 199728700000 m^2 | 199728.7 km^2 area_kyrgyzstan | 199951000000 m^2 | 199951 km^2 area_nebraska | 200329900000 m^2 | 200329.9 km^2 area_belarus | 207600000000 m^2 | 207600 km^2 area_kansas | 213100000000 m^2 | 213100.0 km^2 area_guyana | 214969000000 m^2 | 214969 km^2 area_idaho | 216442600000 m^2 | 216442.6 km^2 area_utah | 219881900000 m^2 | 219881.9 km^2 area_minnesota | 225162800000 m^2 | 225162.8 km^2 area_gb | 234398600000 m^2 | area_greatbritain area_greatbritain | 234398600000 m^2 | area_england + area_wales + area_scotland area_laos | 236800000000 m^2 | 236800 km^2 area_romania | 238397000000 m^2 | 238397 km^2 area_ghana | 238533000000 m^2 | 238533 km^2 area_uganda | 241550000000 m^2 | 241550 km^2 area_guinea | 245857000000 m^2 | 245857 km^2 area_uk | 248531980000 m^2 | area_unitedkingdom area_unitedkingdom | 248531980000 m^2 | area_greatbritain + area_northernireland area_michigan | 250486800000 m^2 | 250486.8 km^2 area_wyoming | 253334500000 m^2 | 253334.5 km^2 area_oregon | 254799200000 m^2 | 254799.2 km^2 area_westernsahara | 266000000000 m^2 | 266000 km^2 area_gabon | 267668000000 m^2 | 267668 km^2 area_colorado | 269601400000 m^2 | 269601.4 km^2 area_newzealand | 270467000000 m^2 | 270467 km^2 area_burkinafaso | 274222000000 m^2 | 274222 km^2 area_ecuador | 276841000000 m^2 | 276841 km^2 area_nevada | 286379700000 m^2 | 286379.7 km^2 area_arizona | 295233500000 m^2 | 295233.5 km^2 area_philippines | 300000000000 m^2 | 300000 km^2 area_italy | 301339000000 m^2 | 301339 km^2 area_oman | 309500000000 m^2 | 309500 km^2 area_poland | 312696000000 m^2 | 312696 km^2 area_newmexico | 314917400000 m^2 | 314917.4 km^2 area_ivorycoast | 322463000000 m^2 | 322463 km^2 area_norway | 323802000000 m^2 | 323802 km^2 area_malaysia | 330803000000 m^2 | 330803 km^2 area_vietnam | 331212000000 m^2 | 331212 km^2 area_finland | 338424000000 m^2 | 338424 km^2 area_congorepublic | 342000000000 m^2 | 342000 km^2 area_germany | 357114000000 m^2 | 357114 km^2 area_japan | 377973000000 m^2 | 377973 km^2 area_montana | 380831100000 m^2 | 380831.1 km^2 area_zimbabwe | 390757000000 m^2 | 390757 km^2 area_newfoundlandandlabrador | 405212000000 m^2 | 405212 km^2 area_paraguay | 406752000000 m^2 | 406752 km^2 area_california | 423967400000 m^2 | 423967.4 km^2 area_iraq | 438317000000 m^2 | 438317 km^2 area_morocco | 446550000000 m^2 | 446550 km^2 area_uzbekistan | 447400000000 m^2 | 447400 km^2 area_sweden | 450295000000 m^2 | 450295 km^2 area_papuanewguinea | 462840000000 m^2 | 462840 km^2 area_cameroon | 475422000000 m^2 | 475422 km^2 area_yukon | 482443000000 m^2 | 482443 km^2 area_turkmenistan | 488100000000 m^2 | 488100 km^2 area_spain | 505992000000 m^2 | 505992 km^2 area_thailand | 513120000000 m^2 | 513120 km^2 area_yemen | 527968000000 m^2 | 527968 km^2 area_kenya | 580367000000 m^2 | 580367 km^2 area_botswana | 581730000000 m^2 | 581730 km^2 area_madagascar | 587041000000 m^2 | 587041 km^2 area_ukraine | 603500000000 m^2 | 603500 km^2 area_centralafrica | 622984000000 m^2 | 622984 km^2 area_somalia | 637657000000 m^2 | 637657 km^2 area_france | 640679000000 m^2 | 640679 km^2 area_southsudan | 644329000000 m^2 | 644329 km^2 area_manitoba | 647797000000 m^2 | 647797 km^2 area_saskatchewan | 651036000000 m^2 | 651036 km^2 area_afghanistan | 652230000000 m^2 | 652230 km^2 area_alberta | 661848000000 m^2 | 661848 km^2 area_burma | 676578000000 m^2 | area_myanmar area_myanmar | 676578000000 m^2 | 676578 km^2 area_texas | 695661600000 m^2 | 695661.6 km^2 area_zambia | 752612000000 m^2 | 752612 km^2 area_chile | 756102000000 m^2 | 756102 km^2 area_turkey | 783562000000 m^2 | 783562 km^2 area_mozambique | 801590000000 m^2 | 801590 km^2 area_namibia | 825615000000 m^2 | 825615 km^2 area_pakistan | 881912000000 m^2 | 881912 km^2 area_venezuela | 916445000000 m^2 | 916445 km^2 area_nigeria | 923768000000 m^2 | 923768 km^2 area_britishcolumbia | 944735000000 m^2 | 944735 km^2 area_tanzania | 945087000000 m^2 | 945087 km^2 area_egypt | 1002450000000 m^2 | 1002450 km^2 area_mauritania | 1030700000000 m^2 | 1030700 km^2 area_ontario | 1076395000000 m^2 | 1076395 km^2 area_bolivia | 1098581000000 m^2 | 1098581 km^2 area_ethiopia | 1104300000000 m^2 | 1104300 km^2 area_colombia | 1141748000000 m^2 | 1141748 km^2 area_southafrica | 1221037000000 m^2 | 1221037 km^2 area_mali | 1240192000000 m^2 | 1240192 km^2 area_angola | 1246700000000 m^2 | 1246700 km^2 area_niger | 1267000000000 m^2 | 1267000 km^2 area_chad | 1284000000000 m^2 | 1284000 km^2 area_peru | 1285216000000 m^2 | 1285216 km^2 area_northwestterritories | 1346106000000 m^2 | 1346106 km^2 area_quebec | 1542056000000 m^2 | 1542056 km^2 area_mongolia | 1564110000000 m^2 | 1564110 km^2 area_canada_additional | 1598192000000 m^2 | area_manitoba + area_britishcolumbia + area_princeedwardisland area_iran | 1648195000000 m^2 | 1648195 km^2 area_canada_recent | 1718096000000 m^2 | area_alberta + area_saskatchewan + area_newfoundlandandlabrador area_alaska | 1723336800000 m^2 | 1723336.8 km^2 area_libya | 1759540000000 m^2 | 1759540 km^2 area_sudan | 1861484000000 m^2 | 1861484 km^2 area_indonesia | 1910931000000 m^2 | 1910931 km^2 area_mexico | 1964375000000 m^2 | 1964375 km^2 area_nunavut | 2093190000000 m^2 | 2093190 km^2 area_saudiarabia | 2149690000000 m^2 | 2149690 km^2 area_greenland | 2166086000000 m^2 | 2166086 km^2 area_drcongo | 2344858000000 m^2 | 2344858 km^2 area_algeria | 2381741000000 m^2 | 2381741 km^2 area_kazakhstan | 2724900000000 m^2 | 2724900 km^2 area_canada_original | 2746643000000 m^2 | area_ontario + area_quebec + area_novascotia + area_newbrunswick area_argentina | 2780400000000 m^2 | 2780400 km^2 area_india | 3287263000000 m^2 | 3287263 km^2 area_canada_territories | 3921739000000 m^2 | area_northwestterritories + area_yukon + area_nunavut area_eu | 4234547000000 m^2 | area_europeanunion area_europeanunion | 4234547000000 m^2 | area_austria + area_belgium + area_bulgaria + area_croatia + area_cyprus + area_czechia + area_denmark + area_estonia + area_finland + area_france + area_germany + area_greece + area_hungary + area_ireland + area_italy + area_latvia + area_lithuania + area_luxembourg + area_malta + area_netherlands + area_poland + area_portugal + area_romania + area_slovakia + area_slovenia + area_spain + area_sweden area_canada_provinces | 6062931000000 m^2 | area_canada_original + area_canada_additional + area_canada_recent area_australia | 7692024000000 m^2 | 7692024 km^2 area_brazil | 8515767000000 m^2 | 8515767 km^2 area_china | 9596961000000 m^2 | 9596961 km^2 area_unitedstates | 9833516900000 m^2 | area_alabama + area_alaska + area_arizona + area_arkansas + area_california + area_colorado + area_connecticut + area_delaware + area_districtofcolumbia + area_florida + area_georgia_us + area_hawaii + area_idaho + area_illinois + area_indiana + area_iowa + area_kansas + area_kentucky + area_louisiana + area_maine + area_maryland + area_massachusetts + area_michigan + area_minnesota + area_mississippi + area_missouri + area_montana + area_nebraska + area_nevada + area_newhampshire + area_newjersey + area_newmexico + area_newyork + area_northcarolina + area_northdakota + area_ohio + area_oklahoma + area_oregon + area_pennsylvania + area_rhodeisland + area_southcarolina + area_southdakota + area_tennessee + area_texas + area_utah + area_vermont + area_virginia + area_washington + area_westvirginia + area_wisconsin + area_wyoming area_us | 9833516900000 m^2 | area_unitedstates area_canada | 9984670000000 m^2 | area_canada_provinces + area_canada_territories area_antarctica | 14000000000000 m^2 | 14000000 km^2 area_russia | 17098246000000 m^2 | 17098246 km^2 landarea | 148847000000000 m^2 | 148.847e6 km^2 oceanarea | 361254000000000 m^2 | 361.254e6 km^2 mu_e | -9.28476470433484e-24 m^2*A | g_e mu_B / 2 mu_mu | -4.49044829536168e-26 m^2*A | g_mu e hbar / 4 muonmass mu_h | -1.0746175320898e-26 m^2*A | g_h mu_N / 2 mu_n | -9.66236510101225e-27 m^2*A | g_n mu_N / 2 mu_d | 4.33073509455608e-27 m^2*A | g_d mu_N mu_N | 5.05078374609341e-27 m^2*A | nuclearmagneton nuclearmagneton | 5.05078374609341e-27 m^2*A | e hbar / 2 protonmass mu_p | 1.41060679736784e-26 m^2*A | g_p mu_N / 2 mu_t | 1.50460952009698e-26 m^2*A | g_t mu_N / 2 bohrmagneton | 9.27401007831831e-24 m^2*A | e hbar / 2 electronmass mu_B | 9.27401007831831e-24 m^2*A | bohrmagneton emu | 0.001 m^2*A | erg/gauss MAGNETIC_DIPOLE_MOMENT | 1 m^2*A | J / T ㎯ | 0.01 m^2/s^4 | rad/s^2 ㎮ | 0.01 m^2/s^3 | rad/s refrigeration | 3.87666666666667 m^2/s^3 | tonref / ton banana_dose | 100 nGy | 0.1e-6 sievert rep | 8.38 mGy | 8.38 mGy rad | 10 mGy | 1e-2 Gy rem | 10 mGy | 1e-2 Sv ㎭ | 10 mGy | rad Gy | 1 Gy | gray RADIATION_DOSE | 1 Gy | gray Sv | 1 Gy | sievert gray | 1 Gy | J/kg sievert | 1 Gy | J/kg ㏉ | 1 Gy | Gy ㏜ | 1 Gy | Sv water_fusion_heat | 333.61087982237 kGy | 6.01 kJ/mol / (18.015 g/mol) water_vaporization_heat | 2.2564 MGy | 2256.4 J/g tnt | 4.61207052490764 MGy | 1e9 cal_th / ton coal_lignite | 15 MGy | 15 GJ / tonne woodenergy_airdry | 15 MGy | 15 GJ/tonne woodenergy_dry | 20 MGy | 20 GJ/tonne coal_US | 24.2508488403365 MGy | 22 GJ / uston coal_bituminous | 27 MGy | 27 GJ / tonne charcoal | 30 MGy | 30 GJ/tonne uranium_natural | 574.69880217755 GGy | 0.7% uranium_pure uranium_pure | 82.0998288825071 TGy | 200 MeV avogadro / (235.0439299 g/mol) energy | 89.8755178736818 PGy | c^2 specificheat_uranium | 120 m^2/s^2*K | 0.12 J/g K specificheat_bismuth | 130 m^2/s^2*K | 0.13 J/g K specificheat_gold | 130 m^2/s^2*K | 0.13 J/g K specificheat_iridium | 130 m^2/s^2*K | 0.13 J/g K specificheat_lead | 130 m^2/s^2*K | 0.13 J/g K specificheat_osmium | 130 m^2/s^2*K | 0.13 J/g K specificheat_platinum | 130 m^2/s^2*K | 0.13 J/g K specificheat_plutonum | 130 m^2/s^2*K | 0.13 J/g K specificheat_thallium | 130 m^2/s^2*K | 0.13 J/g K specificheat_thorium | 130 m^2/s^2*K | 0.13 J/g K specificheat_tungsten | 130 m^2/s^2*K | 0.13 J/g K specificheat_hafnium | 140 m^2/s^2*K | 0.14 J/g K specificheat_mercury | 140 m^2/s^2*K | 0.14 J/g K specificheat_rhenium | 140 m^2/s^2*K | 0.14 J/g K specificheat_tantalum | 140 m^2/s^2*K | 0.14 J/g K specificheat_lutetium | 150 m^2/s^2*K | 0.15 J/g K specificheat_lanthanum | 195 m^2/s^2*K | 0.195 J/g K specificheat_barium | 200 m^2/s^2*K | 0.20 J/g K specificheat_antimony | 210 m^2/s^2*K | 0.21 J/g K specificheat_tin | 210 m^2/s^2*K | 0.21 J/g K specificheat_cadmium | 230 m^2/s^2*K | 0.23 J/g K specificheat_silver | 230 m^2/s^2*K | 0.23 J/g K specificheat_cesium | 240 m^2/s^2*K | 0.24 J/g K specificheat_indium | 240 m^2/s^2*K | 0.24 J/g K specificheat_palladium | 240 m^2/s^2*K | 0.24 J/g K specificheat_rhodium | 240 m^2/s^2*K | 0.24 J/g K specificheat_ruthenium | 240 m^2/s^2*K | 0.24 J/g K specificheat_molybdenum | 250 m^2/s^2*K | 0.25 J/g K specificheat_zirconium | 270 m^2/s^2*K | 0.27 J/g K specificheat_strontium | 300 m^2/s^2*K | 0.30 J/g K specificheat_yttrium | 300 m^2/s^2*K | 0.30 J/g K specificheat_germanium | 320 m^2/s^2*K | 0.32 J/g K specificheat_selenium | 320 m^2/s^2*K | 0.32 J/g K specificheat_rubidium | 360 m^2/s^2*K | 0.36 J/g K specificheat_gallium | 370 m^2/s^2*K | 0.37 J/g K specificheat_copper | 390 m^2/s^2*K | 0.39 J/g K specificheat_vanadium | 390 m^2/s^2*K | 0.39 J/g K specificheat_zinc | 390 m^2/s^2*K | 0.39 J/g K specificheat_cobalt | 420 m^2/s^2*K | 0.42 J/g K specificheat_nickel | 440 m^2/s^2*K | 0.44 J/g K specificheat_iron | 450 m^2/s^2*K | 0.45 J/g K specificheat_chromium | 460 m^2/s^2*K | 0.46 J/g K specificheat_manganese | 480 m^2/s^2*K | 0.48 J/g K specificheat_glass_flint | 503 m^2/s^2*K | 0.503 J/g K specificheat_diamond | 509.1 m^2/s^2*K | 0.5091 J/g K specificheat_argon | 520.3 m^2/s^2*K | 0.5203 J/g K specificheat_titanium | 540 m^2/s^2*K | 0.54 J/g K specificheat_scandium | 570 m^2/s^2*K | 0.57 J/g K specificheat_graphite | 710 m^2/s^2*K | 0.71 J/g K specificheat_silicon | 710 m^2/s^2*K | 0.71 J/g K specificheat_potassium | 750 m^2/s^2*K | 0.75 J/g K specificheat_glass_pyrex | 753 m^2/s^2*K | 0.753 J/g K specificheat_granite | 790 m^2/s^2*K | 0.79 J/g K specificheat_sand | 835 m^2/s^2*K | 0.835 J/g K specificheat_soil | 835 m^2/s^2*K | 0.835 J/g K specificheat_brick | 840 m^2/s^2*K | 0.84 J/g K specificheat_glass_silica | 840 m^2/s^2*K | 0.84 J/g K specificheat_concrete | 880 m^2/s^2*K | 0.88 J/g K specificheat_marble | 880 m^2/s^2*K | 0.88 J/g K specificheat_aluminum | 910 m^2/s^2*K | 0.91 J/g K specificheat_freon | 910 m^2/s^2*K | 0.91 J/g K specificheat_asphalt | 920 m^2/s^2*K | 0.92 J/g K mayer | 1000 m^2/s^2*K | J/g K specificheat_magnesium | 1050 m^2/s^2*K | 1.05 J/g K specificheat_gypsum | 1090 m^2/s^2*K | 1.09 J/g K specificheat_sodium | 1210 m^2/s^2*K | 1.21 J/g K specificheat_sucrose | 1244 m^2/s^2*K | 1.244 J/g K specificheat_wood | 1700 m^2/s^2*K | 1.7 J/g K specificheat_beryllium | 1830 m^2/s^2*K | 1.83 J/g K specificheat_oliveoil | 1970 m^2/s^2*K | 1.97 J/g K specificheat_ice | 2110 m^2/s^2*K | 2.11 J/g K specificheat_iodine | 2150 m^2/s^2*K | 2.15 J/g K specificheat_gasoline | 2220 m^2/s^2*K | 2.22 J/g K specificheat_ethanol | 2300 m^2/s^2*K | 2.3 J/g K specificheat_tissue | 3500 m^2/s^2*K | 3.5 J/g K specificheat_lithium | 3570 m^2/s^2*K | 3.57 J/g K specificheat_water | 4184 m^2/s^2*K | calorie / g K water_specificheat | 4184 m^2/s^2*K | specificheat_water specificheat_ammonia | 4600 m^2/s^2*K | 4.6 J/g K specificheat_helium | 5193.2 m^2/s^2*K | 5.1932 J/g K specificheat_hydrogen | 14300 m^2/s^2*K | 14.3 J/g K St | 0.0001 m^2/s | stokes lentor | 0.0001 m^2/s | stokes stoke | 0.0001 m^2/s | stokes stokes | 0.0001 m^2/s | cm^2 / s KINEMATIC_VISCOSITY | 1 m^2/s | VISCOSITY / DENSITY iso100 | 100 m^2/s*cd | s100 s100 | 100 m^2/s*cd | 100 / lx s daraf | 1 m^2*kg/s^4*A^2 | 1/farad ㎺ | 1 pW | pW ㎻ | 1 nW | nW ㎼ | 1 µW | µW lusec | 133.322387415 µW | liter micron Hg / s natural_power | 243.413480578795 µW | natural_energy / natural_time ㎽ | 1 mW | mW sccm | 1.68875 mW | atm cc/min slph | 28.1458333333333 mW | atm liter/hour sccs | 101.325 mW | atm cc/sec scfh | 797.001244704 mW | atm ft^3/hour airwatt | 999.233430733787 mW | 8.5 (ft^3/min) inH2O GAS_FLOW | 1 W | PRESSURE FLUID_FLOW POWER | 1 W | watt VA | 1 W | volt ampere W | 1 W | watt watt | 1 W | J/s watt90 | 1.00000019553655 W | (K_J90^2 R_K90 / K_J^2 R_K) W slpm | 1.68875 W | atm liter/min scfm | 47.82007468224 W | atm ft^3/min donkeypower | 250 W | 250 W mbh | 293.071070172222 W | 1e3 btu/hour chevalvapeur | 735.49875 W | metrichorsepower metrichorsepower | 735.49875 W | 75 kilogram force meter / sec brhorsepower | 745.69987158227 W | horsepower horsepower | 745.69987158227 W | 550 foot pound force / sec hp | 745.69987158227 W | horsepower mechanicalhorsepower | 745.69987158227 W | horsepower electrichorsepower | 746 W | 746 W waterhorsepower | 746.043 W | 746.043 W poncelet | 980.665 W | 100 kg force m / s ㎾ | 1 kW | kW tonref | 3.51685284206667 kW | tonrefrigeration tonrefrigeration | 3.51685284206667 kW | uston 144 btu / lb day boilerhorsepower | 9.8095 kW | 9809.50 W ㎿ | 1 MW | MW solarluminosity | 382.8 YW | 382.8e24 W THERMAL_CONDUCTANCE | 1 m^2*kg/s^3*K | POWER / TEMPERATURE_DIFFERENCE thermalampere | 1 m^2*kg/s^3*K | W/K abohm | 1 nΩ | abvolt / abamp microhm | 1 µΩ | microohm siemensunit | 953.4 mΩ | 0.9534 ohm RESISTANCE | 1 Ω | ohm ohm | 1 Ω | V/A Ω | 1 Ω | ohm Ω | 1 Ω | ohm ohm90 | 1.00000001779367 Ω | (R_K/R_K90) ohm intohm | 1.000495 Ω | 1.000495 ohm Z0 | 376.730313668004 Ω | mu0 c kilohm | 1 kΩ | kiloohm ㏀ | 1 kΩ | kΩ R_K90 | 25.812807 kΩ | 25812.807 ohm R_K | 25.8128074593045 kΩ | h/e^2 megohm | 1 MΩ | megaohm ㏁ | 1 MΩ | MΩ statohm | 898.755178736818 GΩ | statvolt / statamp stohm | 898.755178736818 GΩ | statohm ㎴ | 1 pV | pV ㎵ | 1 nV | nV abV | 10 nV | abvolt abvolt | 10 nV | dyne cm / abamp sec ㎶ | 1 µV | µV ㎷ | 1 mV | mV natural_volt | 302.822120872089 mV | natural_energy / natural_charge ELECTRIC_POTENTIAL | 1 V | ENERGY / CHARGE V | 1 V | volt VOLTAGE | 1 V | ELECTRIC_POTENTIAL volt | 1 V | W/A volt90 | 1.00000010666511 V | (K_J90/K_J) V intvolt | 1.00033 V | 1.00033 V daniell | 1.042 V | 1.042 V atomicpotential | 27.211386245988 V | atomicenergy / atomiccharge atomicvolt | 27.211386245988 V | atomicpotential stV | 299.792458 V | statvolt statV | 299.792458 V | statvolt statvolt | 299.792458 V | dyne cm / statamp sec ㎸ | 1 kV | kV hlu_volt | 1.06273659330906 kV | erg / hlu_charge crocodile | 1 MV | megavolt ㎹ | 1 MV | MV planckvolt_red | 737.469815192278 YV | planckenergy_red / planckcharge_red planckvolt | 3.69712538089572 RV | planckenergy / planckcharge cminv | 19.8644585714893 yJ | h c / cm invcm | 19.8644585714893 yJ | cminv wavenumber | 19.8644585714893 yJ | cminv kcal_mol | 6.94769545705537 zJ | kcal_th / mol N_A eV | 160.2176634 zJ | e V electronvolt | 160.2176634 zJ | eV ev | 160.2176634 zJ | eV natural_energy | 160.2176634 zJ | eV rydberg | 2.17987236110355 aJ | 1|2 hartree E_h | 4.3597447222071 aJ | hartree atomicenergy | 4.3597447222071 aJ | hartree hartree | 4.3597447222071 aJ | 4.3597447222071e-18 J prout | 29.7203765607 fJ | 185.5 keV beV | 160.2176634 pJ | GeV bev | 160.2176634 pJ | beV erg | 100 nJ | cm dyne megalerg | 100 mJ | megaerg ENERGY | 1 J | joule J | 1 J | joule WORK | 1 J | FORCE DISTANCE joule | 1 J | N m duty | 1.3558179483314 J | ft lbf cal_20 | 4.1819 J | calorie_20 calorie_20 | 4.1819 J | 4.18190 J calorie_twenty | 4.1819 J | calorie_20 cal | 4.184 J | calorie cal_th | 4.184 J | calorie_th calorie | 4.184 J | cal_th calorie_th | 4.184 J | 4.184 J thermcalorie | 4.184 J | calorie_th ㎈ | 4.184 J | cal cal_15 | 4.1858 J | calorie_15 calorie_15 | 4.1858 J | 4.18580 J calorie_fifteen | 4.1858 J | cal_15 cal_IT | 4.1868 J | calorie_IT calorie_IT | 4.1868 J | 4.1868 J cal_mean | 4.19002 J | 4.19002 J cal_4 | 4.204 J | calorie_4 calorie_4 | 4.204 J | 4.204 J calorie_four | 4.204 J | calorie_4 kpm | 9.80665 J | kp meter btu_th | 1.05435026448889 kJ | cal_th lb (degF) / gram K btu_15 | 1.05480385685889 kJ | cal_15 lb (degF) / gram K britishthermalunit | 1.05505585262 kJ | btu btu | 1.05505585262 kJ | btu_IT btu_IT | 1.05505585262 kJ | cal_IT lb (degF) / gram K btu_ISO | 1.05506 kJ | 1055.06 J btu_mean | 1.05586727897078 kJ | cal_mean lb (degF) / gram K celsiusheatunit | 1.89783047608 kJ | cal lb (degC) / gram K chu | 1.89783047608 kJ | celsiusheatunit Wh | 3.6 kJ | W hour Calorie | 4.184 kJ | kilocalorie ㎉ | 4.184 kJ | kcal frigorie | 4.1858 kJ | 1000 cal_15 hph | 2.68451953769617 MJ | hp hour kWh | 3.6 MJ | kilowatt hour thermie | 4.1858 MJ | 1e6 cal_15 UStherm | 105.4804 MJ | 1.054804e8 J therm | 105.4804 MJ | UStherm ECtherm | 105.506 MJ | 1e5 btu_ISO planckenergy_red | 390.181834397908 MJ | planckmass_red c^2 E_P | 1.95608163669837 GJ | planckenergy planckenergy | 1.95608163669837 GJ | planckmass c^2 barreloil | 6.119323945196 GJ | 5.8 Mbtu toncoal | 29.3076 GJ | 7e9 cal_IT davycrocket | 41.84 GJ | 10 ton tnt toe | 41.868 GJ | tonoil tonoil | 41.868 GJ | 1e10 cal_IT hiroshima | 64.852 TJ | 15.5 kiloton tnt littleboy | 64.852 TJ | hiroshima gadget | 75.312 TJ | trinity trinity | 75.312 TJ | 18 kiloton tnt fatman | 87.864 TJ | nagasaki nagasaki | 87.864 TJ | 21 kiloton tnt ivyking | 2.092 PJ | 500 kiloton tnt b53bomb | 37.656 PJ | 9 megaton tnt castlebravo | 62.76 PJ | 15 megaton tnt tsarbomba | 209.2 PJ | 50 megaton tnt quad | 1.05505585262 EJ | quadrillion btu thermalfarad | 1 m^2*kg/s^2*K^2 | J/K^2 boltzmann | 1.380649e-23 m^2*kg/s^2*K | 1.380649e-23 (m^2*kg/s^2)/K k | 1.380649e-23 m^2*kg/s^2*K | boltzmann kboltzmann | 1.380649e-23 m^2*kg/s^2*K | boltzmann ENTROPY | 1 m^2*kg/s^2*K | ENERGY / TEMPERATURE thermalcoulomb | 1 m^2*kg/s^2*K | J/K clausius | 4184 m^2*kg/s^2*K | 1e3 cal/K R_1976 | 8.31432 m^2*kg/s^2*K*mol | 8.31432e3 N m/(kmol K) R | 8.31446261815324 m^2*kg/s^2*K*mol | gasconstant gasconstant | 8.31446261815324 m^2*kg/s^2*K*mol | k N_A abH | 1 nH | abhenry abhenry | 1 nH | abvolt sec / abamp mh | 1 mH | mH H | 1 H | henry INDUCTANCE | 1 H | henry henry | 1 H | V s / A henry90 | 1.00000001779367 H | (R_K/R_K90) H stH | 898.755178736818 GH | stathenry statH | 898.755178736818 GH | stathenry stathenry | 898.755178736818 GH | statvolt sec / statamp Mx | 10 nWb | maxwell maxwell | 10 nWb | gauss cm^2 unitpole | 125.663706143592 nWb | 4 pi maxwell kappline | 60 µWb | 6000 maxwell B_FLUX | 1 Wb | B_FIELD AREA Wb | 1 Wb | weber weber | 1 Wb | V s ㏝ | 1 Wb | Wb stWb | 299.792458 Wb | statweber statWb | 299.792458 Wb | statweber statweber | 299.792458 Wb | statvolt sec atomicaction | 1.05457181764616e-34 m^2*kg/s | hbar hbar | 1.05457181764616e-34 m^2*kg/s | h / 2 pi spin | 1.05457181764616e-34 m^2*kg/s | hbar ℏ | 1.05457181764616e-34 m^2*kg/s | hbar h | 6.62607015e-34 m^2*kg/s | 6.62607015e-34 (m^2*kg/s^2) s ℎ | 6.62607015e-34 m^2*kg/s | h planck | 1 m^2*kg/s | J s ㎣ | 1e-09 m^3 | mm^3 lambda | 1e-09 m^3 | microliter ㎕ | 1e-09 m^3 | µL drop | 5e-08 m^3 | 1|20 ml brminim | 5.91938802083334e-08 m^3 | 1|60 brdram imperialminim | 5.91938802083334e-08 m^3 | brminim minim | 6.1611519921875e-08 m^3 | minimvolume minimvolume | 6.1611519921875e-08 m^3 | 1|60 fluiddram cc | 1e-06 m^3 | cm^3 ㎖ | 1e-06 m^3 | mL ㎤ | 1e-06 m^3 | cm^3 ㏄ | 1e-06 m^3 | cc brscruple | 1.18387760416667e-06 m^3 | 1|3 brdram fluidscruple | 1.18387760416667e-06 m^3 | brscruple imperialscruple | 1.18387760416667e-06 m^3 | brscruple saltspoon | 1.2322303984375e-06 m^3 | 1|4 tsp brdram | 3.5516328125e-06 m^3 | 1|8 brfloz imperialdram | 3.5516328125e-06 m^3 | brdram fldr | 3.6966911953125e-06 m^3 | fluiddram fluiddram | 3.6966911953125e-06 m^3 | 1|8 usfloz teaspoon | 4.92892159375e-06 m^3 | usteaspoon tsp | 4.92892159375e-06 m^3 | teaspoon usteaspoon | 4.92892159375e-06 m^3 | 1|3 ustablespoon ustsp | 4.92892159375e-06 m^3 | usteaspoon brteaspoon | 5e-06 m^3 | 1|3 brtablespoon brtsp | 5e-06 m^3 | brteaspoon australiateaspoon | 5e-06 m^3 | 1|4 australiatablespoon austsp | 5e-06 m^3 | australiateaspoon brdessertspoon | 1e-05 m^3 | 2 brteaspoon dessertspoon | 1e-05 m^3 | brdessertspoon dsp | 1e-05 m^3 | dessertspoon alcoholunituk | 1.01355631572279e-05 m^3 | 8 g / ethanoldensity cochlearia | 1.20854597e-05 m^3 | 1|48 sextarius alcoholunitau | 1.26694539465349e-05 m^3 | 10 g / ethanoldensity cylinderinch | 1.28703699690764e-05 m^3 | circleinch inch Tb | 1.478676478125e-05 m^3 | tablespoon tablespoon | 1.478676478125e-05 m^3 | ustablespoon tbl | 1.478676478125e-05 m^3 | tablespoon tblsp | 1.478676478125e-05 m^3 | tablespoon tbsp | 1.478676478125e-05 m^3 | tablespoon ustablespoon | 1.478676478125e-05 m^3 | 1|16 uscup ustbl | 1.478676478125e-05 m^3 | ustablespoon ustblsp | 1.478676478125e-05 m^3 | ustablespoon ustbsp | 1.478676478125e-05 m^3 | ustablespoon brtablespoon | 1.5e-05 m^3 | 15 ml brtbl | 1.5e-05 m^3 | brtablespoon brtblsp | 1.5e-05 m^3 | brtablespoon brtbsp | 1.5e-05 m^3 | brtablespoon legaltablespoon | 1.5e-05 m^3 | 1|16 legalcup legaltbsp | 1.5e-05 m^3 | legaltablespoon alcoholunitca | 1.72304573672875e-05 m^3 | 13.6 g / ethanoldensity eggyolkvolume | 1.7251225578125e-05 m^3 | 3.5 ustsp alcoholunitus | 1.77372355251489e-05 m^3 | 14 g / ethanoldensity shaku_volume | 1.80390683696469e-05 m^3 | 1|10 gou_volume austbl | 2e-05 m^3 | australiatablespoon austblsp | 2e-05 m^3 | australiatablespoon austbsp | 2e-05 m^3 | australiatablespoon australiatablespoon | 2e-05 m^3 | 20 ml eushot | 2.5e-05 m^3 | 25 ml brfloz | 2.84130625e-05 m^3 | brfluidounce brfluidounce | 2.84130625e-05 m^3 | 1|20 brpint imperialfloz | 2.84130625e-05 m^3 | brfloz imperialfluidounce | 2.84130625e-05 m^3 | brfluidounce eggwhitevolume | 2.95735295625e-05 m^3 | 2 ustablespoons floz | 2.95735295625e-05 m^3 | fluidounce fluidounce | 2.95735295625e-05 m^3 | usfluidounce pony | 2.95735295625e-05 m^3 | ponyvolume ponyvolume | 2.95735295625e-05 m^3 | 1 usfloz usfloz | 2.95735295625e-05 m^3 | usfluidounce usfluidounce | 2.95735295625e-05 m^3 | 1|16 uspint jigger | 4.436029434375e-05 m^3 | 1.5 usfloz shot | 4.436029434375e-05 m^3 | jigger eggvolume | 4.6824755140625e-05 m^3 | 3 ustablespoons + 1|2 ustsp cyathi | 4.83418388e-05 m^3 | 1|12 sextarius acetabula | 7.25127582e-05 m^3 | 1|8 sextarius ㎗ | 0.0001 m^3 | dL scotsgill | 0.000105904945407178 m^3 | 1|4 mutchkin irishnoggin | 0.000111431453911851 m^3 | 1|4 irishpint gill | 0.00011829411825 m^3 | 1|4 pint usgill | 0.00011829411825 m^3 | 1|4 uspint brgill | 0.0001420653125 m^3 | 1|4 brpint imperialgill | 0.0001420653125 m^3 | brgill noggin | 0.0001420653125 m^3 | brgill quartaria | 0.0001450255164 m^3 | 1|4 sextarius quartarius | 0.0001450255164 m^3 | quartaria wineglass | 0.00015 m^3 | 150 mL gou | 0.000180390683696469 m^3 | gou_volume gou_volume | 0.000180390683696469 m^3 | 1|10 shou winesplit | 0.0001875 m^3 | 1|4 winebottle brteacup | 0.000189420416666667 m^3 | 1|3 brpint japancup | 0.0002 m^3 | 200 ml split | 0.0002 m^3 | 200 ml cup | 0.0002365882365 m^3 | uscup uscup | 0.0002365882365 m^3 | 8 usfloz legalcup | 0.00024 m^3 | 240 ml metriccup | 0.00025 m^3 | 250 ml ollock | 0.00025 m^3 | 1|4 liter greekkotyle | 0.00027 m^3 | 270 ml brcup | 0.000284130625 m^3 | 1|2 brpint hemina | 0.0002900510328 m^3 | heminae heminae | 0.0002900510328 m^3 | 1|2 sextarius number1can | 0.000295735295625 m^3 | 10 usfloz metrictenth | 0.000375 m^3 | 375 ml reputedpint | 0.000378840833333333 m^3 | 1|2 reputedquart mutchkin | 0.000423619781628714 m^3 | 1|2 choppin irishpint | 0.000445725815647403 m^3 | 1|2 irishquart bloodunit | 0.00045 m^3 | 450 ml winepint | 0.000473174004662455 m^3 | 1|2 winequart pint | 0.000473176473 m^3 | 1|2 quart pt | 0.000473176473 m^3 | pint uspint | 0.000473176473 m^3 | 1|2 usquart xestes | 0.00054 m^3 | 2 greekkotyle drypint | 0.0005506104713575 m^3 | 1|2 dryquart number2can | 0.0005618970616875 m^3 | 19 usfloz brpint | 0.00056826125 m^3 | 1|2 brquart imperialpint | 0.00056826125 m^3 | brpint alepint | 0.000577640992704815 m^3 | 1|2 alequart beerpint | 0.000577640992704815 m^3 | 1|2 beerquart sextarii | 0.0005801020656 m^3 | sextarius sextarius | 0.0005801020656 m^3 | 35.4 in^3 metricfifth | 0.00075 m^3 | 750 ml winebottle | 0.00075 m^3 | 750 ml fifth | 0.0007570823568 m^3 | 1|5 usgallon brwinebottle | 0.000757681666666667 m^3 | reputedquart reputedquart | 0.000757681666666667 m^3 | 1|6 brgallon number2_5can | 0.00082805882775 m^3 | 3.5 uscups choppin | 0.000847239563257428 m^3 | 1|2 scotspint cheonix | 0.0008701530984 m^3 | 1.5 sextarii irishquart | 0.000891451631294806 m^3 | 1|2 irishpottle winequart | 0.000946348009324909 m^3 | 1|4 winegallon number3can | 0.000946352946 m^3 | 4 uscups qt | 0.000946352946 m^3 | quart quart | 0.000946352946 m^3 | 1|4 gallon usquart | 0.000946352946 m^3 | 1|4 usgallon L | 0.001 m^3 | liter l | 0.001 m^3 | liter liter | 0.001 m^3 | 1000 cc litre | 0.001 m^3 | liter metricquart | 0.001 m^3 | 1 liter ℓ | 0.001 m^3 | liter oldliter | 0.001000028 m^3 | 1.000028 dm^3 choinix | 0.00108 m^3 | 4 greekkotyle dryquart | 0.001101220942715 m^3 | 1|4 drygallon brquart | 0.0011365225 m^3 | 1|4 brgallon imperialquart | 0.0011365225 m^3 | brquart alequart | 0.00115528198540963 m^3 | 1|4 alegallon beerquart | 0.00115528198540963 m^3 | 1|4 beergallon magnum | 0.0015 m^3 | 1.5 liter number5can | 0.0016561176555 m^3 | 7 uscups jug | 0.00169447912651486 m^3 | scotspint scotspint | 0.00169447912651486 m^3 | 1|2 scotsquart irishpottle | 0.00178290326258961 m^3 | 1|2 irishgallon shou | 0.00180390683696469 m^3 | (4.9*4.9*2.7) sun^3 scotswheatlippies | 0.00225047292059944 m^3 | scotswheatlippy scotswheatlippy | 0.00225047292059944 m^3 | 137.333 UKinch^3 pottle | 0.002273045 m^3 | 0.5 brgallon boardfeet | 0.002359737216 m^3 | boardfoot boardfoot | 0.002359737216 m^3 | ft^2 inch fbm | 0.002359737216 m^3 | boardfoot jeroboam | 0.003 m^3 | 2 magnum hoppusboardfoot | 0.00300451073859446 m^3 | 1|12 hoppusfoot number10can | 0.0031052206040625 m^3 | 105 usfloz khous | 0.00324 m^3 | 12 greekkotyle scotsoatlippies | 0.0032830492108779 m^3 | scotsoatlippy scotsoatlippy | 0.0032830492108779 m^3 | 200.345 UKinch^3 scotsquart | 0.00338895825302971 m^3 | 1|4 scotsgallon congii | 0.0034806123936 m^3 | congius congius | 0.0034806123936 m^3 | 12 heminae irishgallon | 0.00356580652517923 m^3 | 217.6 UKinch^3 winegallon | 0.00378539203729964 m^3 | 231 UKinch^3 gal | 0.003785411784 m^3 | gallon gallon | 0.003785411784 m^3 | usgallon usgallon | 0.003785411784 m^3 | 231 in^3 drygallon | 0.00440488377086 m^3 | 1|2 uspeck rehoboam | 0.0045 m^3 | 3 magnum brgallon | 0.00454609 m^3 | 4.54609 l imperialgallon | 0.00454609 m^3 | brgallon alegallon | 0.00462112794163852 m^3 | beergallon beergallon | 0.00462112794163852 m^3 | 282 UKinch^3 semodii | 0.0046408165248 m^3 | semodius semodius | 0.0046408165248 m^3 | 8 sextarius imperialbottle | 0.006 m^3 | 4 magnum methuselah | 0.006 m^3 | 4 magnum irishpeck | 0.00713161305035845 m^3 | 2 irishgallon hekteos | 0.00864 m^3 | 8 choinix peck | 0.00880976754172 m^3 | 1|4 bushel pk | 0.00880976754172 m^3 | peck uspeck | 0.00880976754172 m^3 | 1|4 usbushel salmanazar | 0.009 m^3 | 6 magnum scotswheatpeck | 0.00900189168239777 m^3 | 4 scotswheatlippy brpeck | 0.00909218 m^3 | 1|4 brbushel modii | 0.0092816330496 m^3 | modius modius | 0.0092816330496 m^3 | 16 sextarius balthazar | 0.012 m^3 | 8 magnum scotsoatpeck | 0.0131321968435116 m^3 | 4 scotsoatlippy scotsgallon | 0.0135558330121188 m^3 | 827.232 UKinch^3 nebuchadnezzar | 0.015 m^3 | 10 magnum splitdeal | 0.01622319336 m^3 | 12 ft 11 in 5|8 in melchior | 0.018 m^3 | 12 magnum solomon | 0.018 m^3 | 12 magnum to | 0.0180390683696469 m^3 | 10 shou bucket | 0.01818436 m^3 | 4 brgallon pin | 0.020457405 m^3 | 4.5 brgallon amagatvolume | 0.0224139695450141 m^3 | molarvolume molarvolume | 0.0224139695450141 m^3 | mol R stdtemp / atm Vm | 0.0258242148458984 m^3 | Volm Volm | 0.0258242148458984 m^3 | Grafut^3 sovereign | 0.02625 m^3 | 17.5 magnum goliath | 0.027 m^3 | 18 magnum primat | 0.027 m^3 | 18 magnum amphora | 0.0278448991488 m^3 | 8 congii amphorae | 0.0278448991488 m^3 | amphora quadrantal | 0.0278448991488 m^3 | amphora ft3 | 0.028316846592 m^3 | ft^3 timberfoot | 0.028316846592 m^3 | ft^3 irishbushel | 0.0285264522014338 m^3 | 4 irishpeck ponykeg | 0.029336941326 m^3 | 1|2 beerkeg melchizedek | 0.03 m^3 | 20 magnum midas | 0.03 m^3 | 20 magnum wholedeal | 0.03244638672 m^3 | 12 ft 11 in 1.25 in firkin | 0.034068706056 m^3 | usfirkin usfirkin | 0.034068706056 m^3 | 9 usgallon bu | 0.03523907016688 m^3 | bushel bushel | 0.03523907016688 m^3 | usbushel usbushel | 0.03523907016688 m^3 | 2150.42 in^3 scotswheatfirlot | 0.0360075667295911 m^3 | 4 scotswheatpeck hoppusfoot | 0.0360541288631335 m^3 | (4/pi) ft^3 brbushel | 0.03636872 m^3 | 8 brgallon imperialbushel | 0.03636872 m^3 | brbushel metretes | 0.03888 m^3 | 12 khous brfirkin | 0.04091481 m^3 | 9 brgallon imperialfirkin | 0.04091481 m^3 | brfirkin heapedbushel | 0.0450355316732727 m^3 | 1.278 usbushel winekeg | 0.045424941408 m^3 | 12 usgallon brheapedbushel | 0.04647922416 m^3 | 1.278 brbushel imperialheapedbushel | 0.04647922416 m^3 | brheapedbushel medimnos | 0.05184 m^3 | 6 hekteos scotsoatfirlot | 0.0525287873740465 m^3 | 4 scotsoatpeck firlot | 0.05455308 m^3 | 1|4 boll irishstrike | 0.0570529044028676 m^3 | 2 irishbushel beerkeg | 0.058673882652 m^3 | 15.5 usgallon irishrundlet | 0.0641845174532261 m^3 | 18 irishgallon deal | 0.06489277344 m^3 | 12 ft 11 in 2.5 in winerundlet | 0.0681370566713935 m^3 | 18 winegallon strike | 0.0705 m^3 | 70.5 l kilderkin | 0.08182962 m^3 | 2 brfirkin cranberrybarrel | 0.095471034864 m^3 | 5826 in^3 scotsbarrel | 0.108446664096951 m^3 | 8 scotsgallon irishbarrel | 0.112322905543146 m^3 | 31.5 irishgallon irishdrybarrel | 0.114105808805735 m^3 | 2 irishstrike drybarrel | 0.115627123584 m^3 | 7056 in^3 usbeerbarrel | 0.117347765304 m^3 | 2 beerkegs winebarrel | 0.119239849174939 m^3 | 31.5 winegallon liquidbarrel | 0.119240471196 m^3 | 31.5 usgallon scotswheatboll | 0.144030266918364 m^3 | 4 scotswheatfirlot amber | 0.14547488 m^3 | 4 brbushel bag | 0.14547488 m^3 | 4 brbushel coomb | 0.14547488 m^3 | 4 brbushel irishtierce | 0.149763874057527 m^3 | 42 irishgallon alebarrel | 0.15711835001571 m^3 | 34 alegallon winetierce | 0.158986465566585 m^3 | 42 winegallon barrel | 0.158987294928 m^3 | petroleumbarrel bbl | 0.158987294928 m^3 | barrel petroleumbarrel | 0.158987294928 m^3 | 42 usgallon brbarrel | 0.16365924 m^3 | 36 brgallon imperialbarrel | 0.16365924 m^3 | brbarrel beerbarrel | 0.166360605898987 m^3 | 36 beergallon cran | 0.170478375 m^3 | 37.5 brgallon koku | 0.180390683696469 m^3 | 10 to scotsoatboll | 0.210115149496186 m^3 | 4 scotsoatfirlot boll | 0.21821232 m^3 | 6 brbushel irishhogshead | 0.224645811086291 m^3 | 2 irishbarrel irishquarter | 0.224645811086291 m^3 | 2 irishbarrel alehogshead | 0.235677525023564 m^3 | 1.5 alebarrel winehogshead | 0.238479698349877 m^3 | 2 winebarrel hd | 0.238480942392 m^3 | hogshead hogshead | 0.238480942392 m^3 | ushogshead ushogshead | 0.238480942392 m^3 | 2 liquidbarrel brhogshead | 0.238669725 m^3 | brwinehogshead brwinehogshead | 0.238669725 m^3 | 52.5 brgallon imperialhogshead | 0.238669725 m^3 | brhogshead imperialwinehogshead | 0.238669725 m^3 | brwinehogshead brbeerhogshead | 0.24548886 m^3 | 54 brgallon imperialbeerhogshead | 0.24548886 m^3 | brbeerhogshead beerhogshead | 0.24954090884848 m^3 | 1.5 beerbarrel brquarter | 0.29094976 m^3 | 8 brbushel imperialquarter | 0.29094976 m^3 | brquarter seam | 0.29094976 m^3 | 8 brbushel irishpuncheon | 0.299527748115055 m^3 | 2 irishtierce winepuncheon | 0.31797293113317 m^3 | 2 winetierce puncheon | 0.32731848 m^3 | 72 brgallon irishpipe | 0.449291622172582 m^3 | 2 irishhogshead cordfeet | 0.453069545472 m^3 | cordfoot cordfoot | 0.453069545472 m^3 | 1|8 cord schuettraummeter | 0.455 m^3 | 0.65 raummeter schüttraummeter | 0.455 m^3 | schuettraummeter winebutt | 0.476959396699754 m^3 | 2 winehogshead winepipe | 0.476959396699754 m^3 | winebutt brbeerbutt | 0.49097772 m^3 | 2 brbeerhogshead imperialbeerbutt | 0.49097772 m^3 | brbeerbutt culleus | 0.556897982976 m^3 | 20 amphorae raummeter | 0.7 m^3 | 0.7 festmeter irishtun | 0.898583244345165 m^3 | 2 irishpipe winetun | 0.953918793399509 m^3 | 2 winebutt displacementton | 0.99108963072 m^3 | 35 ft^3 VOLUME | 1 m^3 | LENGTH^3 festmeter | 1 m^3 | m^3 stere | 1 m^3 | m^3 ㎥ | 1 m^3 | m^3 ㎘ | 1 m^3 | kL waterton | 1.01832416 m^3 | 224 brgallon freightton | 1.13267386368 m^3 | shippington shippington | 1.13267386368 m^3 | 40 ft^3 brshippington | 1.189307556864 m^3 | 42 ft^3 housecord | 1.208185454592 m^3 | 1|3 cord rick | 1.208185454592 m^3 | 4 ft 8 ft 16 inches brchaldron | 1.30927392 m^3 | 36 brbushel imperialchaldron | 1.30927392 m^3 | brchaldron last | 1.4547488 m^3 | 40 brbushel hoppuston | 1.80270644315668 m^3 | 50 hoppusfoot facecord | 1.812278181888 m^3 | 1|2 cord scotswheatchalder | 2.30448427069383 m^3 | 16 scotswheatboll ccf | 2.8316846592 m^3 | 100 ft^3 registerton | 2.8316846592 m^3 | 100 ft^3 stack | 3.058219431936 m^3 | 4 yard^3 prussiawoodklafter | 3.322336 m^3 | 0.5 prussiaklafter^3 scotsoatchalder | 3.36184239193897 m^3 | 16 scotsoatboll austriawoodklafter | 3.41049520750045 m^3 | 0.5 austriaklafter^3 cord | 3.624556363776 m^3 | 4*4*8 ft^3 standard | 4.67227968768 m^3 | 120 12 ft 11 in 1.5 in Mcf | 28.316846592 m^3 | 1000 ft^3 acrefoot | 1233.48183754752 m^3 | intacrefoot intacrefoot | 1233.48183754752 m^3 | acre foot USacrefoot | 1233.48923846815 m^3 | USacre surveyfoot ㎦ | 1000000000 m^3 | km^3 molarvolume_si | 1.20588319868415e-05 m^3/mol | N_A siliconlattice^3 / 8 GMsun | 1.32712440041279e+20 m^3/s^2 | 132712440041.279419 km^3 / s^2 gph | 1.05150327333333e-06 m^3/s | gal/hr usgph | 1.05150327333333e-06 m^3/s | usgallon/hr brgph | 1.26280277777778e-06 m^3/s | brgallon/hr cfh | 7.86579072e-06 m^3/s | ft^3/hour lpm | 1.66666666666667e-05 m^3/s | liter/min gpm | 6.30901964e-05 m^3/s | gal/min usgpm | 6.30901964e-05 m^3/s | usgallon/min brgpm | 7.57681666666667e-05 m^3/s | brgallon/min cfm | 0.0004719474432 m^3/s | ft^3/min minersinchID | 0.00056633693184 m^3/s | 1.2 ft^3/min minersinchKS | 0.00056633693184 m^3/s | 1.2 ft^3/min minersinchND | 0.00056633693184 m^3/s | 1.2 ft^3/min minersinchNE | 0.00056633693184 m^3/s | 1.2 ft^3/min minersinchNM | 0.00056633693184 m^3/s | 1.2 ft^3/min minersinchSD | 0.00056633693184 m^3/s | 1.2 ft^3/min minersinchUT | 0.00056633693184 m^3/s | 1.2 ft^3/min minersinchAZ | 0.0007079211648 m^3/s | 1.5 ft^3/min minersinchCA | 0.0007079211648 m^3/s | 1.5 ft^3/min minersinchMT | 0.0007079211648 m^3/s | 1.5 ft^3/min minersinchNV | 0.0007079211648 m^3/s | 1.5 ft^3/min minersinchOR | 0.0007079211648 m^3/s | 1.5 ft^3/min minersinchCO | 0.00073741788 m^3/s | 1 ft^3/sec / 38.4 minersinchBC | 0.000792871704576 m^3/s | 1.68 ft^3/min cfs | 0.028316846592 m^3/s | ft^3/s cusec | 0.028316846592 m^3/s | ft^3/s mgd | 0.0438126363888889 m^3/s | megagal/day FLUID_FLOW | 1 m^3/s | VOLUME / TIME cumec | 1 m^3/s | m^3/s sverdrup | 1000000 m^3/s | 1e6 m^3 / sec coulombconst | 8987551792.28823 m^3*kg/s^4*A^2 | 1/4 pi epsilon0 k_C | 8987551792.28823 m^3*kg/s^4*A^2 | coulombconst RESISTIVITY | 1 m^3*kg/s^3*A^2 | RESISTANCE AREA / LENGTH preece | 10000000000000 m^3*kg/s^3*A^2 | 1e13 ohm m E_FLUX | 1 m^3*kg/s^3*A | E_FIELD AREA fillpower | 0.000578036672001339 m^3/kg | in^3 / ounce G | 6.6743e-11 m^3/kg*s^2 | 6.67430e-11 N m^2 / kg^2 acousticalohm | 100 Mg/m^4*s | dyn s / cm^5 ray | 100 Mg/m^4*s | acousticalohm pru | 7.9993432449 Tg/m^4*s | mmHg / (ml/min) fermicoupling | 454379566261216 s^4/m^4*kg^2 | 1.1663787e-5 / GeV^2 loschmidt | 2.68678011179844e+25 m^-3 | avogadro mol / molarvolume amagat | 44.6150334054703 mol/m^3 | mol/amagatvolume eman | 3700 m^-3*s^-1 | 1e-7 Ci/m^3 mache | 13690 m^-3*s^-1 | 3.7e-7 Ci/m^3 gammil | 1 g/m^3 | mg/l clarkdegree | 14.2537675233002 g/m^3 | grains/brgallon gpg | 17.1180610452709 g/m^3 | grains/usgallon hydrogendensity | 89.88 g/m^3 | 0.08988 g/l heliumdensity | 178.6 g/m^3 | 0.1786 g/l neondensity | 900.2 g/m^3 | 0.9002 g/l DENSITY | 1 kg/m^3 | MASS / VOLUME nitrogendensity | 1.2506 kg/m^3 | 1.2506 g/l oxygendensity | 1.429 kg/m^3 | 1.429 g/l fluorinedensity | 1.696 kg/m^3 | 1.696 g/l argondensity | 1.784 kg/m^3 | 1.784 g/l chlorinedensity | 3.2 kg/m^3 | 3.2 g/l kryptondensity | 3.749 kg/m^3 | 3.749 g/l xenondensity | 5.894 kg/m^3 | 5.894 g/l radondensity | 9.73 kg/m^3 | 9.73 g/l coffeeratio | 55 kg/m^3 | 55 g/L lbcut | 119.826427316897 kg/m^3 | poundcut poundcut | 119.826427316897 kg/m^3 | pound / gallon wood_balsa | 144.166170365641 kg/m^3 | 9 lb/ft^3 cocoa_sifted | 317.006462829778 kg/m^3 | 75 g/uscup dutchcocoa_sifted | 317.006462829778 kg/m^3 | 75 g/uscup cocoa_spooned | 346.593732693891 kg/m^3 | 82 g/uscup wood_engelmannspruce | 384.443120975043 kg/m^3 | 24 lb/ft^3 dutchcocoa_spooned | 388.861261071194 kg/m^3 | 92 g/uscup wood_easternwhitepine | 400.461584349003 kg/m^3 | 25 lb/ft^3 cocoa_scooped | 401.541519584385 kg/m^3 | 95 g/uscup dutchcocoa_scooped | 401.541519584385 kg/m^3 | 95 g/uscup wood_basswood | 416.480047722964 kg/m^3 | 26 lb/ft^3 wood_whitepine | 416.480047722964 kg/m^3 | (wood_easternwhitepine + wood_westernwhitepine) / 2 cakeflour_sifted | 419.392495609138 kg/m^3 | 3.5 oz/uscup wood_spruce | 426.09112574734 kg/m^3 | (wood_blackspruce + wood_engelmannspruce + wood_redspruce + wood_sitkaspruce + wood_whitespruce) / 5 wood_redspruce | 432.498511096924 kg/m^3 | 27 lb/ft^3 wood_sitkaspruce | 432.498511096924 kg/m^3 | 27 lb/ft^3 wood_westernwhitepine | 432.498511096924 kg/m^3 | 27 lb/ft^3 wood_whitespruce | 432.498511096924 kg/m^3 | 27 lb/ft^3 wood_blackspruce | 448.516974470884 kg/m^3 | 28 lb/ft^3 wood_jeffreypine | 448.516974470884 kg/m^3 | 28 lb/ft^3 wood_ponderosapine | 448.516974470884 kg/m^3 | 28 lb/ft^3 wood_poplar | 464.535437844844 kg/m^3 | 29 lb/ft^3 cakeflour_spooned | 479.305709267586 kg/m^3 | 4 oz/uscup flour_sifted | 479.305709267586 kg/m^3 | 4 oz/uscup powdered_sugar | 479.305709267586 kg/m^3 | 4 oz/uscup wood_boxeldermaple | 480.553901218804 kg/m^3 | 30 lb/ft^3 cornstarch | 507.210340527645 kg/m^3 | 120 grams/uscup breadflour_sifted | 509.26231609681 kg/m^3 | 4.25 oz/uscup flour_spooned | 509.26231609681 kg/m^3 | 4.25 oz/uscup wood_douglasfir | 512.590827966724 kg/m^3 | 32 lb/ft^3 wood_stripedmaple | 512.590827966724 kg/m^3 | 32 lb/ft^3 wood_silvermaple | 528.609291340685 kg/m^3 | 33 lb/ft^3 lithiumdensity | 534 kg/m^3 | 0.534 g/cm^3 wood_softmaple | 535.016676690269 kg/m^3 | (wood_bigleafmaple + wood_boxeldermaple + wood_redmaple + wood_silvermaple + wood_stripedmaple) / 5 breadflour_spooned | 539.218922926035 kg/m^3 | 4.5 oz/uscup cakeflour_scooped | 539.218922926035 kg/m^3 | 4.5 oz/uscup wood_bigleafmaple | 544.627754714645 kg/m^3 | 34 lb/ft^3 wood_redpine | 544.627754714645 kg/m^3 | 34 lb/ft^3 wood_cherry | 560.646218088605 kg/m^3 | 35 lb/ft^3 wood_loblollypine | 560.646218088605 kg/m^3 | 35 lb/ft^3 wood_shortleafpine | 560.646218088605 kg/m^3 | 35 lb/ft^3 koshersalt | 568.075581390962 kg/m^3 | 2.8 g / ustsp wood_mahogany | 592.683144836525 kg/m^3 | 37 lb/ft^3 flour_scooped | 599.132136584483 kg/m^3 | 5 oz/uscup wood_blackwalnut | 608.701608210485 kg/m^3 | 38 lb/ft^3 wood_koa | 608.701608210485 kg/m^3 | 38 lb/ft^3 wood_redmaple | 608.701608210485 kg/m^3 | 38 lb/ft^3 wood_walnut | 608.701608210485 kg/m^3 | wood_blackwalnut wood_yellowpine | 608.701608210485 kg/m^3 | (wood_loblollypine + wood_longleafpine + wood_shortleafpine + wood_slashpine) / 4 wood_longleafpine | 656.756998332366 kg/m^3 | 41 lb/ft^3 wood_slashpine | 656.756998332366 kg/m^3 | 41 lb/ft^3 wood_teak | 656.756998332366 kg/m^3 | 41 lb/ft^3 breadflour_scooped | 659.045350242931 kg/m^3 | 5.5 oz/uscup wood_birch | 688.793925080286 kg/m^3 | 43 lb/ft^3 wood_hardmaple | 704.812388454246 kg/m^3 | 44 lb/ft^3 wood_ocotepine | 704.812388454246 kg/m^3 | 44 lb/ft^3 wood_redoak | 704.812388454246 kg/m^3 | 44 lb/ft^3 wood_beech | 720.830851828206 kg/m^3 | 45 lb/ft^3 wood_whiteoak | 752.867778576126 kg/m^3 | 47 lb/ft^3 alcoholdensity | 789.3 kg/m^3 | ethanoldensity ethanoldensity | 789.3 kg/m^3 | 0.7893 g/cm^3 paperdensity | 800 kg/m^3 | 0.8 g/cm^3 wood_zebrawood | 800.923168698007 kg/m^3 | 50 lb/ft^3 shortening | 808.828384389052 kg/m^3 | 6.75 oz/uscup butter_clarified | 814.819705754897 kg/m^3 | 6.8 oz/uscup wood_rosewood_brazilian | 832.960095445927 kg/m^3 | 52 lb/ft^3 wood_rosewood_indian | 832.960095445927 kg/m^3 | 52 lb/ft^3 sugar | 845.350567546075 kg/m^3 | 200 g/uscup potassiumdensity | 862 kg/m^3 | 0.862 g/cm^3 wood_bubinga | 897.033948941768 kg/m^3 | 56 lb/ft^3 oil | 898.698204876724 kg/m^3 | 7.5 oz/uscup brownsugar_light | 917.205365787491 kg/m^3 | 217 g/uscup baking_powder | 933.267026570867 kg/m^3 | 4.6 grams / ustsp butter | 958.611418535173 kg/m^3 | 8 oz/uscup wood_ebony_gaboon | 961.107802437608 kg/m^3 | 60 lb/ft^3 sodiumdensity | 968 kg/m^3 | 0.968 g/cm^3 koshersalt_morton | 973.843853813078 kg/m^3 | 4.8 g / ustsp heavycream | 980.606658353447 kg/m^3 | 232 g/uscup Denz | 999.972000783978 kg/m^3 | Maz/Volm Dz | 999.972000783978 kg/m^3 | Denz waterdensity | 1 Mg/m^3 | gram / cm^3 brownsugar_dark | 1.01019392821756 Mg/m^3 | 239 g/uscup milk | 1.02287418673075 Mg/m^3 | 242 g/uscup sourcream | 1.02287418673075 Mg/m^3 | 242 g/uscup wood_rosewood_honduran | 1.02518165593345 Mg/m^3 | 64 lb/ft^3 cocoa_butter | 1.07843784585207 Mg/m^3 | 9 oz/uscup wood_cocobolo | 1.10527397280325 Mg/m^3 | 69 lb/ft^3 wood_ebony_macassar | 1.12129243617721 Mg/m^3 | 70 lb/ft^3 wood_snakewood | 1.21259767740878 Mg/m^3 | 75.7 lb/ft^3 salt | 1.21730481726635 Mg/m^3 | 6 g / ustsp wood_lignumvitae | 1.25744937485587 Mg/m^3 | 78.5 lb/ft^3 wood_blackwood | 1.27026414555504 Mg/m^3 | 79.3 lb/ft^3 molasses | 1.34804730731509 Mg/m^3 | 11.25 oz/uscup wood_blackironwood | 1.35356015509963 Mg/m^3 | 84.5 lb/ft^3 cornsyrup | 1.37800391414431 Mg/m^3 | 11.5 oz/uscup honey | 1.40796052097353 Mg/m^3 | 11.75 oz/uscup rubidiumdensity | 1.532 Mg/m^3 | 1.532 g/cm^3 calciumdensity | 1.55 Mg/m^3 | 1.55 g/cm^3 magnesiumdensity | 1.738 Mg/m^3 | 1.738 g/cm^3 phosphorus_white_density | 1.823 Mg/m^3 | 1.823 g/cm^3 berylliumdensity | 1.85 Mg/m^3 | 1.85 g/cm^3 sulfur_gamma_density | 1.92 Mg/m^3 | 1.92 g/cm^3 cesiumdensity | 1.93 Mg/m^3 | 1.93 g/cm^3 carbon_amorphous_density | 1.95 Mg/m^3 | 1.95 g/cm^3 sulfur_betadensity | 1.96 Mg/m^3 | 1.96 g/cm^3 sulfur_alpha_density | 2.07 Mg/m^3 | 2.07 g/cm^3 carbon_graphite_density | 2.267 Mg/m^3 | 2.267 g/cm^3 graphitedensity | 2.267 Mg/m^3 | carbon_graphite_density phosphorus_red_density | 2.27 Mg/m^3 | 2.27 g/cm^3 silicondensity | 2.329 Mg/m^3 | 2.3290 g/cm^3 phosphorus_violet_density | 2.36 Mg/m^3 | 2.36 g/cm^3 borondensity | 2.37 Mg/m^3 | 2.37 g/cm^3 franciumdensity | 2.48 Mg/m^3 | 2.48 g/cm^3 strontiumdensity | 2.64 Mg/m^3 | 2.64 g/cm^3 phosphorus_black_density | 2.69 Mg/m^3 | 2.69 g/cm^3 aluminumdensity | 2.7 Mg/m^3 | 2.7 g/cm^3 brominedensity | 3.1028 Mg/m^3 | 3.1028 g/cm^3 bariumdensity | 3.51 Mg/m^3 | 3.51 g/cm^3 carbon_diamond_density | 3.515 Mg/m^3 | 3.515 g/cm^3 diamonddensity | 3.515 Mg/m^3 | carbon_diamond_density scandiumdensity | 3.985 Mg/m^3 | 3.985 g/cm^3 selenium_vitreous_density | 4.28 Mg/m^3 | 4.28 g/cm^3 selenium_alpha_density | 4.39 Mg/m^3 | 4.39 g/cm^3 titaniumdensity | 4.406 Mg/m^3 | 4.406 g/cm^3 yttriumdensity | 4.472 Mg/m^3 | 4.472 g/cm^3 selenium_gray_density | 4.81 Mg/m^3 | 4.81 g/cm^3 iodinedensity | 4.933 Mg/m^3 | 4.933 g/cm^3 europiumdensity | 5.264 Mg/m^3 | 5.264 g/cm^3 germaniumdensity | 5.323 Mg/m^3 | 5.323 g/cm^3 radiumdensity | 5.5 Mg/m^3 | 5.5 g/cm^3 arsenicdensity | 5.727 Mg/m^3 | 5.727 g/cm^3 tin_alpha_density | 5.769 Mg/m^3 | 5.769 g/cm^3 tin_gray | 5.769 Mg/m^3 | tin_alpha_density galliumdensity | 5.91 Mg/m^3 | 5.91 g/cm^3 vanadiumdensity | 6.11 Mg/m^3 | 6.11 g/cm^3 lanthanumdensity | 6.162 Mg/m^3 | 6.162 g/cm^3 telluriumdensity | 6.24 Mg/m^3 | 6.24 g/cm^3 astatinedensity | 6.35 Mg/m^3 | 6.35 g/cm^3 zirconiumdensity | 6.52 Mg/m^3 | 6.52 g/cm^3 antimonydensity | 6.697 Mg/m^3 | 6.697 g/cm^3 ceriumdensity | 6.77 Mg/m^3 | 6.77 g/cm^3 praseodymiumdensity | 6.77 Mg/m^3 | 6.77 g/cm^3 ytterbiumdensity | 6.9 Mg/m^3 | 6.9 g/cm^3 neodymiumdensity | 7.01 Mg/m^3 | 7.01 g/cm^3 zincdensity | 7.14 Mg/m^3 | 7.14 g/cm^3 chromiumdensity | 7.19 Mg/m^3 | 7.19 g/cm^3 manganesedensity | 7.21 Mg/m^3 | 7.21 g/cm^3 promethiumdensity | 7.26 Mg/m^3 | 7.26 g/cm^3 tin_beta_density | 7.265 Mg/m^3 | 7.265 g/cm^3 tin_white | 7.265 Mg/m^3 | tin_beta_density indiumdensity | 7.31 Mg/m^3 | 7.31 g/cm^3 samariumdensity | 7.52 Mg/m^3 | 7.52 g/cm^3 irondensity | 7.874 Mg/m^3 | 7.874 g/cm^3 gadoliniumdensity | 7.9 Mg/m^3 | 7.9 g/cm^3 terbiumdensity | 8.23 Mg/m^3 | 8.23 g/cm^3 dysprosiumdensity | 8.54 Mg/m^3 | 8.54 g/cm^3 niobiumdensity | 8.57 Mg/m^3 | 8.57 g/cm^3 cadmiumdensity | 8.65 Mg/m^3 | 8.65 g/cm^3 holmiumdensity | 8.79 Mg/m^3 | 8.79 g/cm^3 einsteiniumdensity | 8.84 Mg/m^3 | 8.84 g/cm^3 copperdensity | 8.89 Mg/m^3 | 8.89 g/cm^3 cobaltdensity | 8.9 Mg/m^3 | 8.9 g/cm^3 nickeldensity | 8.908 Mg/m^3 | 8.908 g/cm^3 erbiumdensity | 9.066 Mg/m^3 | 9.066 g/cm^3 polonium_alpha_density | 9.196 Mg/m^3 | 9.196 g/cm^3 thuliumdensity | 9.32 Mg/m^3 | 9.32 g/cm^3 polonium_beta_density | 9.398 Mg/m^3 | 9.398 g/cm^3 fermiumdensity | 9.7 Mg/m^3 | 9.7 g/cm^3 bismuthdensity | 9.78 Mg/m^3 | 9.78 g/cm^3 lutetiumdensity | 9.841 Mg/m^3 | 9.841 g/cm^3 nobeliumdensity | 9.9 Mg/m^3 | 9.9 g/cm^3 actiniumdensity | 10 Mg/m^3 | 10 g/cm^3 molybdenumdensity | 10.28 Mg/m^3 | 10.28 g/cm^3 mendeleviumdensity | 10.3 Mg/m^3 | 10.3 g/cm^3 silverdensity | 10.49 Mg/m^3 | 10.49 g/cm^3 technetiumdensity | 11 Mg/m^3 | 11 g/cm^3 leaddensity | 11.34 Mg/m^3 | 11.34 g/cm^3 thoriumdensity | 11.7 Mg/m^3 | 11.7 g/cm^3 thalliumdensity | 11.85 Mg/m^3 | 11.85 g/cm^3 americiumdensity | 12 Mg/m^3 | 12 g/cm^3 palladiumdensity | 12.023 Mg/m^3 | 12.023 g/cm^3 rhodiumdensity | 12.41 Mg/m^3 | 12.41 g/cm^3 rutheniumdensity | 12.45 Mg/m^3 | 12.45 g/cm^3 berkelium_beta_density | 13.25 Mg/m^3 | 13.25 g/cm^3 hafniumdensity | 13.31 Mg/m^3 | 13.31 g/cm^3 curiumdensity | 13.51 Mg/m^3 | 13.51 g/cm^3 mercurydensity | 13.534 Mg/m^3 | 13.534 g/cm^3 berkelium_alphadensity | 14.78 Mg/m^3 | 14.78 g/cm^3 californiumdensity | 15.1 Mg/m^3 | 15.1 g/cm^3 protactiniumdensity | 15.37 Mg/m^3 | 15.37 g/cm^3 lawrenciumdensity | 16 Mg/m^3 | 16 g/cm^3 tantalumdensity | 16.69 Mg/m^3 | 16.69 g/cm^3 uraniumdensity | 19.1 Mg/m^3 | 19.1 g/cm^3 golddensity | 19.3 Mg/m^3 | 19.30 g/cm^3 tungstendensity | 19.3 Mg/m^3 | 19.3 g/cm^3 plutoniumdensity | 19.816 Mg/m^3 | 19.816 g/cm^3 neptuniumdensity | 20.45 Mg/m^3 | 20.45 g/cm^3 rheniumdensity | 21.02 Mg/m^3 | 21.02 g/cm^3 platinumdensity | 21.45 Mg/m^3 | 21.45 g/cm^3 iridiumdensity | 22.56 Mg/m^3 | 22.56 g/cm^3 osmiumdensity | 22.59 Mg/m^3 | 22.59 g/cm^3 rutherfordiumdensity | 23.2 Mg/m^3 | 23.2 g/cm^3 roentgeniumdensity | 28.7 Mg/m^3 | 28.7 g/cm^3 dubniumdensity | 29.3 Mg/m^3 | 29.3 g/cm^3 darmstadtiumdensity | 34.8 Mg/m^3 | 34.8 g/cm^3 seaborgiumdensity | 35 Mg/m^3 | 35 g/cm^3 bohriumdensity | 37.1 Mg/m^3 | 37.1 g/cm^3 meitneriumdensity | 37.4 Mg/m^3 | 37.4 g/cm^3 hassiumdensity | 41 Mg/m^3 | 41 g/cm^3 CONDUCTIVITY | 1 s^3*A^2/m^3*kg | CONDUCTANCE LENGTH / AREA IACS | 58000000 s^3*A^2/m^3*kg | copperconductivity copperconductivity | 58000000 s^3*A^2/m^3*kg | 58 siemens m / mm^2 epsilon0 | 8.85418781277335e-12 s^4*A^2/m^3*kg | 1/mu0 c^2 brmpg | 354006.189934647 m^-2 | mile/brgallon mpg | 425143.707430272 m^-2 | mile/gal usmpg | 425143.707430272 m^-2 | mile/usgallon skot | 318.309886183791 µlx | 1e-3 apostilb nox | 1 mlx | 1e-3 lux apostilb | 318.309886183791 mlx | cd/pi m^2 asb | 318.309886183791 mlx | apostilb blondel | 318.309886183791 mlx | apostilb equivalentlux | 318.309886183791 mlx | cd / pi m^2 EXITANCE | 1 lx | lux ILLUMINANCE | 1 lx | lux LUMINANCE | 1 lx | nit lux | 1 lx | lm/m^2 lx | 1 lx | lux metercandle | 1 lx | lumen/m^2 nit | 1 lx | cd/m^2 ㏓ | 1 lx | lx fL | 3.42625909963539 lx | footlambert footlambert | 3.42625909963539 lx | cd / pi ft^2 footcandle | 10.7639104167097 lx | lumen/ft^2 skylum_o | 2 klx | 2000 cd/m^2 moonlum | 2.5 klx | 2500 cd/m^2 equivalentphot | 3.18309886183791 klx | cd / pi cm^2 lambert | 3.18309886183791 klx | cd / pi cm^2 skylum | 8 klx | 8000 cd/m^2 ph | 10 klx | phot phot | 10 klx | lumen / cm^2 sb | 10 klx | stilb stilb | 10 klx | cd / cm^2 sunillum_o | 10 klx | 10e3 lux sunillum | 100 klx | 100e3 lux sunlum_h | 6 Mlx | 6e6 cd/m^2 sunlum | 1.6 Glx | 1.6e9 cd/m^2 N_exif | 0.32 s*cd/m^2 | 1|3.125 lx s N_speed | 0.32 s*cd/m^2 | N_exif mcs | 1 s*cd/m^2 | metercandle s D_FIELD | 1 s*A/m^2 | E_FIELD epsilon0 / epsilon0_SI POLARIZATION | 1 s*A/m^2 | ELECTRIC_DIPOLE_MOMENT / VOLUME pfu | 10000 m^-2*s^-1 | / cm^2 sr s gsm | 1 g/m^2 | grams / meter^2 lbbible | 1.48014648345086 g/m^2 | poundbiblepaper lbbook | 1.48014648345086 g/m^2 | poundbookpaper lboffset | 1.48014648345086 g/m^2 | poundoffsetpaper lbtext | 1.48014648345086 g/m^2 | poundtextpaper poundbiblepaper | 1.48014648345086 g/m^2 | poundbookpaper poundbookpaper | 1.48014648345086 g/m^2 | lb / 25 inch 38 inch ream poundoffsetpaper | 1.48014648345086 g/m^2 | poundbookpaper poundtextpaper | 1.48014648345086 g/m^2 | poundbookpaper lbbag | 1.62747587879435 g/m^2 | poundbagpaper lbglassine | 1.62747587879435 g/m^2 | poundglassinepaper lbnewsprint | 1.62747587879435 g/m^2 | poundnewsprintpaper lbposter | 1.62747587879435 g/m^2 | poundposterpaper lbtag | 1.62747587879435 g/m^2 | poundtagpaper lbtissue | 1.62747587879435 g/m^2 | poundtissuepaper lbwaxing | 1.62747587879435 g/m^2 | poundwaxingpaper lbwrapping | 1.62747587879435 g/m^2 | poundwrappingpaper poundbagpaper | 1.62747587879435 g/m^2 | poundtagpaper poundglassinepaper | 1.62747587879435 g/m^2 | poundtagpaper poundnewsprintpaper | 1.62747587879435 g/m^2 | poundtagpaper poundposterpaper | 1.62747587879435 g/m^2 | poundtagpaper poundtagpaper | 1.62747587879435 g/m^2 | lb / 24 inch 36 inch ream poundtissuepaper | 1.62747587879435 g/m^2 | poundtagpaper poundwaxingpaper | 1.62747587879435 g/m^2 | poundtagpaper poundwrappingpaper | 1.62747587879435 g/m^2 | poundtagpaper lbindex | 1.80795777470693 g/m^2 | poundindexpaper lbindexbristol | 1.80795777470693 g/m^2 | poundindexpaper poundindexbristolpaper | 1.80795777470693 g/m^2 | poundindexpaper poundindexpaper | 1.80795777470693 g/m^2 | lb / 25.5 inch 30.5 inch ream lbbristol | 2.19280960511239 g/m^2 | poundbristolpaper lbpostcard | 2.19280960511239 g/m^2 | poundpostcardpaper lbweddingbristol | 2.19280960511239 g/m^2 | poundweddingbristol poundbristolpaper | 2.19280960511239 g/m^2 | poundweddingbristol poundpostcardpaper | 2.19280960511239 g/m^2 | lb / 22.5 inch 28.5 inch ream poundweddingbristol | 2.19280960511239 g/m^2 | poundpostcardpaper lbblanks | 2.28269344038688 g/m^2 | poundblankspaper poundblankspaper | 2.28269344038688 g/m^2 | lb / 22 inch 28 inch ream lbcover | 2.70411376784292 g/m^2 | poundcoverpaper poundcoverpaper | 2.70411376784292 g/m^2 | lb / 20 inch 26 inch ream lbblotting | 3.0836385071893 g/m^2 | poundblottingpaper poundblottingpaper | 3.0836385071893 g/m^2 | lb / 19 inch 24 inch ream lbbond | 3.75973037240192 g/m^2 | poundbondpaper lbcopy | 3.75973037240192 g/m^2 | poundcopypaper lbledger | 3.75973037240192 g/m^2 | poundledgerpaper lbwriting | 3.75973037240192 g/m^2 | poundwritingpaper poundbondpaper | 3.75973037240192 g/m^2 | lb / 17 inch 22 inch ream poundcopypaper | 3.75973037240192 g/m^2 | poundbondpaper poundledgerpaper | 3.75973037240192 g/m^2 | poundbondpaper poundwritingpaper | 3.75973037240192 g/m^2 | poundbondpaper silkmm | 4.33446057048713 g/m^2 | silkmomme silkmomme | 4.33446057048713 g/m^2 | momme / 25 yards 1.49 inch lbboxboard | 4.88242763638305 g/m^2 | poundboxboard lbpaperboard | 4.88242763638305 g/m^2 | poundpaperboard poundboxboard | 4.88242763638305 g/m^2 | lb / 1000 ft^2 poundpaperboard | 4.88242763638305 g/m^2 | poundboxboard paperpoint | 20.32 g/m^2 | pointthickness paperdensity sailmakersounce | 42.8283125998513 g/m^2 | oz / sailmakersyard 36 inch papercaliper | 20.32 kg/m^2 | in paperdensity H2O100C | 9.398497227 Mg/m^2*s^2 | 0.95838 force gram / cm^3 H2O50C | 9.6896566655 Mg/m^2*s^2 | 0.98807 force gram / cm^3 H2O25C | 9.7779165155 Mg/m^2*s^2 | 0.99707 force gram / cm^3 H2O20C | 9.7892922295 Mg/m^2*s^2 | 0.99823 force gram / cm^3 H2O18C | 9.793116823 Mg/m^2*s^2 | 0.99862 force gram / cm^3 H2O15C | 9.7981182145 Mg/m^2*s^2 | 0.99913 force gram / cm^3 H2O10C | 9.8040022045 Mg/m^2*s^2 | 0.99973 force gram / cm^3 H2O0C | 9.8053751355 Mg/m^2*s^2 | 0.99987 force gram / cm^3 H2O5C | 9.8065519335 Mg/m^2*s^2 | 0.99999 force gram / cm^3 H2O | 9.80665 Mg/m^2*s^2 | water water | 9.80665 Mg/m^2*s^2 | gram force/cm^3 wc | 9.80665 Mg/m^2*s^2 | water seawater | 10 Mg/m^2*s^2 | 0.1 bar / meter Hg40C | 132.363297045 Mg/m^2*s^2 | 13.4973 force gram / cm^3 Hg30C | 132.602579305 Mg/m^2*s^2 | 13.5217 force gram / cm^3 Hg23C | 132.76831169 Mg/m^2*s^2 | 13.5386 force gram / cm^3 Hg20C | 132.84284223 Mg/m^2*s^2 | 13.5462 force gram / cm^3 Hg60F | 132.95267671 Mg/m^2*s^2 | 13.5574 force gram / cm^3 Hg10C | 133.08408582 Mg/m^2*s^2 | 13.5708 force gram / cm^3 Hg | 133.322387415 Mg/m^2*s^2 | 13.5951 gram force / cm^3 rayl | 10 kg/m^2*s | dyn s / cm^3 K_J | 483597848416984 s^2*A/m^2*kg | 2e/h K_J90 | 483597900000000 s^2*A/m^2*kg | 483597.9 GHz/V sturgeon | 1 s^2*A^2/m^2*kg | /henry THERMAL_RESISTANCE | 1 s^3*K/m^2*kg | 1/THERMAL_CONDUCTANCE fourier | 1 s^3*K^2/m^2*kg | thermalohm thermalohm | 1 s^3*K^2/m^2*kg | K^2/W statmho | 1.11265005605362 pS | /statohm stmho | 1.11265005605362 pS | statmho conductancequantum | 77.4809172986365 µS | 2 e^2 / h CONDUCTANCE | 1 S | siemens S | 1 S | siemens mho | 1 S | siemens siemens | 1 S | A/V ℧ | 1 S | mho abmho | 1 GS | /abohm thermalhenry | 1 s^4*K^2/m^2*kg | J K^2/W^2 pf | 1 pF | pF ㎊ | 1 pF | pF cmcapacitance | 1.11265005605362 pF | statfarad stF | 1.11265005605362 pF | statfarad statF | 1.11265005605362 pF | statfarad statfarad | 1.11265005605362 pF | statamp sec / statvolt ㎋ | 1 nF | nF jar | 1.11265005605362 nF | 1000 statfarad ㎌ | 1 µF | µF intfarad | 999.505 mF | 0.999505 F farad90 | 999.999982206333 mF | (R_K90/R_K) F CAPACITANCE | 1 F | farad F | 1 F | farad farad | 1 F | C/V abF | 1 GF | abfarad abfarad | 1 GF | abampere sec / abvolt diopter | 1 m^-1 | /m dioptre | 1 m^-1 | diopter balmer | 100 m^-1 | kayser kayser | 100 m^-1 | 1/cm R_H | 10967758.3402802 m^-1 | Rinfinity m_p / (m_e + m_p) Rinfinity | 10973731.5681598 m^-1 | hartree / 2 h c lapserate | 6.5 mK/m | 6.5 K/km H_FIELD | 1 A/m | B_FIELD / (mu0/mu0_SI) MAGNETIZATION | 1 A/m | MAGNETIC_DIPOLE_MOMENT / VOLUME Oe | 79.5774715023846 A/m | oersted oe | 79.5774715023846 A/m | Oe oersted | 79.5774715023846 A/m | gauss / mu0 perm | 57.2134946709451 ps/m | perm_0C perm_0 | 57.2134946709451 ps/m | perm_0C perm_0C | 57.2134946709451 ps/m | grain / hr ft^2 inHg perm_zero | 57.2134946709451 ps/m | perm_0C perm_23C | 57.4522610462652 ps/m | grain / hr ft^2 in Hg23C perm_twentythree | 57.4522610462652 ps/m | perm_23C helmholtz | 3.33564095198152e-10 s*A/m | debye/angstrom^2 drex | 100 µg/m | 0.1 tex denier | 111.111111111111 µg/m | 1|9 tex poumar | 496.054647856518 µg/m | lb / 1e6 yard tex | 1 mg/m | gram / km manchesteryarnnumber | 1.93771346818952 mg/m | drams/1000 yards LINEAR_DENSITY | 1 kg/m | MASS / LENGTH plf | 1.48816394356955 kg/m | lb / foot pli | 17.8579673228346 kg/m | lb/in flick | 10 Tg/m*s^3 | W / cm^2 sr micrometer barad | 100 mPa | barye barye | 100 mPa | dyne/cm^2 PRESSURE | 1 Pa | FORCE / AREA Pa | 1 Pa | pascal STRESS | 1 Pa | FORCE / AREA pa | 1 Pa | Pa pascal | 1 Pa | N/m^2 tor | 1 Pa | Pa ㎩ | 1 Pa | Pa mmH2O | 9.80665 Pa | mm water vac | 100 Pa | millibar ㍱ | 100 Pa | hPa ㏔ | 100 Pa | mb torr | 133.322368421053 Pa | atm / 760 mmHg | 133.322387415 Pa | mm Hg inH2O | 249.08891 Pa | inch water osi | 430.922330823022 Pa | ounce force / inch^2 pieze | 1 kPa | sthene / m^2 ㎪ | 1 kPa | kPa fsw | 3.048 kPa | foot seawater inHg | 3.386388640341 kPa | inch Hg psi | 6.89475729316836 kPa | pound force / inch^2 psia | 6.89475729316836 kPa | psi msw | 10 kPa | meter seawater at | 98.0665 kPa | technicalatmosphere technicalatmosphere | 98.0665 kPa | kgf / cm^2 b | 100 kPa | bar bar | 100 kPa | 1e5 Pa ㍴ | 100 kPa | bar Patm | 101.325 kPa | atm atm | 101.325 kPa | 101325 Pa atmosphere | 101.325 kPa | atm stdatmP0 | 101.325 kPa | atm ㎫ | 1 MPa | MPa ksi | 6.89475729316836 MPa | kip / in^2 tsi | 13.7895145863367 MPa | ton force / inch^2 naturalgas_LHV | 34.6508196012831 MPa | 930 btu/ft3 naturalgas | 38.2649373446427 MPa | naturalgas_HHV naturalgas_HHV | 38.2649373446427 MPa | 1027 btu/ft3 propane | 93.3 MPa | 93.3 MJ/m^3 butane | 124 MPa | 124 MJ/m^3 ㎬ | 1 GPa | GPa wood_mod_balsa | 3.70937942372458 GPa | 0.538e6 lbf/in^2 wood_mod_boxeldermaple | 7.23949515782678 GPa | 1.050e6 lbf/in^2 wood_mod_silvermaple | 7.86002331421193 GPa | 1.140e6 lbf/in^2 wood_mod_easternwhitepine | 8.54949904352877 GPa | 1.240e6 lbf/in^2 wood_mod_jeffreypine | 8.54949904352877 GPa | 1.240e6 lbf/in^2 wood_mod_ponderosapine | 8.89423690818718 GPa | 1.290e6 lbf/in^2 wood_mod_whitespruce | 9.06660584051639 GPa | 1.315e6 lbf/in^2 wood_mod_softmaple | 9.10107962698224 GPa | (wood_mod_bigleafmaple + wood_mod_boxeldermaple + wood_mod_redmaple + wood_mod_silvermaple) / 4 wood_mod_whitepine | 9.30792234577729 GPa | (wood_mod_easternwhitepine + wood_mod_westernwhitepine) / 2 wood_mod_englemannspruce | 9.43892273434749 GPa | 1.369e6 lbf/in^2 wood_mod_bigleafmaple | 9.99739807509412 GPa | 1.450e6 lbf/in^2 wood_mod_mahogany | 10.0525561334395 GPa | 1.458e6 lbf/in^2 wood_mod_basswood | 10.0663456480258 GPa | 1.460e6 lbf/in^2 wood_mod_westernwhitepine | 10.0663456480258 GPa | 1.460e6 lbf/in^2 wood_mod_spruce | 10.1587353957543 GPa | (wood_mod_blackspruce + wood_mod_englemannspruce + wood_mod_redspruce + wood_mod_sitkaspruce + wood_mod_whitespruce) / 5 wood_mod_cherry | 10.2731883668209 GPa | 1.490e6 lbf/in^2 wood_mod_koa | 10.362820211632 GPa | 1.503e6 lbf/in^2 wood_mod_blackspruce | 10.5007153574954 GPa | 1.523e6 lbf/in^2 wood_mod_redspruce | 10.7558213773426 GPa | 1.560e6 lbf/in^2 wood_mod_poplar | 10.893716523206 GPa | 1.580e6 lbf/in^2 wood_mod_sitkaspruce | 11.0316116690694 GPa | 1.600e6 lbf/in^2 wood_mod_redpine | 11.2384543878644 GPa | 1.630e6 lbf/in^2 wood_mod_redmaple | 11.3074019607961 GPa | 1.640e6 lbf/in^2 wood_mod_rosewood_indian | 11.5004551650048 GPa | 1.668e6 lbf/in^2 wood_mod_blackwalnut | 11.5831922525228 GPa | 1.680e6 lbf/in^2 wood_mod_walnut | 11.5831922525228 GPa | wood_mod_blackwalnut wood_mod_beech | 11.8589825442496 GPa | 1.720e6 lbf/in^2 wood_mod_shortleafpine | 12.0658252630446 GPa | 1.750e6 lbf/in^2 wood_mod_redoak | 12.1416675932695 GPa | 1.761e6 lbf/in^2 wood_mod_whiteoak | 12.1485623505627 GPa | 1.762e6 lbf/in^2 wood_mod_douglasfir | 12.1692466224422 GPa | 1.765e6 lbf/in^2 wood_mod_teak | 12.2795627391328 GPa | 1.781e6 lbf/in^2 wood_mod_loblollypine | 12.3416155547714 GPa | 1.790e6 lbf/in^2 wood_mod_hardmaple | 12.6174058464981 GPa | 1.830e6 lbf/in^2 wood_mod_yellowpine | 12.9276699246907 GPa | (wood_mod_loblollypine + wood_mod_longleafpine + wood_mod_shortleafpine + wood_mod_slashpine) / 4 wood_mod_longleafpine | 13.6516194404734 GPa | 1.980e6 lbf/in^2 wood_mod_slashpine | 13.6516194404734 GPa | 1.980e6 lbf/in^2 wood_mod_birch | 13.8584621592684 GPa | wood_mod_birchyellow wood_mod_birchyellow | 13.8584621592684 GPa | 2.010e6 lbf/in^2 wood_mod_rosewood_brazilian | 13.9274097322001 GPa | 2.020e6 lbf/in^2 wood_mod_lignumvitae | 14.085989149943 GPa | 2.043e6 lbf/in^2 wood_mod_ocotepine | 15.2305188606089 GPa | 2.209e6 lbf/in^2 wood_mod_zebrawood | 16.3681538139817 GPa | 2.374e6 lbf/in^2 wood_mod_ebony_gaboon | 16.8852606109693 GPa | 2.449e6 lbf/in^2 wood_mod_ebony_macassar | 17.3403145923184 GPa | 2.515e6 lbf/in^2 wood_mod_blackwood | 17.9470532341172 GPa | 2.603e6 lbf/in^2 wood_mod_bubinga | 18.4090019727595 GPa | 2.670e6 lbf/in^2 wood_mod_cocobolo | 18.6985817790726 GPa | 2.712e6 lbf/in^2 wood_mod_blackironwood | 20.4498501315374 GPa | 2.966e6 lbf/in^2 ethanol_LHV | 21.09882163439 GPa | 75700 btu/usgallon wood_mod_rosewood_honduran | 21.9942757652071 GPa | 3.190e6 lbf/in^2 wood_mod_snakewood | 23.1939635342184 GPa | 3.364e6 lbf/in^2 ethanol_HHV | 23.4121666748845 GPa | 84000 btu/usgallon gasoline_LHV | 32.0523710429967 GPa | 115000 btu/usgallon gasoline | 34.8395337423877 GPa | gasoline_HHV gasoline_HHV | 34.8395337423877 GPa | 125000 btu/usgallon diesel | 36.3724732270527 GPa | 130500 btu/usgallon heating | 37.3 GPa | 37.3 MJ/liter fueloil | 39.7 GPa | 39.7 MJ/liter P | 100 g/m*s | poise poise | 100 g/m*s | gram / cm s VISCOSITY | 1 kg/m*s | FORCE TIME / AREA poiseuille | 1 kg/m*s | N s / m^2 reyn | 6.89475729316836 Mg/m*s | psi sec lorentz | 46.6864477828202 s^2*A/m*kg | bohrmagneton / h c THERMAL_RESISTIVITY | 1 s^3*K/m*kg | 1/THERMAL_CONDUCTIVITY (3258 rows) -- units that do not conform to their original definition SELECT name, unit, definition, definition::unit AS parsed_definition, unit / definition::unit AS deviation FROM unit_units WHERE unit <> definition::unit; name | unit | definition | parsed_definition | deviation ------+------+------------+-------------------+----------- (0 rows) -- units that differ when pushed through output-input functions SELECT name, unit, unit::text::unit, definition FROM unit_units WHERE unit::text::unit::text <> unit::text; name | unit | unit | definition ------+------+------+------------ (0 rows) -- prefix-unit combinations that are ambiguous /* CREATE FUNCTION valid_unit(u text) RETURNS boolean LANGUAGE plpgsql AS $$ BEGIN PERFORM u::unit; RETURN true; EXCEPTION WHEN OTHERS THEN RETURN false; END; $$; -- takes about 5min to run with cold cache, and about 3s with the hash table filled SELECT prefix||name AS unit, prefix, name FROM unit_prefixes CROSS JOIN unit_units WHERE NOT valid_unit(prefix||name) ORDER BY prefix||name, prefix; */ SELECT 'daA'::unit; -- ambiguous in original definitions.units unit ------ 10 A (1 row) SELECT 'dasb'::unit; ERROR: unit "dasb" is ambiguous, "d-asb" vs. "da-sb" LINE 1: SELECT 'dasb'::unit; ^ SELECT 'dat'::unit; ERROR: unit "dat" is ambiguous, "d-at" vs. "da-t" LINE 1: SELECT 'dat'::unit; ^ SELECT 'dau'::unit; ERROR: unit "dau" is ambiguous, "d-au" vs. "da-u" LINE 1: SELECT 'dau'::unit; ^ SELECT 'daustbl'::unit; ERROR: unit "daustbl" is ambiguous, "d-austbl" vs. "da-ustbl" LINE 1: SELECT 'daustbl'::unit; ^ SELECT 'daustblsp'::unit; ERROR: unit "daustblsp" is ambiguous, "d-austblsp" vs. "da-ustblsp" LINE 1: SELECT 'daustblsp'::unit; ^ SELECT 'daustbsp'::unit; ERROR: unit "daustbsp" is ambiguous, "d-austbsp" vs. "da-ustbsp" LINE 1: SELECT 'daustbsp'::unit; ^ SELECT 'daustsp'::unit; ERROR: unit "daustsp" is ambiguous, "d-austsp" vs. "da-ustsp" LINE 1: SELECT 'daustsp'::unit; ^ SELECT 'Eint'::unit; ERROR: unit "Eint" is ambiguous, "E-int" vs. "Ei-nt" LINE 1: SELECT 'Eint'::unit; ^ SELECT 'Gint'::unit; ERROR: unit "Gint" is ambiguous, "G-int" vs. "Gi-nt" LINE 1: SELECT 'Gint'::unit; ^ SELECT 'Mint'::unit; ERROR: unit "Mint" is ambiguous, "M-int" vs. "Mi-nt" LINE 1: SELECT 'Mint'::unit; ^ SELECT 'Pint'::unit; ERROR: unit "Pint" is ambiguous, "P-int" vs. "Pi-nt" LINE 1: SELECT 'Pint'::unit; ^ SELECT 'Tint'::unit; ERROR: unit "Tint" is ambiguous, "T-int" vs. "Ti-nt" LINE 1: SELECT 'Tint'::unit; ^ SELECT 'Yint'::unit; ERROR: unit "Yint" is ambiguous, "Y-int" vs. "Yi-nt" LINE 1: SELECT 'Yint'::unit; ^ SELECT 'yoctodecillion'::unit; ERROR: unit "yoctodecillion" is ambiguous, "y-octodecillion" vs. "yocto-decillion" LINE 1: SELECT 'yoctodecillion'::unit; ^ SELECT 'Zint'::unit; ERROR: unit "Zint" is ambiguous, "Z-int" vs. "Zi-nt" LINE 1: SELECT 'Zint'::unit; ^ postgresql-unit-7.8/expected/upgrade.out000066400000000000000000000036471450213077700205510ustar00rootroot00000000000000-- version 1 SET client_min_messages = warning; DROP EXTENSION IF EXISTS unit CASCADE; CREATE TABLE IF NOT EXISTS pg_depend_save (LIKE pg_depend); RESET client_min_messages; \set pg_depend_save 'BEGIN; DELETE FROM pg_depend_save; WITH ext AS (DELETE FROM pg_depend WHERE refobjid = (SELECT oid FROM pg_extension WHERE extname = $$unit$$) RETURNING *) INSERT INTO pg_depend_save SELECT * FROM ext; COMMIT;' \set pg_depend_restore 'INSERT INTO pg_depend SELECT * FROM pg_depend_save;' CREATE EXTENSION unit VERSION "1"; :pg_depend_save \! pg_dump -f unit-1.dump -T pg_depend_save :pg_depend_restore -- upgrade to version 2 ALTER EXTENSION unit UPDATE TO "2"; :pg_depend_save \! pg_dump -f unit-1-2.dump -T pg_depend_save :pg_depend_restore -- upgrade to version 3 ALTER EXTENSION unit UPDATE TO "3"; :pg_depend_save \! pg_dump -f unit-2-3.dump -T pg_depend_save :pg_depend_restore -- upgrade to version 4 ALTER EXTENSION unit UPDATE TO "4"; :pg_depend_save \! pg_dump -f unit-3-4.dump -T pg_depend_save :pg_depend_restore -- upgrade to version 5 ALTER EXTENSION unit UPDATE TO "5"; :pg_depend_save \! pg_dump -f unit-4-5.dump -T pg_depend_save :pg_depend_restore -- upgrade to version 6 ALTER EXTENSION unit UPDATE TO "6"; :pg_depend_save \! pg_dump -f unit-5-6.dump -T pg_depend_save :pg_depend_restore -- upgrade to version 7 ALTER EXTENSION unit UPDATE TO "7"; :pg_depend_save \! pg_dump -f unit-6-7.dump -T pg_depend_save :pg_depend_restore -- reinstall latest version DROP EXTENSION unit CASCADE; CREATE EXTENSION unit; :pg_depend_save \! pg_dump -f unit-create.dump -T pg_depend_save :pg_depend_restore -- different ordering in unit_accum_t expected: \! diff -u --label unit-update.dump unit-6-7.dump --label unit-create.dump unit-create.dump | sed -e 's/@@.*@@/@@/' --- unit-update.dump +++ unit-create.dump @@ CREATE TYPE public.unit_accum_t AS ( s public.unit, - n bigint, - squares double precision + squares double precision, + n bigint ); postgresql-unit-7.8/float8out_unit.h000066400000000000000000000014051450213077700177130ustar00rootroot00000000000000/* minimal version of PG 9.6's float8out_internal function for use in 9.4 and 9.5 */ /* With the adaption of ryn in PG 12, it is now used for all versions */ #define MAXDOUBLEWIDTH 128 extern int extra_float_digits; static char * float8out_unit(double num) { char *ascii = (char *) palloc(MAXDOUBLEWIDTH + 1); int extradigits = #if PG_VERSION_NUM >= 120000 extra_float_digits == 1 ? 0 : extra_float_digits; #else extra_float_digits; #endif int ndig = DBL_DIG + extradigits; if (isnan(num)) return strcpy(ascii, "NaN"); if (!isfinite(num)) { if (num > 0) return strcpy(ascii, "Infinity"); else return strcpy(ascii, "-Infinity"); } if (ndig < 1) ndig = 1; snprintf(ascii, MAXDOUBLEWIDTH + 1, "%.*g", ndig, num); return ascii; } postgresql-unit-7.8/load-units.pl000077500000000000000000000102531450213077700171760ustar00rootroot00000000000000#!/usr/bin/perl # load definitions.units.patched into the unit_prefixes and unit_units tables # existing data is wiped! use utf8; use open ":std", ":encoding(UTF-8)"; use strict; use warnings; use DBD::Pg; my $file = "definitions.units.patched"; open F, "< :encoding(utf-8)", $file or die "$file: $!"; my $dbh = DBI->connect("dbi:Pg:", '', '', {AutoCommit => 1, PrintError => 0, RaiseError => 0} ) || die "PG connection failed"; $dbh->do("SET synchronous_commit = off"); $dbh->do("TRUNCATE unit_prefixes, unit_units"); $dbh->do("SET client_min_messages = 'error'"); $dbh->do("ALTER TABLE unit_prefixes ADD COLUMN IF NOT EXISTS ordering serial"); # add temp column to preserve load ordering for dumping $dbh->do("ALTER TABLE unit_units ADD COLUMN IF NOT EXISTS ordering serial"); $dbh->do("RESET client_min_messages"); my $skip_british = 0; my @todo; my $continued = ''; ; # skip over initial line with BOM while () { # skip over locale specific parts $skip_british = 1 if /^!var UNITS_ENGLISH GB/; $skip_british = 0 if /^!endvar/; next if ($skip_british); if (/\s*(.*)\\$/) { $continued .= $1; next; } elsif ($continued) { s/^\s*//; $_ = "$continued$_"; $continued = ''; } s/#.*//; s/\s+$//; next if /^\s*$/; # skip emtpy lines next if /^!/; # skip pragmas next if /^\+/; # skip units from non-SI systems #next if /^[0-9]/; # skip over table contents #next if /^\s/; # skip over table contents/continued lines unless (/^(\S+)\s+(.*)/) { print "unknown line $_\n"; exit 1; } my ($unit, $def) = ($1, $2); next if ($unit =~ /[(\[]/); # skip functions and table definitions my $is_prefix = ($unit =~ s/-$//); # it's a prefix if it ends with '-' $def = $unit if ($def eq '!'); # base unit $def = 1 if ($def eq '!dimensionless'); my $u = { unit => $unit, def => $def, is_prefix => $is_prefix }; $u->{is_base} = ($u->{unit} eq $u->{def}); # shifted units if ($unit =~ /^(℃|°C|degC|degcelsius)$/) { $u->{shift} = '273.15'; # 0 °C in K } elsif ($unit =~ /^(℉|°F|degF|degfahrenheit)$/) { $u->{shift} = '255.3722222222222222'; # 0 °F in K } elsif ($unit =~ /^(degreaumur)$/) { $u->{shift} = '273.15'; # 0 °Ré in K } push @todo, $u; } # try repeatedly to insert units, unfortunately the input data contains some # forward references my ($n_todo, $new_n_todo); do { $n_todo = @todo; print "$n_todo units left to try ...\n"; my @new_todo; foreach my $u (@todo) { my ($unit, $def, $shift, $is_prefix) = ($u->{unit}, $u->{def}, $u->{shift}, $u->{is_prefix}); if ($is_prefix) { my $ret = $dbh->do("INSERT INTO unit_prefixes (prefix, factor, definition, dump) VALUES (?, value(?::unit), ?, NULL)", undef, $unit, $def, $def); next if defined $ret; # see if the prefix is defined in terms of another prefix # (we can't simply inject all prefixes as units because conflicts exist, e.g. on 'T') $ret = $dbh->do("INSERT INTO unit_prefixes (prefix, factor, definition, dump) SELECT ?, factor, ?, NULL FROM unit_prefixes WHERE prefix = ?", undef, $unit, $def, $def); next if defined $ret and $ret > 0; } else { my ($is_hashed) = $dbh->selectrow_array("SELECT unit_is_hashed(?)", undef, $unit); if ($is_hashed and not $u->{is_base}) { # if the unit we are defining now was successfully used before, # something went wrong. It indicates that the new unit could # also be parsed as prefix-otherknownunit, e.g. "ft" vs "f-t" print "Unit $unit has already been used before being defined. Bad.\n"; exit 1; } my $ret = $dbh->do("INSERT INTO unit_units (name, unit, shift, definition, dump) VALUES (?, ?, ?, ?, NULL)", undef, $unit, $def, $shift, $def); next if defined $ret; $u->{error} = $dbh->errstr; } push @new_todo, $u; } $new_n_todo = @new_todo; @todo = @new_todo; } while ($n_todo != $new_n_todo); print "$new_n_todo units not inserted:\n"; open my $unres, '>', "definitions.unresolved"; foreach my $u (@todo) { if ($u->{is_prefix}) { print "Prefix $u->{unit}: $u->{def}\n"; } else { print $unres "$u->{unit}\t$u->{def}\n"; next if ($u->{error} =~ /dollar|euro|pence|quid|shilling/); # skip currencies so we can see the rest better print "$u->{unit}: $u->{def} ($u->{error})\n"; } } close $unres; postgresql-unit-7.8/powers.c000066400000000000000000000013521450213077700162420ustar00rootroot00000000000000#include #include #define p(n, p, x) printf("#define POWER_%-3d %-22a /* %s %-22a */\n", n, nextafter(x, 0), p, x) int main () { printf("/* powers-of-10 constants */\n"); printf("/* constants here are rounded down so >= comparisons work better */\n\n"); p(33, " ", 1e33); p(30, "Q", 1e30); p(27, "R", 1e27); p(24, "Y", 1e24); p(21, "Z", 1e21); p(18, "E", 1e18); p(15, "P", 1e15); p(12, "T", 1e12); p(9, "G", 1e9); p(6, "M", 1e6); p(3, "k", 1e3); p(0, " ", 1e0); p(-3, "m", 1e-3); p(-6, "µ", 1e-6); p(-9, "n", 1e-9); p(-12, "p", 1e-12); p(-15, "f", 1e-15); p(-18, "a", 1e-18); p(-21, "z", 1e-21); p(-24, "y", 1e-24); p(-27, "r", 1e-27); p(-30, "q", 1e-30); p(-33, " ", 1e-33); } postgresql-unit-7.8/powers.h000066400000000000000000000033331450213077700162500ustar00rootroot00000000000000/* powers-of-10 constants */ /* constants here are rounded down so >= comparisons work better */ #define POWER_33 0x1.8a6e32246c99bp+109 /* 0x1.8a6e32246c99cp+109 */ #define POWER_30 0x1.93e5939a08ce9p+99 /* Q 0x1.93e5939a08ceap+99 */ #define POWER_27 0x1.9d971e4fe8401p+89 /* R 0x1.9d971e4fe8402p+89 */ #define POWER_24 0x1.a784379d99db3p+79 /* Y 0x1.a784379d99db4p+79 */ #define POWER_21 0x1.b1ae4d6e2ef4fp+69 /* Z 0x1.b1ae4d6e2ef5p+69 */ #define POWER_18 0x1.bc16d674ec7ffp+59 /* E 0x1.bc16d674ec8p+59 */ #define POWER_15 0x1.c6bf52633ffffp+49 /* P 0x1.c6bf52634p+49 */ #define POWER_12 0x1.d1a94a1ffffffp+39 /* T 0x1.d1a94a2p+39 */ #define POWER_9 0x1.dcd64ffffffffp+29 /* G 0x1.dcd65p+29 */ #define POWER_6 0x1.e847fffffffffp+19 /* M 0x1.e848p+19 */ #define POWER_3 0x1.f3fffffffffffp+9 /* k 0x1.f4p+9 */ #define POWER_0 0x1.fffffffffffffp-1 /* 0x1p+0 */ #define POWER__3 0x1.0624dd2f1a9fbp-10 /* m 0x1.0624dd2f1a9fcp-10 */ #define POWER__6 0x1.0c6f7a0b5ed8cp-20 /* µ 0x1.0c6f7a0b5ed8dp-20 */ #define POWER__9 0x1.12e0be826d694p-30 /* n 0x1.12e0be826d695p-30 */ #define POWER__12 0x1.19799812dea1p-40 /* p 0x1.19799812dea11p-40 */ #define POWER__15 0x1.203af9ee75615p-50 /* f 0x1.203af9ee75616p-50 */ #define POWER__18 0x1.2725dd1d243abp-60 /* a 0x1.2725dd1d243acp-60 */ #define POWER__21 0x1.2e3b40a0e9b4ep-70 /* z 0x1.2e3b40a0e9b4fp-70 */ #define POWER__24 0x1.357c299a88ea6p-80 /* y 0x1.357c299a88ea7p-80 */ #define POWER__27 0x1.3ce9a36f23c0fp-90 /* r 0x1.3ce9a36f23c1p-90 */ #define POWER__30 0x1.4484bfeebc29fp-100 /* q 0x1.4484bfeebc2ap-100 */ #define POWER__33 0x1.4c4e977ba1f5bp-110 /* 0x1.4c4e977ba1f5cp-110 */ postgresql-unit-7.8/sql/000077500000000000000000000000001450213077700153555ustar00rootroot00000000000000postgresql-unit-7.8/sql/aggregate.sql000066400000000000000000000063561450213077700200360ustar00rootroot00000000000000-- test aggregates /* revert to pre-12 default for stddev(value()) tests */ SET extra_float_digits = 0; CREATE TEMP TABLE u ( u unit ); -- empty SELECT sum(u) AS null_sum FROM u; SELECT min(u) AS null_min FROM u; SELECT max(u) AS null_max FROM u; SELECT avg(u) AS null_avg FROM u; SELECT var_pop(u) AS null_var_pop FROM u; SELECT var_samp(u) AS null_var_samp FROM u; SELECT variance(u) AS null_variance FROM u; SELECT stddev_pop(u) AS null_stddev_pop FROM u; SELECT stddev_samp(u) AS null_stddev_samp FROM u; SELECT stddev(u) AS null_stddev FROM u; -- one NULL row INSERT INTO u VALUES (NULL); SELECT sum(u) AS null_sum FROM u; SELECT min(u) AS null_min FROM u; SELECT max(u) AS null_max FROM u; SELECT avg(u) AS null_avg FROM u; SELECT var_pop(u) AS null_var_pop FROM u; SELECT var_samp(u) AS null_var_samp FROM u; SELECT variance(u) AS null_variance FROM u; SELECT stddev_pop(u) AS null_stddev_pop FROM u; SELECT stddev_samp(u) AS null_stddev_samp FROM u; SELECT stddev(u) AS null_stddev FROM u; -- one non-NULL row DELETE FROM u; INSERT INTO u VALUES (meter(5)); SELECT sum(u) AS five_meters FROM u; SELECT min(u) AS five_meters FROM u; SELECT max(u) AS five_meters FROM u; SELECT avg(u) AS five_meters FROM u; SELECT var_pop(u) AS zero_var_pop FROM u; SELECT var_samp(u) AS zero_var_samp FROM u; SELECT variance(u) AS zero_variance FROM u; SELECT stddev_pop(u) AS zero_stddev_pop FROM u; SELECT stddev_samp(u) AS zero_stddev_samp FROM u; SELECT stddev(u) AS zero_stddev FROM u; -- two rows, matching dimensions DELETE FROM u; INSERT INTO u VALUES (meter()), (meter(2)); SELECT sum(u) AS three_meters FROM u; SELECT min(u) AS one_meter FROM u; SELECT max(u) AS two_meters FROM u; SELECT avg(u) AS oneandhalf_meters FROM u; SELECT var_pop(u) FROM u; SELECT var_samp(u) FROM u; SELECT variance(u) FROM u; SELECT stddev_pop(u) FROM u; SELECT stddev_samp(u) FROM u; SELECT stddev(u) FROM u; DELETE FROM u; INSERT INTO u VALUES (kilogram(2)), (kilogram()); SELECT sum(u), sum(value(u)) FROM u; SELECT min(u), min(value(u)) FROM u; SELECT max(u), max(value(u)) FROM u; SELECT avg(u), avg(value(u)) FROM u; SELECT var_pop(u), var_pop(value(u)) FROM u; SELECT var_samp(u), var_samp(value(u)) FROM u; SELECT variance(u), variance(value(u)) FROM u; SELECT stddev_pop(u), stddev_pop(value(u)) FROM u; SELECT stddev_samp(u), stddev_samp(value(u)) FROM u; SELECT stddev(u), stddev(value(u)) FROM u; -- three rows, one NULL INSERT INTO u VALUES (NULL); SELECT sum(u) AS three_kilogram FROM u; SELECT min(u) AS one_kilogram FROM u; SELECT max(u) AS two_kilogram FROM u; SELECT avg(u) AS oneandhalf_kilogram FROM u; SELECT var_pop(u) FROM u; SELECT var_samp(u) FROM u; SELECT variance(u) FROM u; SELECT stddev_pop(u) FROM u; SELECT stddev_samp(u) FROM u; SELECT stddev(u) FROM u; -- two rows, dimension mismatch DELETE FROM u; INSERT INTO u VALUES (ampere()), (kilogram(2)); SELECT sum(u) AS error FROM u; SELECT min(u) AS error FROM u; SELECT max(u) AS error FROM u; SELECT avg(u) AS error FROM u; SELECT var_pop(u) AS error FROM u; SELECT var_samp(u) AS error FROM u; SELECT variance(u) AS error FROM u; SELECT stddev_pop(u) AS error FROM u; SELECT stddev_samp(u) AS error FROM u; SELECT stddev(u) AS error FROM u; postgresql-unit-7.8/sql/binary.sql000066400000000000000000000004751450213077700173700ustar00rootroot00000000000000SELECT unit_send('0'); SELECT unit_send(-'0'::unit); SELECT unit_send('1 m'::unit); SELECT unit_send('1 kg^-1'::unit); SELECT unit_send('1 s'::unit); SELECT unit_send('1 A^-1'::unit); SELECT unit_send('1 K'::unit); SELECT unit_send('1 mol^-1'::unit); SELECT unit_send('1 cd'::unit); SELECT unit_send('1 B^-1'::unit); postgresql-unit-7.8/sql/compare.sql000066400000000000000000000030741450213077700175300ustar00rootroot00000000000000-- test comparisons WITH v(u) AS (VALUES (NULL), ('-2'::unit), ('-1'::unit), ('-0'::unit), ('0'::unit), ('1'::unit), ('2'::unit), (meter()), (meter() * '2'), (kilogram()), (kilogram() * '2') ), va(a) AS (SELECT * FROM v), vb(b) AS (SELECT * FROM v) SELECT a, b, CASE WHEN unit_cmp(a, b) < 0 THEN '<' WHEN unit_cmp(a, b) = 0 THEN '=' WHEN unit_cmp(a, b) > 0 THEN '>' END AS cmp, a < b AS lt, a <= b AS le, a = b AS eq, a <> b AS ne, a >= b AS ge, a > b AS gt FROM va CROSS JOIN vb; -- test btree index CREATE TEMP TABLE u (u unit); INSERT INTO u SELECT meter(generate_series(1,10000)::double precision); INSERT INTO u SELECT generate_series(1,10000)::text::unit * kilogram(); ANALYZE u; CREATE INDEX ON u(u); SELECT * FROM u WHERE u = meter(400); SELECT * FROM u WHERE u = '300' * kilogram(); EXPLAIN (COSTS OFF) SELECT * FROM u WHERE u = meter(400); EXPLAIN (COSTS OFF) SELECT * FROM u WHERE u = '300' * kilogram(); -- test strict operators SELECT '1 m'::unit << '1 m'::unit; SELECT '1 m'::unit << '1 A'::unit; SELECT '1 m'::unit <<= '1 m'::unit; SELECT '1 m'::unit <<= '1 A'::unit; SELECT '1 m'::unit == '1 m'::unit; SELECT '1 m'::unit == '1 A'::unit; SELECT '1 m'::unit <<>> '1 m'::unit; SELECT '1 m'::unit <<>> '1 A'::unit; SELECT '1 m'::unit >>= '1 m'::unit; SELECT '1 m'::unit >>= '1 A'::unit; SELECT '1 m'::unit >> '1 m'::unit; SELECT '1 m'::unit >> '1 A'::unit; -- test range type SELECT 'empty'::unitrange; SELECT '(1 m, 2 m)'::unitrange; SELECT '(1 m, 2 A)'::unitrange; SELECT unit_diff('1 A', '2 A'); SELECT unit_diff('1 A', '2 K'); postgresql-unit-7.8/sql/convert.sql000066400000000000000000000021361450213077700175600ustar00rootroot00000000000000-- length WITH l(u) AS (VALUES ('mm'), ('m'), ('km'), ('in'), ('ft'), ('yd'), ('mi')) SELECT l1.u, l2.u, l1.u::unit @ l2.u FROM l l1 CROSS JOIN l l2 \crosstabview /* revert to pre-12 default */ SET extra_float_digits = 0; WITH l(u) AS (VALUES ('mm'), ('m'), ('km'), ('in'), ('ft'), ('yd'), ('mi')) SELECT l1.u, l2.u, l1.u::unit @@ l2.u FROM l l1 CROSS JOIN l l2 \crosstabview RESET extra_float_digits; -- area WITH l(u) AS (VALUES ('mm^2'), ('m^2'), ('km^2'), ('in^2'), ('ft^2'), ('yd^2'), ('mi^2')) SELECT l1.u, l2.u, l1.u::unit @ l2.u FROM l l1 CROSS JOIN l l2 \crosstabview -- volume WITH l(u) AS (VALUES ('mm^3'), ('l'), ('m^3'), ('in^3'), ('ft^3'), ('yd^3')) SELECT l1.u, l2.u, l1.u::unit @ l2.u FROM l l1 CROSS JOIN l l2 \crosstabview -- weight WITH l(u) AS (VALUES ('g'), ('kg'), ('t'), ('oz'), ('lb')) SELECT l1.u, l2.u, l1.u::unit @ l2.u FROM l l1 CROSS JOIN l l2 \crosstabview -- time WITH l(u) AS (VALUES ('s'), ('min'), ('hr'), ('d'), ('julianyear')) SELECT l1.u, l2.u, l1.u::unit @ l2.u FROM l l1 CROSS JOIN l l2 \crosstabview postgresql-unit-7.8/sql/crosstab.sql000066400000000000000000000033551450213077700177240ustar00rootroot00000000000000SET unit.time_output_custom = false; -- test multiplication WITH i(i) AS (VALUES ('-2'::unit), ('-1'), ('0'), ('1'), ('2')) SELECT unit, i, unit * i FROM units CROSS JOIN i WHERE (base OR coherent) AND NOT duplicate \crosstabview SELECT a.unit AS a, b.unit AS b, a.unit * b.unit AS mul FROM units AS a CROSS JOIN units AS b WHERE (a.base OR a.coherent) AND NOT a.duplicate AND (b.base OR b.coherent) AND NOT b.duplicate \crosstabview SELECT f, unit, f * unit FROM factors CROSS JOIN units WHERE (base OR coherent) AND NOT duplicate \crosstabview -- test division WITH i(i) AS (VALUES ('-2'::unit), ('-1'), ('1'), ('2')) SELECT unit, i, unit / i FROM units CROSS JOIN i WHERE (base OR coherent) AND NOT duplicate \crosstabview WITH i(i) AS (VALUES ('-2'::unit), ('-1'), ('0'), ('1'), ('2')) SELECT i, unit, i / unit FROM units CROSS JOIN i WHERE (base OR coherent) AND NOT duplicate \crosstabview SELECT a.unit AS a, b.unit AS b, a.unit / b.unit AS div FROM units AS a CROSS JOIN units AS b WHERE (a.base OR a.coherent) AND NOT a.duplicate AND (b.base OR b.coherent) AND NOT b.duplicate \crosstabview -- test comparisons WITH v(u) AS (VALUES ('-2'::unit), ('-1'::unit), (-kilogram()), (-meter()), ('-0'::unit), ('0'::unit), ('1'::unit), (kilogram()), (meter()), ('2'::unit), (kilogram(2)), (meter(2)) ), va(a) AS (SELECT * FROM v), vb(b) AS (SELECT * FROM v) SELECT a, b, CASE WHEN unit_cmp(a, b) < 0 THEN '<' WHEN unit_cmp(a, b) = 0 THEN '=' WHEN unit_cmp(a, b) > 0 THEN '>' END AS cmp FROM va CROSS JOIN vb \crosstabview -- test all prefix/unit combinations SELECT u, p, (p||u)::unit FROM prefixes CROSS JOIN units WHERE u <> 'kg' AND (p||u) <> 'dat' -- ambiguous \crosstabview postgresql-unit-7.8/sql/custom.sql000066400000000000000000000011751450213077700174140ustar00rootroot00000000000000SELECT '1 foobar'::unit; SELECT unit_is_hashed('foobar'); INSERT INTO unit_prefixes VALUES ('foo', 42); SELECT '1 foobar'::unit; SELECT unit_is_hashed('foobar'); SELECT * FROM unit_prefixes WHERE dump; INSERT INTO unit_units VALUES ('legobrick', '9.6 mm'); SELECT unit_is_hashed('legobricks'); SELECT '1 m'::unit @ 'legobricks' AS one_meter; SELECT unit_is_hashed('legobricks'); SELECT * FROM unit_units WHERE dump; UPDATE unit_units SET unit = '19.1 mm' WHERE name = 'legobrick'; -- Duplo size SELECT '2 legobricks'::unit AS old_size; SELECT unit_reset(); SELECT unit_is_hashed('legobricks'); SELECT '2 legobricks'::unit AS new_size; postgresql-unit-7.8/sql/derived.sql000066400000000000000000000037271450213077700175310ustar00rootroot00000000000000-- derived units SELECT radian(); SELECT steradian(); SELECT hertz(); SELECT newton(); SELECT pascal(); SELECT joule(); SELECT watt(); SELECT coulomb(); SELECT volt(); SELECT farad(); SELECT ohm(); SELECT siemens(); SELECT weber(); SELECT tesla(); SELECT henry(); SELECT celsius(); SELECT lumen(); SELECT lux(); SELECT becquerel(); SELECT gray(); SELECT sievert(); SELECT katal(); SELECT radian(2); SELECT steradian(2); SELECT hertz(2); SELECT newton(2); SELECT pascal(2); SELECT joule(2); SELECT watt(2); SELECT coulomb(2); SELECT volt(2); SELECT farad(2); SELECT ohm(2); SELECT siemens(2); SELECT weber(2); SELECT tesla(2); SELECT henry(2); SELECT celsius(100); SELECT lumen(2); SELECT lux(2); SELECT becquerel(2); SELECT gray(2); SELECT sievert(2); SELECT katal(2); /* revert to pre-12 default for decibel() tests */ SET extra_float_digits = 0; -- Non-SI units accepted for use with the SI SELECT minute(); SELECT hour(); SELECT day(); SELECT degree_arc(); SELECT minute_arc(); SELECT second_arc(); SELECT hectare(); SELECT liter(); SELECT tonne(); SELECT au(); SELECT decibel(); SELECT minute(60); SELECT hour(24); SELECT day(1/24.0); SELECT degree_arc(360); SELECT minute_arc(60); SELECT second_arc(60); SELECT hectare(1/100.0); SELECT liter(1000); SELECT tonne(1/1000.0); SELECT au(10); SELECT decibel(-3); SELECT decibel(3); SELECT decibel(10); SELECT decibel(20); SET client_min_messages = warning; DROP TABLE IF EXISTS u; RESET client_min_messages; CREATE TABLE u AS SELECT unit AS u, 2000 * unit AS "2k", unit/5000 AS "200µ", 0.002/unit AS "500th_inverse", (40*unit)^2 AS "1600_square" FROM units WHERE base OR coherent; SELECT * FROM u; SELECT u, u::text::unit AS "text::unit", "2k"::text::unit, "200µ"::text::unit, "500th_inverse"::text::unit, "1600_square"::text::unit FROM u; -- test i/o SELECT a.u, b.u, (a.u::unit*b.u::unit)::text, (a.u::unit*b.u::unit)::text::unit FROM units a CROSS JOIN units b WHERE (a.u::unit*b.u::unit)::text != (a.u::unit*b.u::unit)::text::unit::text; postgresql-unit-7.8/sql/extension.sql000066400000000000000000000001431450213077700201100ustar00rootroot00000000000000SET client_min_messages = warning; CREATE EXTENSION IF NOT EXISTS unit; RESET client_min_messages; postgresql-unit-7.8/sql/functions.sql000066400000000000000000000051601450213077700201100ustar00rootroot00000000000000-- test functions SELECT value('2'::unit); SELECT value(meter(2)); SELECT dimension('2'::unit); SELECT dimension(kilogram(2)); -- test unit addition/subtraction SELECT '1'::unit + '2' AS sum; SELECT '1'::unit - '2' AS difference; SELECT '3 m'::unit - '1 µm' AS difference; SELECT '0' + meter() AS error; SELECT meter() + '0' AS error; SELECT meter() + kilogram() AS error; SELECT meter() - kilogram() AS error; -- test unit multiplication/division SELECT - '1'::unit AS negative; SELECT '2'::unit * '2' AS product; SELECT '5'::unit / '2' AS fraction; SELECT '0'::unit / '2' AS zero; SELECT '5'::unit / '0' AS division_by_zero; SELECT - second() AS minus_second; SELECT meter() * '2' AS two_meters; SELECT '3' * meter() AS three_meters; SELECT meter() * meter() AS square_meter; SELECT meter() * kilogram() AS meter_kilogram; SELECT '1' / second(.02) AS hertz; SELECT meter(9.81) / (second() * second()) AS acceleration; -- test unit/double operators SELECT 2 * meter() AS two_meters; SELECT ampere() * 3 AS three_ampere; SELECT 4 / second() AS four_hertz; SELECT kelvin(10) / 5 AS two_kelvin; SELECT 0 / candela() AS zero_by_candela; SELECT 1 / mole(0) AS error; SELECT byte(0) / 2 AS zero_byte; SELECT kilogram(1) / 0 AS error; -- test exponentiation SELECT '6'::unit ^ 2 AS square; SELECT meter(100) ^ 2 AS square_meter; SELECT kilogram(100) ^ 2 AS square_kilogram; SELECT second(.02) ^ -1 AS hertz; SELECT ampere(4) ^ 0 AS unity; SELECT '0'::unit ^ 0 AS unity; -- test roots SELECT sqrt('4'::unit); SELECT sqrt('4 m^2'::unit); SELECT |/'16 s^-4'::unit; SELECT sqrt('-4 m^2'::unit) AS error; SELECT sqrt('4 m'::unit) AS error; SELECT cbrt('8'::unit); SELECT cbrt('8 m^3'::unit); SELECT ||/'-27 s^-6'::unit; SELECT cbrt('-4 m'::unit) AS error; WITH v(u) AS (VALUES (NULL), ('0'::unit), ('1'::unit), ('2'::unit), (meter(0)), (meter()), (meter() * '2'), (kilogram(0)), (kilogram()), (kilogram() * '2') ), va(a) AS (SELECT * FROM v), vb(b) AS (SELECT * FROM v) SELECT a, b, -a AS neg, a * b AS mul, CASE WHEN value(b) = 0 THEN NULL ELSE a / b END AS div FROM va CROSS JOIN vb; WITH v(a) AS (VALUES (NULL), ('1'::unit), ('2'::unit), (meter()), (meter() * '2'), (kilogram()), (kilogram() * '2') ) SELECT a, a ^ -2 AS pow_2, a ^ -1 AS pow_1, a ^ 0 AS pow0, a ^ 1 AS pow1, a ^ 2 AS pow2 FROM v; -- test conversion SELECT '1m'::unit @ 'mm'; SELECT '10g'::unit @ 'mg'; SELECT '5dm^3'::unit @ 'l'; SELECT '9.81 m/s^2'::unit @ 'N/kg', '9.81 m/s^2'::unit @@ 'N/kg'; SELECT '16384 B'::unit @ '8192 B', '16384 B'::unit @@ '8192 B'; SELECT '1 hl'::unit @ '0.5 l'; SELECT '5MB/min'::unit @ 'GB/d'; SELECT '5m'::unit @ 's' AS error; postgresql-unit-7.8/sql/iec.sql000066400000000000000000000026261450213077700166440ustar00rootroot00000000000000VALUES ('1 mB'::unit), ('1 B'::unit), ('1 KiB'::unit), ('1 MiB'::unit), ('1 GiB'::unit), ('1 TiB'::unit), ('1 PiB'::unit), ('1 EiB'::unit), ('1 ZiB'::unit), ('1 YiB'::unit), ('1 RiB'::unit), ('1 QiB'::unit); VALUES ('1 B'::unit @ 'B'), ('1 KiB'::unit @ 'KiB'), ('1 MiB'::unit @ 'MiB'), ('1 GiB'::unit @ 'GiB'), ('1 TiB'::unit @ 'TiB'), ('1 PiB'::unit @ 'PiB'), ('1 EiB'::unit @ 'EiB'), ('1 ZiB'::unit @ 'ZiB'), ('1 YiB'::unit @ 'YiB'), ('1 RiB'::unit @ 'RiB'), ('1 QiB'::unit @ 'QiB'); VALUES ('1 B'::unit @ 'B'), ('1 kB'::unit @ 'KiB'), ('1 MB'::unit @ 'MiB'), ('1 GB'::unit @ 'GiB'), ('1 TB'::unit @ 'TiB'), ('1 PB'::unit @ 'PiB'), ('1 EB'::unit @ 'EiB'), ('1 ZB'::unit @ 'ZiB'), ('1 YB'::unit @ 'YiB'), ('1 RB'::unit @ 'RiB'), ('1 QB'::unit @ 'QiB'); -- errors SELECT '1 kiB'::unit; SELECT '1 Ki'::unit; -- used to be an error in v2 SELECT '1 Kim'::unit AS "1024 m"; -- binary prefix output SET unit.byte_output_iec = 'foobar'; SET unit.byte_output_iec = on; VALUES ('.001 B'::unit, '.001 B'::unit), ('1 B'::unit, '1 B'::unit), ('1 KiB'::unit, '1 kB'::unit), ('1 MiB'::unit, '1 MB'::unit), ('1 GiB'::unit, '1 GB'::unit), ('1 TiB'::unit, '1 TB'::unit), ('1 PiB'::unit, '1 PB'::unit), ('1 EiB'::unit, '1 EB'::unit), ('1 ZiB'::unit, '1 ZB'::unit), ('1 YiB'::unit, '1 YB'::unit), ('1 RiB'::unit, '1 RB'::unit), ('1 QiB'::unit, '1 QB'::unit), ('1024 QiB'::unit, '1000 QB'::unit); postgresql-unit-7.8/sql/language_functions.sql000066400000000000000000000005211450213077700217470ustar00rootroot00000000000000select 'sqrt(4 m^2)'::unit; select 'sqrt(-4 m^2)'::unit; select 'sqrt(4 m^3)'::unit; select 'exp(1)'::unit; select 'exp(1 A)'::unit; select 'ln(2.7)'::unit; select 'ln(-2.7)'::unit; select 'ln(2.7 s)'::unit; select 'asin(1)'::unit; select 'asin(2)'::unit; select 'asin(1 kg)'::unit; select 'tan(1)'::unit; select 'tan(1 mol)'::unit; postgresql-unit-7.8/sql/prefix.sql000066400000000000000000000005041450213077700173720ustar00rootroot00000000000000SELECT f, meter(f), kilogram(f) FROM factors; SELECT p, (p||'m/m')::unit AS factor, ('0.001 '||p||'m')::unit AS "0.001 m", (p||'m')::unit AS "meter", ('1000 '||p||'m')::unit AS "1000 m", ('0.001 '||p||'g')::unit AS "0.001 g", (p||'g')::unit AS "gram", ('1000 '||p||'g')::unit AS "1000 g" FROM prefixes; postgresql-unit-7.8/sql/round.sql000066400000000000000000000010351450213077700172240ustar00rootroot00000000000000SELECT round(ampere(1.5)); SELECT round(candela(-0.5)); SELECT round(meter(1500.5)); SET extra_float_digits = 0; SELECT '1|3m'::unit, '25m'::unit @ 'ft', '25m'::unit @@ 'ft'; SET extra_float_digits = 3; SELECT '1|3m'::unit, '25m'::unit @ 'ft', '25m'::unit @@ 'ft'; SET extra_float_digits = -3; SELECT '1|3m'::unit, '25m'::unit @ 'ft', '25m'::unit @@ 'ft'; SET extra_float_digits = -12; SELECT '1|3m'::unit, '25m'::unit @ 'ft', '25m'::unit @@ 'ft'; SET extra_float_digits = -15; SELECT '1|3m'::unit, '25m'::unit @ 'ft', '25m'::unit @@ 'ft'; postgresql-unit-7.8/sql/tables.sql000066400000000000000000000026171450213077700173560ustar00rootroot00000000000000SET client_min_messages = warning; DROP TABLE IF EXISTS prefixes; CREATE TABLE prefixes (p text); DELETE FROM prefixes; INSERT INTO prefixes VALUES ('q'),('r'),('y'),('z'),('a'),('f'),('p'),('n'),('µ'),('mu'),('m'),('c'),('d'), (''), ('da'),('h'),('k'),('M'),('G'),('T'),('P'),('E'),('Z'),('Y'),('R'),('Q'); DROP TABLE IF EXISTS factors; CREATE TABLE factors (f double precision); DELETE FROM factors; INSERT INTO factors VALUES (1e33), (1e30), (1e27), (1e24), (1e21), (1e18), (1e15), (1e12), (1e9), (1e6), (1e3), (1), (1e-3), (1e-6), (1e-9), (1e-12), (1e-15), (1e-18), (1e-21), (1e-24), (1e-27), (1e-30), (1e-33), (1e-36), (0); DROP TABLE IF EXISTS units; CREATE TABLE units (u text, unit unit, base boolean, coherent boolean, duplicate boolean); COMMENT ON COLUMN units.duplicate IS 'For coherent units, this unit has the same dimension as some other base or coherent unit'; DELETE FROM units; COPY units (u, base, coherent, duplicate) FROM STDIN; m/m t f f m t f f kg t f f s t f f A t f f K t f f mol t f f cd t f f B t f f sr f t t Hz f t f N f t f Pa f t f J f t f W f t f C f t f V f t f F f t f Ω f t f ohm f t t S f t f Wb f t f T f t f H f t f °C f t t lm f t t lx f t f Bq f t t Gy f t f rad f f t Sv f t t kat f t f g f f t a f f f l f f f t f f f bar f f f min f f f hr f f f d f f f in f f f ft f f f yd f f f mi f f f oz f f f lb f f f \. UPDATE units SET unit = u::unit; SELECT * FROM units; postgresql-unit-7.8/sql/temperature.sql000066400000000000000000000030201450213077700204260ustar00rootroot00000000000000/* revert to pre-12 default */ SET extra_float_digits = 0; SELECT * FROM unit_units WHERE name IN ( 'K', 'kelvin', '℃', '°C', 'degC', 'degcelsius', '℉', '°F', 'degF', 'degfahrenheit', '°R', 'degR', 'degrankine', 'degreerankine', 'degreesrankine', 'tempR', 'temprankine', 'degreaumur') ORDER BY name COLLATE "C"; RESET extra_float_digits; -- Kelvin SELECT '0 K'::unit, 'K'::unit, '1 K'::unit, '273.15 K'::unit; -- Celsius SELECT '-273.15 ℃'::unit, '0 ℃'::unit, '1 ℃'::unit, '℃'::unit; SELECT '-273.15 °C'::unit, '0 °C'::unit, '1 °C'::unit, '°C'::unit; SELECT '-273.15 degC'::unit, '0 degC'::unit, '1 degC'::unit, 'degC'::unit; SELECT '-273.15 degcelsius'::unit, '0 degcelsius'::unit, '1 degcelsius'::unit, 'degcelsius'::unit; -- Fahrenheit SELECT '-459.67 ℉'::unit, '0 ℉'::unit, '1 ℉'::unit, '℉'::unit; SELECT '-459.67 °F'::unit, '0 °F'::unit, '1 °F'::unit, '°F'::unit; SELECT '-459.67 degF'::unit, '0 degF'::unit, '1 degF'::unit, 'degF'::unit; SELECT '-459.67 degfahrenheit'::unit, '0 degfahrenheit'::unit, '1 degfahrenheit'::unit, 'degfahrenheit'::unit; -- Rankine SELECT '491.67 degR'::unit, '0 degR'::unit, '1 degR'::unit, 'degR'::unit; -- Réaumur SELECT '-218.52 degreaumur'::unit, '0 degreaumur'::unit, '1 degreaumur'::unit, 'degreaumur'::unit; SELECT '0 K'::unit @ 'K', '0 K'::unit @ '°C', '0 K'::unit @ '°F', '0 K'::unit @ '°R', '0 K'::unit @ 'degreaumur'; SELECT '273.15 K'::unit @ 'K', '273.15 K'::unit @ '°C', '273.15 K'::unit @ '°F', '273.15 K'::unit @ '°R', '273.15 K'::unit @ 'degreaumur'; postgresql-unit-7.8/sql/time.sql000066400000000000000000000024301450213077700170330ustar00rootroot00000000000000SELECT '1.1 s'::unit; SELECT '61.1 s'::unit; SELECT '71.1 s'::unit; SELECT '601 s'::unit; SELECT '3601 s'::unit; SELECT '86400 s'::unit; SELECT '-86400 s'::unit; SELECT '86401 s'::unit; SELECT '-86401 s'::unit; SELECT '365 d'::unit; SELECT '-365 d'::unit; SELECT '3650 d'::unit; SELECT '3651 d'::unit; SELECT '3651.5 d'::unit; SELECT '00:00:00.1'::unit; SELECT '00:00:01'::unit; SELECT '00:01:00'::unit; SELECT '01:00:00'::unit; SELECT '0:0:0'::unit; SELECT '00:00:01 s'::unit; SELECT '00:00:01s'::unit; SELECT '00:00:01 m'::unit; SELECT '00:01:00 s'::unit; SELECT '00:01:00.5 s'::unit; SELECT '01:00:00 s'::unit; SELECT '1 d + 02:03:04.5 s'::unit; SELECT '1.1 d'::unit; -- needs ULP clamping SELECT name, unit, definition FROM unit_units WHERE dimension(unit) = 'TIME' ORDER BY unit, name COLLATE "C"; -- units that differ when pushed through output-input functions -- (same test as in units.sql, but with time_output_custom = true) SELECT name, unit, unit::text::unit, definition FROM unit_units WHERE unit::text::unit::text <> unit::text; /* custom time format is only used if dimension is time */ SELECT '1000 s'::unit, '1000 s/m'::unit; SET unit.time_output_custom = false; SELECT '1000 s'::unit, '1000 s/m'::unit; -- test if 'Gs' is avoided on output SELECT '1 Gsec'::unit, '1 Gsec/m'::unit; postgresql-unit-7.8/sql/unicode.sql000066400000000000000000000005261450213077700175270ustar00rootroot00000000000000SET unit.output_superscript = on; SELECT 'm⁰'::unit; SELECT 'm¹'::unit; SELECT 'm²'::unit; SELECT 'm⁻²'::unit; SELECT 'm³'::unit; SELECT 'm⁴'::unit; SELECT 'm⁵'::unit; SELECT 'm⁶'::unit; SELECT 'm⁷'::unit; SELECT 'm⁸'::unit; SELECT 'm⁹'::unit; SELECT 'm³⁴'::unit; SELECT 'm⁻⁵⁶'::unit; SELECT 'm⁺⁷⁸'::unit; postgresql-unit-7.8/sql/unit.sql000066400000000000000000000060101450213077700170520ustar00rootroot00000000000000-- test input and output SELECT '1'::unit; -- unit_in SELECT unit(1); -- dbl2unit CREATE TEMP TABLE u (u unit); INSERT INTO u VALUES ('1'); SELECT * FROM u; -- test constructors SELECT meter(); SELECT meter(2.0) AS two_meters; SELECT kilogram(); SELECT kilogram(3.0) AS three_kilogram; SELECT second(); SELECT second(4.0) AS four_seconds; SELECT ampere(); SELECT ampere(5.0) AS five_ampere; SELECT kelvin(); SELECT kelvin(6.0) AS six_kelvin; SELECT mole(); SELECT mole(7.0) AS seven_mole; SELECT candela(); SELECT candela(8.0) AS eight_candela; SELECT byte(); SELECT byte(9.0) AS nine_byte; -- test dimensionless scales SELECT unit(0) AS zero, unit(1e-6) AS "1e-6", unit(0.001) AS "0.001", unit(1.0) AS "1", unit(1000.0) AS "1000"; -- test SI prefixes SELECT meter(0) AS zero, meter(1e-6) AS "µm", meter(0.001) AS mm, meter(1.0) AS m, meter(1000.0) AS km; SELECT kilogram(0) AS zero, kilogram(1e-6) AS mg, kilogram(0.001) AS g, kilogram(1.0) AS kg, kilogram(1000.0) AS "Mg"; -- test combined units (exactly one unit with exponent 1 in numerator) SELECT meter(0)/second() AS zero, meter(1e-6)/second() AS "µm", meter(0.001)/second() AS mm, meter(1.0)/second() AS m, meter(1000.0)/second() AS km; SELECT kilogram(0)/second() AS zero, kilogram(1e-6)/second() AS mg, kilogram(0.001)/second() AS g, kilogram(1.0)/second() AS kg, kilogram(1000.0)/second() AS "Mg"; -- test parser SELECT '1 m'::unit; SELECT '-1 m/s'::unit; SELECT '10 dm^3'::unit, '10l'::unit; SELECT '9.81 kg*m/s^2'::unit, '9.81 kg*m/s*s'::unit, '9.81 kg*m/s/s'::unit; SELECT '1 foobar'::unit AS error; -- special values SELECT '-0'::unit, -'0'::unit, '-0 m'::unit, -'0 m'::unit; SELECT 'infinity'::unit, 'Infinity m'::unit, 'inf A'::unit; SELECT '-infinity'::unit, '-Infinity m'::unit, 'Inf A'::unit; SELECT 'nan'::unit, 'NaN'::unit; -- test parser arithmetic SELECT '1|10'::unit, '1|10 m'::unit; SELECT '2 m + 3 m - 4 m'::unit, '6 m - 3 m - 2 m'::unit, '6 m - 3 m + 1 m'::unit; SELECT '2 m * 3 m'::unit, '2 m / 3 m'::unit, '10 m / 5 m / 2 m'::unit; SELECT '2 m^2 + 3 m * 4 m'::unit, '2 m * 3 m / 4 m * 5 m'::unit; SELECT '2 m * (1 m + 3 m)'::unit; SELECT '- m'::unit, '/ m'::unit; SELECT '4+5'::unit, '4-5'::unit, '4(-5)'::unit, '4*5'::unit, '4/5'::unit; -- problematic cases SELECT '1 cd'::unit AS candela; -- candela vs centiday SELECT '1 Pa'::unit AS pascal; -- pascal vs petayear SELECT '1 yg'::unit AS yoctogram, '1.00001 yg'::unit AS actual_yoctogram; -- "yg" had rounding problems in the past SELECT '1 min'::unit AS minute; -- minute vs milliinch SELECT '1 ft'::unit AS foot; -- foot vs femtotonne SELECT '1 yd'::unit AS yard; -- yard vs yoctoday -- units whose definition changed between v2 and 3 SELECT 'a'::unit AS are; SELECT 'da'::unit AS day; SELECT 'rad'::unit AS radiation; -- check which prefix/unit combinations produce other dimensions (parser conflicts) SELECT p, u, (p||u)::unit FROM prefixes CROSS JOIN units WHERE u <> 'kg' AND dimension(u::unit) != dimension((p||u)::unit) AND p||u NOT IN ('dat') -- skip ambiguous unit ORDER BY lower(p) COLLATE "C", lower(u) COLLATE "C"; postgresql-unit-7.8/sql/units.sql000066400000000000000000000030201450213077700172330ustar00rootroot00000000000000SET unit.time_output_custom = false; /* revert to pre-12 default */ SET extra_float_digits = 0; SELECT prefix, factor, definition FROM unit_prefixes ORDER BY factor, prefix COLLATE "C"; RESET extra_float_digits; SELECT name, unit, definition FROM unit_units ORDER BY dimension(unit), unit, name COLLATE "C"; -- units that do not conform to their original definition SELECT name, unit, definition, definition::unit AS parsed_definition, unit / definition::unit AS deviation FROM unit_units WHERE unit <> definition::unit; -- units that differ when pushed through output-input functions SELECT name, unit, unit::text::unit, definition FROM unit_units WHERE unit::text::unit::text <> unit::text; -- prefix-unit combinations that are ambiguous /* CREATE FUNCTION valid_unit(u text) RETURNS boolean LANGUAGE plpgsql AS $$ BEGIN PERFORM u::unit; RETURN true; EXCEPTION WHEN OTHERS THEN RETURN false; END; $$; -- takes about 5min to run with cold cache, and about 3s with the hash table filled SELECT prefix||name AS unit, prefix, name FROM unit_prefixes CROSS JOIN unit_units WHERE NOT valid_unit(prefix||name) ORDER BY prefix||name, prefix; */ SELECT 'daA'::unit; -- ambiguous in original definitions.units SELECT 'dasb'::unit; SELECT 'dat'::unit; SELECT 'dau'::unit; SELECT 'daustbl'::unit; SELECT 'daustblsp'::unit; SELECT 'daustbsp'::unit; SELECT 'daustsp'::unit; SELECT 'Eint'::unit; SELECT 'Gint'::unit; SELECT 'Mint'::unit; SELECT 'Pint'::unit; SELECT 'Tint'::unit; SELECT 'Yint'::unit; SELECT 'yoctodecillion'::unit; SELECT 'Zint'::unit; postgresql-unit-7.8/sql/upgrade.sql000066400000000000000000000033651450213077700175340ustar00rootroot00000000000000-- version 1 SET client_min_messages = warning; DROP EXTENSION IF EXISTS unit CASCADE; CREATE TABLE IF NOT EXISTS pg_depend_save (LIKE pg_depend); RESET client_min_messages; \set pg_depend_save 'BEGIN; DELETE FROM pg_depend_save; WITH ext AS (DELETE FROM pg_depend WHERE refobjid = (SELECT oid FROM pg_extension WHERE extname = $$unit$$) RETURNING *) INSERT INTO pg_depend_save SELECT * FROM ext; COMMIT;' \set pg_depend_restore 'INSERT INTO pg_depend SELECT * FROM pg_depend_save;' CREATE EXTENSION unit VERSION "1"; :pg_depend_save \! pg_dump -f unit-1.dump -T pg_depend_save :pg_depend_restore -- upgrade to version 2 ALTER EXTENSION unit UPDATE TO "2"; :pg_depend_save \! pg_dump -f unit-1-2.dump -T pg_depend_save :pg_depend_restore -- upgrade to version 3 ALTER EXTENSION unit UPDATE TO "3"; :pg_depend_save \! pg_dump -f unit-2-3.dump -T pg_depend_save :pg_depend_restore -- upgrade to version 4 ALTER EXTENSION unit UPDATE TO "4"; :pg_depend_save \! pg_dump -f unit-3-4.dump -T pg_depend_save :pg_depend_restore -- upgrade to version 5 ALTER EXTENSION unit UPDATE TO "5"; :pg_depend_save \! pg_dump -f unit-4-5.dump -T pg_depend_save :pg_depend_restore -- upgrade to version 6 ALTER EXTENSION unit UPDATE TO "6"; :pg_depend_save \! pg_dump -f unit-5-6.dump -T pg_depend_save :pg_depend_restore -- upgrade to version 7 ALTER EXTENSION unit UPDATE TO "7"; :pg_depend_save \! pg_dump -f unit-6-7.dump -T pg_depend_save :pg_depend_restore -- reinstall latest version DROP EXTENSION unit CASCADE; CREATE EXTENSION unit; :pg_depend_save \! pg_dump -f unit-create.dump -T pg_depend_save :pg_depend_restore -- different ordering in unit_accum_t expected: \! diff -u --label unit-update.dump unit-6-7.dump --label unit-create.dump unit-create.dump | sed -e 's/@@.*@@/@@/' postgresql-unit-7.8/unit--1--2.sql000066400000000000000000000041011450213077700167010ustar00rootroot00000000000000ALTER TYPE unit_accum_t ADD ATTRIBUTE squares double precision; CREATE FUNCTION unit_accum(a unit_accum_t, u unit) RETURNS unit_accum_t AS $$SELECT (CASE WHEN a.s = '0'::unit THEN u ELSE a.s + u END, a.squares + value(u)^2, a.n + 1)::unit_accum_t$$ LANGUAGE SQL IMMUTABLE STRICT; -- update v1 avg() aggregate UPDATE pg_aggregate SET agginitval = '(0,0,0)' WHERE aggtransfn = 'unit_accum'::regproc AND agginitval = '(0,0)'; CREATE FUNCTION unit_var_pop(a unit_accum_t) RETURNS double precision AS $$SELECT CASE WHEN a.n > 0 THEN (a.squares - value(a.s)^2 / a.n) / a.n ELSE NULL END$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE AGGREGATE var_pop(unit) ( sfunc = unit_accum, stype = unit_accum_t, finalfunc = unit_var_pop, initcond = '(0,0,0)' ); CREATE FUNCTION unit_var_samp(a unit_accum_t) RETURNS double precision AS $$SELECT CASE WHEN a.n > 1 THEN (a.squares - value(a.s)^2 / a.n) / (a.n - 1) WHEN a.n = 1 THEN 0 ELSE NULL END$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE AGGREGATE var_samp(unit) ( sfunc = unit_accum, stype = unit_accum_t, finalfunc = unit_var_samp, initcond = '(0,0,0)' ); CREATE AGGREGATE variance(unit) ( sfunc = unit_accum, stype = unit_accum_t, finalfunc = unit_var_samp, initcond = '(0,0,0)' ); CREATE FUNCTION unit_stddev_pop(a unit_accum_t) RETURNS unit AS $$SELECT CASE WHEN a.n > 0 THEN sqrt((a.squares - value(a.s)^2 / a.n) / a.n) * dimension(a.s) ELSE NULL END$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE AGGREGATE stddev_pop(unit) ( sfunc = unit_accum, stype = unit_accum_t, finalfunc = unit_stddev_pop, initcond = '(0,0,0)' ); CREATE FUNCTION unit_stddev_samp(a unit_accum_t) RETURNS unit AS $$SELECT CASE WHEN a.n > 1 THEN sqrt((a.squares - value(a.s)^2 / a.n) / (a.n - 1)) * dimension(a.s) WHEN a.n = 1 THEN 0 * dimension(a.s) ELSE NULL END$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE AGGREGATE stddev_samp(unit) ( sfunc = unit_accum, stype = unit_accum_t, finalfunc = unit_stddev_samp, initcond = '(0,0,0)' ); CREATE AGGREGATE stddev(unit) ( sfunc = unit_accum, stype = unit_accum_t, finalfunc = unit_stddev_samp, initcond = '(0,0,0)' ); postgresql-unit-7.8/unit--1.sql000066400000000000000000000300641450213077700164740ustar00rootroot00000000000000/* Copyright (C) 2016 Christoph Berg This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ -- type definition CREATE TYPE unit; CREATE FUNCTION unit_in(cstring) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_out(unit) RETURNS cstring AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE TYPE unit ( internallength = 16, input = unit_in, output = unit_out, alignment = double ); -- constructors CREATE FUNCTION unit(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'dbl2unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION meter(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_meter' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION kilogram(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_kilogram' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION second(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_second' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION ampere(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_ampere' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION kelvin(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_kelvin' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION mole(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_mole' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION candela(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_candela' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION byte(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_byte' LANGUAGE C IMMUTABLE STRICT; -- extractors CREATE FUNCTION value(unit) RETURNS double precision AS '$libdir/unit', 'unit_value' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION dimension(unit) RETURNS unit AS '$libdir/unit', 'unit_dimension' LANGUAGE C IMMUTABLE STRICT; -- operators CREATE FUNCTION unit_add(unit, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR + ( leftarg = unit, rightarg = unit, procedure = unit_add, commutator = + ); CREATE FUNCTION unit_sub(unit, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR - ( leftarg = unit, rightarg = unit, procedure = unit_sub ); CREATE FUNCTION unit_neg(unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR - ( rightarg = unit, procedure = unit_neg ); CREATE FUNCTION unit_mul(unit, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR * ( leftarg = unit, rightarg = unit, procedure = unit_mul, commutator = * ); CREATE FUNCTION dbl_unit_mul(double precision, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR * ( leftarg = double precision, rightarg = unit, procedure = dbl_unit_mul, commutator = * ); CREATE FUNCTION unit_dbl_mul(unit, double precision) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR * ( leftarg = unit, rightarg = double precision, procedure = unit_dbl_mul, commutator = * ); CREATE FUNCTION unit_div(unit, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR / ( leftarg = unit, rightarg = unit, procedure = unit_div ); CREATE FUNCTION dbl_unit_div(double precision, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR / ( leftarg = double precision, rightarg = unit, procedure = dbl_unit_div ); CREATE FUNCTION unit_dbl_div(unit, double precision) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR / ( leftarg = unit, rightarg = double precision, procedure = unit_dbl_div ); CREATE FUNCTION unit_pow(unit, int) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR ^ ( leftarg = unit, rightarg = int, procedure = unit_pow ); CREATE FUNCTION unit_at(unit, cstring) RETURNS cstring AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR @ ( leftarg = unit, rightarg = cstring, procedure = unit_at ); -- derived units CREATE FUNCTION radian (double precision DEFAULT 1.0) -- m·m^-1 RETURNS unit AS $$SELECT meter($1) / meter()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION steradian (double precision DEFAULT 1.0) -- m^2·m^-2 RETURNS unit AS $$SELECT meter($1) * meter() / meter()^2$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION hertz (double precision DEFAULT 1.0) -- s^-1 RETURNS unit AS $$SELECT $1 / second()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION newton (double precision DEFAULT 1.0) -- kg·m·s^-2 RETURNS unit AS $$SELECT kilogram($1) * meter() / second()^2$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION pascal (double precision DEFAULT 1.0) -- N/m^2 RETURNS unit AS $$SELECT newton($1) / meter()^2 $$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION joule (double precision DEFAULT 1.0) -- N·m RETURNS unit AS $$SELECT newton($1) * meter()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION watt (double precision DEFAULT 1.0) -- J/s RETURNS unit AS $$SELECT joule($1) / second()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION coulomb (double precision DEFAULT 1.0) -- A·s RETURNS unit AS $$SELECT ampere($1) * second()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION volt (double precision DEFAULT 1.0) -- W/A RETURNS unit AS $$SELECT watt($1) / ampere() $$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION farad (double precision DEFAULT 1.0) -- C/V RETURNS unit AS $$SELECT coulomb($1) / volt() $$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION ohm (double precision DEFAULT 1.0) -- V/A RETURNS unit AS $$SELECT volt($1) / ampere() $$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION siemens (double precision DEFAULT 1.0) -- A/V RETURNS unit AS $$SELECT ampere($1) / volt()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION weber (double precision DEFAULT 1.0) -- V·s RETURNS unit AS $$SELECT volt($1) * second()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION tesla (double precision DEFAULT 1.0) -- Wb/m^2 RETURNS unit AS $$SELECT weber($1) / meter()^2$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION henry (double precision DEFAULT 1.0) -- Wb/A RETURNS unit AS $$SELECT weber($1) / ampere()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION celsius (double precision DEFAULT 0.0) -- K relative to 273.15, default to 0°C RETURNS unit AS $$SELECT kelvin($1 + 273.15)$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION lumen (double precision DEFAULT 1.0) -- cd·sr RETURNS unit AS $$SELECT candela($1) * steradian()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION lux (double precision DEFAULT 1.0) -- lm/m^2 RETURNS unit AS $$SELECT lumen($1) / meter()^2$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION becquerel (double precision DEFAULT 1.0) -- s^-1 RETURNS unit AS $$SELECT $1 / second()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION gray (double precision DEFAULT 1.0) -- J/kg RETURNS unit AS $$SELECT joule($1) / kilogram()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION sievert (double precision DEFAULT 1.0) -- J/kg RETURNS unit AS $$SELECT joule($1)/ kilogram()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION katal (double precision DEFAULT 1.0) -- mol·s^-1 RETURNS unit AS $$SELECT mole($1) / second()$$ LANGUAGE SQL IMMUTABLE STRICT; -- Non-SI units accepted for use with the SI --minute, hour, day, degree of arc, minute of arc, second of arc, hectare, litre, tonne, astronomical unit and [deci]bel CREATE FUNCTION minute (double precision DEFAULT 1.0) RETURNS unit AS $$SELECT second($1 * 60)$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION hour (double precision DEFAULT 1.0) RETURNS unit AS $$SELECT second($1 * 3600)$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION day (double precision DEFAULT 1.0) RETURNS unit AS $$SELECT second($1 * 86400)$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION degree_arc(double precision DEFAULT 1.0) RETURNS unit AS $$SELECT $1 * '1'::unit * pi() / 180$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION minute_arc(double precision DEFAULT 1.0) RETURNS unit AS $$SELECT $1 * '1'::unit * pi() / 180 / 60$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION second_arc(double precision DEFAULT 1.0) RETURNS unit AS $$SELECT $1 * '1'::unit * pi() / 180 / 3600$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION hectare (double precision DEFAULT 1.0) RETURNS unit AS $$SELECT $1 * meter(100)^2$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION liter (double precision DEFAULT 1.0) RETURNS unit AS $$SELECT $1 * meter(0.1)^3$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION tonne (double precision DEFAULT 1.0) RETURNS unit AS $$SELECT kilogram($1 * 1000)$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION au (double precision DEFAULT 1.0) RETURNS unit AS $$SELECT meter($1 * 149597870700)$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION decibel (double precision DEFAULT 0.0) RETURNS double precision AS $$SELECT 10.0^($1 / 10.0)$$ LANGUAGE SQL IMMUTABLE STRICT; -- comparisons CREATE FUNCTION unit_lt(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_le(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_eq(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_ne(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_ge(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_gt(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR < ( leftarg = unit, rightarg = unit, procedure = unit_lt, commutator = > , negator = >= , restrict = scalarltsel, join = scalarltjoinsel ); CREATE OPERATOR <= ( leftarg = unit, rightarg = unit, procedure = unit_le, commutator = >= , negator = > , restrict = scalarltsel, join = scalarltjoinsel ); CREATE OPERATOR = ( leftarg = unit, rightarg = unit, procedure = unit_eq, commutator = = , negator = <> , restrict = eqsel, join = eqjoinsel ); CREATE OPERATOR <> ( leftarg = unit, rightarg = unit, procedure = unit_ne, commutator = <> , negator = = , restrict = neqsel, join = neqjoinsel ); CREATE OPERATOR >= ( leftarg = unit, rightarg = unit, procedure = unit_ge, commutator = <= , negator = < , restrict = scalargtsel, join = scalargtjoinsel ); CREATE OPERATOR > ( leftarg = unit, rightarg = unit, procedure = unit_gt, commutator = < , negator = <= , restrict = scalargtsel, join = scalargtjoinsel ); CREATE FUNCTION unit_cmp(unit, unit) RETURNS int4 AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR CLASS unit_ops DEFAULT FOR TYPE unit USING btree AS OPERATOR 1 < , OPERATOR 2 <= , OPERATOR 3 = , OPERATOR 4 >= , OPERATOR 5 > , FUNCTION 1 unit_cmp(unit, unit); -- aggregates CREATE AGGREGATE sum(unit) ( sfunc = unit_add, stype = unit ); CREATE FUNCTION unit_least(unit, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE AGGREGATE min(unit) ( sfunc = unit_least, stype = unit ); CREATE FUNCTION unit_greatest(unit, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE AGGREGATE max(unit) ( sfunc = unit_greatest, stype = unit ); CREATE TYPE unit_accum_t AS ( s unit, n bigint ); CREATE FUNCTION unit_accum(a unit_accum_t, u unit) RETURNS unit_accum_t AS $$SELECT (CASE WHEN a.s = '0'::unit THEN u ELSE a.s + u END, a.n + 1)::unit_accum_t$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION unit_avg(a unit_accum_t) RETURNS unit AS $$SELECT CASE WHEN a.n > 0 THEN a.s / a.n ELSE NULL END$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE AGGREGATE avg(unit) ( sfunc = unit_accum, stype = unit_accum_t, finalfunc = unit_avg, initcond = '(0,0)' ); postgresql-unit-7.8/unit--2--3.sql.in000066400000000000000000000027131450213077700173170ustar00rootroot00000000000000-- type definition ALTER FUNCTION unit_in(cstring) SET search_path = @extschema@; -- prefix/unit definition tables CREATE TABLE unit_prefixes ( prefix varchar(32) PRIMARY KEY, factor double precision NOT NULL, definition text, -- original definition, informational dump boolean DEFAULT true ); SELECT pg_catalog.pg_extension_config_dump('unit_prefixes', 'WHERE dump'); COPY unit_prefixes (prefix, factor, definition, dump) FROM '@MODULEDIR@/unit_prefixes.data'; CREATE TABLE unit_units ( name varchar(32) PRIMARY KEY, unit unit NOT NULL, shift double precision, -- NULL means 0.0 here definition text, -- original definition, informational dump boolean DEFAULT true ); SELECT pg_catalog.pg_extension_config_dump('unit_units', 'WHERE dump'); COPY unit_units (name, unit, shift, definition, dump) FROM '@MODULEDIR@/unit_units.data'; -- operators CREATE FUNCTION sqrt(unit) RETURNS unit AS '$libdir/unit', 'unit_sqrt' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR |/ ( rightarg = unit, procedure = sqrt ); CREATE FUNCTION cbrt(unit) RETURNS unit AS '$libdir/unit', 'unit_cbrt' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR ||/ ( rightarg = unit, procedure = cbrt ); ALTER FUNCTION unit_at(unit, cstring) SET search_path = @extschema@; -- internal functions CREATE FUNCTION unit_is_hashed(cstring) RETURNS bool AS '$libdir/unit' LANGUAGE C VOLATILE STRICT; CREATE FUNCTION unit_reset() RETURNS void AS '$libdir/unit' LANGUAGE C VOLATILE STRICT; postgresql-unit-7.8/unit--2.sql000066400000000000000000000333721450213077700165020ustar00rootroot00000000000000/* Copyright (C) 2016 Christoph Berg This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ -- type definition CREATE TYPE unit; CREATE FUNCTION unit_in(cstring) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_out(unit) RETURNS cstring AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE TYPE unit ( internallength = 16, input = unit_in, output = unit_out, alignment = double ); -- constructors CREATE FUNCTION unit(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'dbl2unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION meter(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_meter' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION kilogram(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_kilogram' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION second(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_second' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION ampere(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_ampere' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION kelvin(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_kelvin' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION mole(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_mole' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION candela(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_candela' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION byte(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_byte' LANGUAGE C IMMUTABLE STRICT; -- extractors CREATE FUNCTION value(unit) RETURNS double precision AS '$libdir/unit', 'unit_value' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION dimension(unit) RETURNS unit AS '$libdir/unit', 'unit_dimension' LANGUAGE C IMMUTABLE STRICT; -- operators CREATE FUNCTION unit_add(unit, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR + ( leftarg = unit, rightarg = unit, procedure = unit_add, commutator = + ); CREATE FUNCTION unit_sub(unit, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR - ( leftarg = unit, rightarg = unit, procedure = unit_sub ); CREATE FUNCTION unit_neg(unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR - ( rightarg = unit, procedure = unit_neg ); CREATE FUNCTION unit_mul(unit, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR * ( leftarg = unit, rightarg = unit, procedure = unit_mul, commutator = * ); CREATE FUNCTION dbl_unit_mul(double precision, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR * ( leftarg = double precision, rightarg = unit, procedure = dbl_unit_mul, commutator = * ); CREATE FUNCTION unit_dbl_mul(unit, double precision) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR * ( leftarg = unit, rightarg = double precision, procedure = unit_dbl_mul, commutator = * ); CREATE FUNCTION unit_div(unit, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR / ( leftarg = unit, rightarg = unit, procedure = unit_div ); CREATE FUNCTION dbl_unit_div(double precision, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR / ( leftarg = double precision, rightarg = unit, procedure = dbl_unit_div ); CREATE FUNCTION unit_dbl_div(unit, double precision) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR / ( leftarg = unit, rightarg = double precision, procedure = unit_dbl_div ); CREATE FUNCTION unit_pow(unit, int) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR ^ ( leftarg = unit, rightarg = int, procedure = unit_pow ); CREATE FUNCTION unit_at(unit, cstring) RETURNS cstring AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR @ ( leftarg = unit, rightarg = cstring, procedure = unit_at ); -- derived units CREATE FUNCTION radian (double precision DEFAULT 1.0) -- m·m^-1 RETURNS unit AS $$SELECT meter($1) / meter()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION steradian (double precision DEFAULT 1.0) -- m^2·m^-2 RETURNS unit AS $$SELECT meter($1) * meter() / meter()^2$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION hertz (double precision DEFAULT 1.0) -- s^-1 RETURNS unit AS $$SELECT $1 / second()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION newton (double precision DEFAULT 1.0) -- kg·m·s^-2 RETURNS unit AS $$SELECT kilogram($1) * meter() / second()^2$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION pascal (double precision DEFAULT 1.0) -- N/m^2 RETURNS unit AS $$SELECT newton($1) / meter()^2 $$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION joule (double precision DEFAULT 1.0) -- N·m RETURNS unit AS $$SELECT newton($1) * meter()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION watt (double precision DEFAULT 1.0) -- J/s RETURNS unit AS $$SELECT joule($1) / second()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION coulomb (double precision DEFAULT 1.0) -- A·s RETURNS unit AS $$SELECT ampere($1) * second()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION volt (double precision DEFAULT 1.0) -- W/A RETURNS unit AS $$SELECT watt($1) / ampere() $$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION farad (double precision DEFAULT 1.0) -- C/V RETURNS unit AS $$SELECT coulomb($1) / volt() $$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION ohm (double precision DEFAULT 1.0) -- V/A RETURNS unit AS $$SELECT volt($1) / ampere() $$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION siemens (double precision DEFAULT 1.0) -- A/V RETURNS unit AS $$SELECT ampere($1) / volt()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION weber (double precision DEFAULT 1.0) -- V·s RETURNS unit AS $$SELECT volt($1) * second()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION tesla (double precision DEFAULT 1.0) -- Wb/m^2 RETURNS unit AS $$SELECT weber($1) / meter()^2$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION henry (double precision DEFAULT 1.0) -- Wb/A RETURNS unit AS $$SELECT weber($1) / ampere()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION celsius (double precision DEFAULT 0.0) -- K relative to 273.15, default to 0°C RETURNS unit AS $$SELECT kelvin($1 + 273.15)$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION lumen (double precision DEFAULT 1.0) -- cd·sr RETURNS unit AS $$SELECT candela($1) * steradian()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION lux (double precision DEFAULT 1.0) -- lm/m^2 RETURNS unit AS $$SELECT lumen($1) / meter()^2$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION becquerel (double precision DEFAULT 1.0) -- s^-1 RETURNS unit AS $$SELECT $1 / second()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION gray (double precision DEFAULT 1.0) -- J/kg RETURNS unit AS $$SELECT joule($1) / kilogram()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION sievert (double precision DEFAULT 1.0) -- J/kg RETURNS unit AS $$SELECT joule($1)/ kilogram()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION katal (double precision DEFAULT 1.0) -- mol·s^-1 RETURNS unit AS $$SELECT mole($1) / second()$$ LANGUAGE SQL IMMUTABLE STRICT; -- Non-SI units accepted for use with the SI --minute, hour, day, degree of arc, minute of arc, second of arc, hectare, litre, tonne, astronomical unit and [deci]bel CREATE FUNCTION minute (double precision DEFAULT 1.0) RETURNS unit AS $$SELECT second($1 * 60)$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION hour (double precision DEFAULT 1.0) RETURNS unit AS $$SELECT second($1 * 3600)$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION day (double precision DEFAULT 1.0) RETURNS unit AS $$SELECT second($1 * 86400)$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION degree_arc(double precision DEFAULT 1.0) RETURNS unit AS $$SELECT $1 * '1'::unit * pi() / 180$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION minute_arc(double precision DEFAULT 1.0) RETURNS unit AS $$SELECT $1 * '1'::unit * pi() / 180 / 60$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION second_arc(double precision DEFAULT 1.0) RETURNS unit AS $$SELECT $1 * '1'::unit * pi() / 180 / 3600$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION hectare (double precision DEFAULT 1.0) RETURNS unit AS $$SELECT $1 * meter(100)^2$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION liter (double precision DEFAULT 1.0) RETURNS unit AS $$SELECT $1 * meter(0.1)^3$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION tonne (double precision DEFAULT 1.0) RETURNS unit AS $$SELECT kilogram($1 * 1000)$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION au (double precision DEFAULT 1.0) RETURNS unit AS $$SELECT meter($1 * 149597870700)$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION decibel (double precision DEFAULT 0.0) RETURNS double precision AS $$SELECT 10.0^($1 / 10.0)$$ LANGUAGE SQL IMMUTABLE STRICT; -- comparisons CREATE FUNCTION unit_lt(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_le(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_eq(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_ne(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_ge(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_gt(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR < ( leftarg = unit, rightarg = unit, procedure = unit_lt, commutator = > , negator = >= , restrict = scalarltsel, join = scalarltjoinsel ); CREATE OPERATOR <= ( leftarg = unit, rightarg = unit, procedure = unit_le, commutator = >= , negator = > , restrict = scalarltsel, join = scalarltjoinsel ); CREATE OPERATOR = ( leftarg = unit, rightarg = unit, procedure = unit_eq, commutator = = , negator = <> , restrict = eqsel, join = eqjoinsel ); CREATE OPERATOR <> ( leftarg = unit, rightarg = unit, procedure = unit_ne, commutator = <> , negator = = , restrict = neqsel, join = neqjoinsel ); CREATE OPERATOR >= ( leftarg = unit, rightarg = unit, procedure = unit_ge, commutator = <= , negator = < , restrict = scalargtsel, join = scalargtjoinsel ); CREATE OPERATOR > ( leftarg = unit, rightarg = unit, procedure = unit_gt, commutator = < , negator = <= , restrict = scalargtsel, join = scalargtjoinsel ); CREATE FUNCTION unit_cmp(unit, unit) RETURNS int4 AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR CLASS unit_ops DEFAULT FOR TYPE unit USING btree AS OPERATOR 1 < , OPERATOR 2 <= , OPERATOR 3 = , OPERATOR 4 >= , OPERATOR 5 > , FUNCTION 1 unit_cmp(unit, unit); -- aggregates CREATE AGGREGATE sum(unit) ( sfunc = unit_add, stype = unit ); CREATE FUNCTION unit_least(unit, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE AGGREGATE min(unit) ( sfunc = unit_least, stype = unit ); CREATE FUNCTION unit_greatest(unit, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE AGGREGATE max(unit) ( sfunc = unit_greatest, stype = unit ); CREATE TYPE unit_accum_t AS ( s unit, squares double precision, n bigint ); CREATE FUNCTION unit_accum(a unit_accum_t, u unit) RETURNS unit_accum_t AS $$SELECT (CASE WHEN a.s = '0'::unit THEN u ELSE a.s + u END, a.squares + value(u)^2, a.n + 1)::unit_accum_t$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION unit_avg(a unit_accum_t) RETURNS unit AS $$SELECT CASE WHEN a.n > 0 THEN a.s / a.n ELSE NULL END$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE AGGREGATE avg(unit) ( sfunc = unit_accum, stype = unit_accum_t, finalfunc = unit_avg, initcond = '(0,0,0)' ); CREATE FUNCTION unit_var_pop(a unit_accum_t) RETURNS double precision AS $$SELECT CASE WHEN a.n > 0 THEN (a.squares - value(a.s)^2 / a.n) / a.n ELSE NULL END$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE AGGREGATE var_pop(unit) ( sfunc = unit_accum, stype = unit_accum_t, finalfunc = unit_var_pop, initcond = '(0,0,0)' ); CREATE FUNCTION unit_var_samp(a unit_accum_t) RETURNS double precision AS $$SELECT CASE WHEN a.n > 1 THEN (a.squares - value(a.s)^2 / a.n) / (a.n - 1) WHEN a.n = 1 THEN 0 ELSE NULL END$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE AGGREGATE var_samp(unit) ( sfunc = unit_accum, stype = unit_accum_t, finalfunc = unit_var_samp, initcond = '(0,0,0)' ); CREATE AGGREGATE variance(unit) ( sfunc = unit_accum, stype = unit_accum_t, finalfunc = unit_var_samp, initcond = '(0,0,0)' ); CREATE FUNCTION unit_stddev_pop(a unit_accum_t) RETURNS unit AS $$SELECT CASE WHEN a.n > 0 THEN sqrt((a.squares - value(a.s)^2 / a.n) / a.n) * dimension(a.s) ELSE NULL END$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE AGGREGATE stddev_pop(unit) ( sfunc = unit_accum, stype = unit_accum_t, finalfunc = unit_stddev_pop, initcond = '(0,0,0)' ); CREATE FUNCTION unit_stddev_samp(a unit_accum_t) RETURNS unit AS $$SELECT CASE WHEN a.n > 1 THEN sqrt((a.squares - value(a.s)^2 / a.n) / (a.n - 1)) * dimension(a.s) WHEN a.n = 1 THEN 0 * dimension(a.s) ELSE NULL END$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE AGGREGATE stddev_samp(unit) ( sfunc = unit_accum, stype = unit_accum_t, finalfunc = unit_stddev_samp, initcond = '(0,0,0)' ); CREATE AGGREGATE stddev(unit) ( sfunc = unit_accum, stype = unit_accum_t, finalfunc = unit_stddev_samp, initcond = '(0,0,0)' ); postgresql-unit-7.8/unit--3--4.sql.in000066400000000000000000000005401450213077700173150ustar00rootroot00000000000000-- convert @ from (unit, cstring) to (unit, text) DROP OPERATOR @ (unit, cstring); DROP FUNCTION unit_at(unit, cstring); CREATE FUNCTION unit_at(unit, text) RETURNS cstring SET search_path = @extschema@ AS '$libdir/unit', 'unit_at_text' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR @ ( leftarg = unit, rightarg = text, procedure = unit_at ); postgresql-unit-7.8/unit--3.sql.in000066400000000000000000000361301450213077700171030ustar00rootroot00000000000000/* Copyright (C) 2016-2017 Christoph Berg This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ -- type definition CREATE TYPE unit; CREATE FUNCTION unit_in(cstring) RETURNS unit SET search_path = @extschema@ AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_out(unit) RETURNS cstring AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE TYPE unit ( internallength = 16, input = unit_in, output = unit_out, alignment = double ); -- prefix/unit definition tables CREATE TABLE unit_prefixes ( prefix varchar(32) PRIMARY KEY, factor double precision NOT NULL, definition text, -- original definition, informational dump boolean DEFAULT true ); SELECT pg_catalog.pg_extension_config_dump('unit_prefixes', 'WHERE dump'); COPY unit_prefixes (prefix, factor, definition, dump) FROM '@MODULEDIR@/unit_prefixes.data'; CREATE TABLE unit_units ( name varchar(32) PRIMARY KEY, unit unit NOT NULL, shift double precision, -- NULL means 0.0 here definition text, -- original definition, informational dump boolean DEFAULT true ); SELECT pg_catalog.pg_extension_config_dump('unit_units', 'WHERE dump'); COPY unit_units (name, unit, shift, definition, dump) FROM '@MODULEDIR@/unit_units.data'; -- constructors CREATE FUNCTION unit(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'dbl2unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION meter(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_meter' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION kilogram(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_kilogram' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION second(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_second' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION ampere(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_ampere' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION kelvin(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_kelvin' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION mole(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_mole' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION candela(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_candela' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION byte(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_byte' LANGUAGE C IMMUTABLE STRICT; -- extractors CREATE FUNCTION value(unit) RETURNS double precision AS '$libdir/unit', 'unit_value' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION dimension(unit) RETURNS unit AS '$libdir/unit', 'unit_dimension' LANGUAGE C IMMUTABLE STRICT; -- operators CREATE FUNCTION unit_add(unit, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR + ( leftarg = unit, rightarg = unit, procedure = unit_add, commutator = + ); CREATE FUNCTION unit_sub(unit, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR - ( leftarg = unit, rightarg = unit, procedure = unit_sub ); CREATE FUNCTION unit_neg(unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR - ( rightarg = unit, procedure = unit_neg ); CREATE FUNCTION unit_mul(unit, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR * ( leftarg = unit, rightarg = unit, procedure = unit_mul, commutator = * ); CREATE FUNCTION dbl_unit_mul(double precision, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR * ( leftarg = double precision, rightarg = unit, procedure = dbl_unit_mul, commutator = * ); CREATE FUNCTION unit_dbl_mul(unit, double precision) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR * ( leftarg = unit, rightarg = double precision, procedure = unit_dbl_mul, commutator = * ); CREATE FUNCTION unit_div(unit, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR / ( leftarg = unit, rightarg = unit, procedure = unit_div ); CREATE FUNCTION dbl_unit_div(double precision, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR / ( leftarg = double precision, rightarg = unit, procedure = dbl_unit_div ); CREATE FUNCTION unit_dbl_div(unit, double precision) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR / ( leftarg = unit, rightarg = double precision, procedure = unit_dbl_div ); CREATE FUNCTION unit_pow(unit, int) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR ^ ( leftarg = unit, rightarg = int, procedure = unit_pow ); CREATE FUNCTION sqrt(unit) RETURNS unit AS '$libdir/unit', 'unit_sqrt' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR |/ ( rightarg = unit, procedure = sqrt ); CREATE FUNCTION cbrt(unit) RETURNS unit AS '$libdir/unit', 'unit_cbrt' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR ||/ ( rightarg = unit, procedure = cbrt ); CREATE FUNCTION unit_at(unit, cstring) RETURNS cstring SET search_path = @extschema@ AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR @ ( leftarg = unit, rightarg = cstring, procedure = unit_at ); -- derived units CREATE FUNCTION radian (double precision DEFAULT 1.0) -- m·m^-1 RETURNS unit AS $$SELECT meter($1) / meter()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION steradian (double precision DEFAULT 1.0) -- m^2·m^-2 RETURNS unit AS $$SELECT meter($1) * meter() / meter()^2$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION hertz (double precision DEFAULT 1.0) -- s^-1 RETURNS unit AS $$SELECT $1 / second()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION newton (double precision DEFAULT 1.0) -- kg·m·s^-2 RETURNS unit AS $$SELECT kilogram($1) * meter() / second()^2$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION pascal (double precision DEFAULT 1.0) -- N/m^2 RETURNS unit AS $$SELECT newton($1) / meter()^2 $$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION joule (double precision DEFAULT 1.0) -- N·m RETURNS unit AS $$SELECT newton($1) * meter()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION watt (double precision DEFAULT 1.0) -- J/s RETURNS unit AS $$SELECT joule($1) / second()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION coulomb (double precision DEFAULT 1.0) -- A·s RETURNS unit AS $$SELECT ampere($1) * second()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION volt (double precision DEFAULT 1.0) -- W/A RETURNS unit AS $$SELECT watt($1) / ampere() $$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION farad (double precision DEFAULT 1.0) -- C/V RETURNS unit AS $$SELECT coulomb($1) / volt() $$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION ohm (double precision DEFAULT 1.0) -- V/A RETURNS unit AS $$SELECT volt($1) / ampere() $$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION siemens (double precision DEFAULT 1.0) -- A/V RETURNS unit AS $$SELECT ampere($1) / volt()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION weber (double precision DEFAULT 1.0) -- V·s RETURNS unit AS $$SELECT volt($1) * second()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION tesla (double precision DEFAULT 1.0) -- Wb/m^2 RETURNS unit AS $$SELECT weber($1) / meter()^2$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION henry (double precision DEFAULT 1.0) -- Wb/A RETURNS unit AS $$SELECT weber($1) / ampere()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION celsius (double precision DEFAULT 0.0) -- K relative to 273.15, default to 0°C RETURNS unit AS $$SELECT kelvin($1 + 273.15)$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION lumen (double precision DEFAULT 1.0) -- cd·sr RETURNS unit AS $$SELECT candela($1) * steradian()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION lux (double precision DEFAULT 1.0) -- lm/m^2 RETURNS unit AS $$SELECT lumen($1) / meter()^2$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION becquerel (double precision DEFAULT 1.0) -- s^-1 RETURNS unit AS $$SELECT $1 / second()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION gray (double precision DEFAULT 1.0) -- J/kg RETURNS unit AS $$SELECT joule($1) / kilogram()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION sievert (double precision DEFAULT 1.0) -- J/kg RETURNS unit AS $$SELECT joule($1)/ kilogram()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION katal (double precision DEFAULT 1.0) -- mol·s^-1 RETURNS unit AS $$SELECT mole($1) / second()$$ LANGUAGE SQL IMMUTABLE STRICT; -- Non-SI units accepted for use with the SI --minute, hour, day, degree of arc, minute of arc, second of arc, hectare, litre, tonne, astronomical unit and [deci]bel CREATE FUNCTION minute (double precision DEFAULT 1.0) RETURNS unit AS $$SELECT second($1 * 60)$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION hour (double precision DEFAULT 1.0) RETURNS unit AS $$SELECT second($1 * 3600)$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION day (double precision DEFAULT 1.0) RETURNS unit AS $$SELECT second($1 * 86400)$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION degree_arc(double precision DEFAULT 1.0) RETURNS unit AS $$SELECT $1 * '1'::unit * pi() / 180$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION minute_arc(double precision DEFAULT 1.0) RETURNS unit AS $$SELECT $1 * '1'::unit * pi() / 180 / 60$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION second_arc(double precision DEFAULT 1.0) RETURNS unit AS $$SELECT $1 * '1'::unit * pi() / 180 / 3600$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION hectare (double precision DEFAULT 1.0) RETURNS unit AS $$SELECT $1 * meter(100)^2$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION liter (double precision DEFAULT 1.0) RETURNS unit AS $$SELECT $1 * meter(0.1)^3$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION tonne (double precision DEFAULT 1.0) RETURNS unit AS $$SELECT kilogram($1 * 1000)$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION au (double precision DEFAULT 1.0) RETURNS unit AS $$SELECT meter($1 * 149597870700)$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION decibel (double precision DEFAULT 0.0) RETURNS double precision AS $$SELECT 10.0^($1 / 10.0)$$ LANGUAGE SQL IMMUTABLE STRICT; -- comparisons CREATE FUNCTION unit_lt(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_le(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_eq(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_ne(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_ge(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_gt(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR < ( leftarg = unit, rightarg = unit, procedure = unit_lt, commutator = > , negator = >= , restrict = scalarltsel, join = scalarltjoinsel ); CREATE OPERATOR <= ( leftarg = unit, rightarg = unit, procedure = unit_le, commutator = >= , negator = > , restrict = scalarltsel, join = scalarltjoinsel ); CREATE OPERATOR = ( leftarg = unit, rightarg = unit, procedure = unit_eq, commutator = = , negator = <> , restrict = eqsel, join = eqjoinsel ); CREATE OPERATOR <> ( leftarg = unit, rightarg = unit, procedure = unit_ne, commutator = <> , negator = = , restrict = neqsel, join = neqjoinsel ); CREATE OPERATOR >= ( leftarg = unit, rightarg = unit, procedure = unit_ge, commutator = <= , negator = < , restrict = scalargtsel, join = scalargtjoinsel ); CREATE OPERATOR > ( leftarg = unit, rightarg = unit, procedure = unit_gt, commutator = < , negator = <= , restrict = scalargtsel, join = scalargtjoinsel ); CREATE FUNCTION unit_cmp(unit, unit) RETURNS int4 AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR CLASS unit_ops DEFAULT FOR TYPE unit USING btree AS OPERATOR 1 < , OPERATOR 2 <= , OPERATOR 3 = , OPERATOR 4 >= , OPERATOR 5 > , FUNCTION 1 unit_cmp(unit, unit); -- aggregates CREATE AGGREGATE sum(unit) ( sfunc = unit_add, stype = unit ); CREATE FUNCTION unit_least(unit, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE AGGREGATE min(unit) ( sfunc = unit_least, stype = unit ); CREATE FUNCTION unit_greatest(unit, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE AGGREGATE max(unit) ( sfunc = unit_greatest, stype = unit ); CREATE TYPE unit_accum_t AS ( s unit, squares double precision, n bigint ); CREATE FUNCTION unit_accum(a unit_accum_t, u unit) RETURNS unit_accum_t AS $$SELECT (CASE WHEN a.s = '0'::unit THEN u ELSE a.s + u END, a.squares + value(u)^2, a.n + 1)::unit_accum_t$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION unit_avg(a unit_accum_t) RETURNS unit AS $$SELECT CASE WHEN a.n > 0 THEN a.s / a.n ELSE NULL END$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE AGGREGATE avg(unit) ( sfunc = unit_accum, stype = unit_accum_t, finalfunc = unit_avg, initcond = '(0,0,0)' ); CREATE FUNCTION unit_var_pop(a unit_accum_t) RETURNS double precision AS $$SELECT CASE WHEN a.n > 0 THEN (a.squares - value(a.s)^2 / a.n) / a.n ELSE NULL END$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE AGGREGATE var_pop(unit) ( sfunc = unit_accum, stype = unit_accum_t, finalfunc = unit_var_pop, initcond = '(0,0,0)' ); CREATE FUNCTION unit_var_samp(a unit_accum_t) RETURNS double precision AS $$SELECT CASE WHEN a.n > 1 THEN (a.squares - value(a.s)^2 / a.n) / (a.n - 1) WHEN a.n = 1 THEN 0 ELSE NULL END$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE AGGREGATE var_samp(unit) ( sfunc = unit_accum, stype = unit_accum_t, finalfunc = unit_var_samp, initcond = '(0,0,0)' ); CREATE AGGREGATE variance(unit) ( sfunc = unit_accum, stype = unit_accum_t, finalfunc = unit_var_samp, initcond = '(0,0,0)' ); CREATE FUNCTION unit_stddev_pop(a unit_accum_t) RETURNS unit AS $$SELECT CASE WHEN a.n > 0 THEN sqrt((a.squares - value(a.s)^2 / a.n) / a.n) * dimension(a.s) ELSE NULL END$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE AGGREGATE stddev_pop(unit) ( sfunc = unit_accum, stype = unit_accum_t, finalfunc = unit_stddev_pop, initcond = '(0,0,0)' ); CREATE FUNCTION unit_stddev_samp(a unit_accum_t) RETURNS unit AS $$SELECT CASE WHEN a.n > 1 THEN sqrt((a.squares - value(a.s)^2 / a.n) / (a.n - 1)) * dimension(a.s) WHEN a.n = 1 THEN 0 * dimension(a.s) ELSE NULL END$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE AGGREGATE stddev_samp(unit) ( sfunc = unit_accum, stype = unit_accum_t, finalfunc = unit_stddev_samp, initcond = '(0,0,0)' ); CREATE AGGREGATE stddev(unit) ( sfunc = unit_accum, stype = unit_accum_t, finalfunc = unit_stddev_samp, initcond = '(0,0,0)' ); -- internal functions CREATE FUNCTION unit_is_hashed(cstring) RETURNS bool AS '$libdir/unit' LANGUAGE C VOLATILE STRICT; CREATE FUNCTION unit_reset() RETURNS void AS '$libdir/unit' LANGUAGE C VOLATILE STRICT; postgresql-unit-7.8/unit--4--5.sql.in000066400000000000000000000001511450213077700173150ustar00rootroot00000000000000CREATE FUNCTION round(unit) RETURNS unit AS '$libdir/unit', 'unit_round' LANGUAGE C IMMUTABLE STRICT; postgresql-unit-7.8/unit--4.sql.in000066400000000000000000000361421450213077700171070ustar00rootroot00000000000000/* Copyright (C) 2016-2017 Christoph Berg This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ -- type definition CREATE TYPE unit; CREATE FUNCTION unit_in(cstring) RETURNS unit SET search_path = @extschema@ AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_out(unit) RETURNS cstring AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE TYPE unit ( internallength = 16, input = unit_in, output = unit_out, alignment = double ); -- prefix/unit definition tables CREATE TABLE unit_prefixes ( prefix varchar(32) PRIMARY KEY, factor double precision NOT NULL, definition text, -- original definition, informational dump boolean DEFAULT true ); SELECT pg_catalog.pg_extension_config_dump('unit_prefixes', 'WHERE dump'); COPY unit_prefixes (prefix, factor, definition, dump) FROM '@MODULEDIR@/unit_prefixes.data'; CREATE TABLE unit_units ( name varchar(32) PRIMARY KEY, unit unit NOT NULL, shift double precision, -- NULL means 0.0 here definition text, -- original definition, informational dump boolean DEFAULT true ); SELECT pg_catalog.pg_extension_config_dump('unit_units', 'WHERE dump'); COPY unit_units (name, unit, shift, definition, dump) FROM '@MODULEDIR@/unit_units.data'; -- constructors CREATE FUNCTION unit(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'dbl2unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION meter(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_meter' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION kilogram(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_kilogram' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION second(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_second' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION ampere(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_ampere' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION kelvin(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_kelvin' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION mole(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_mole' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION candela(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_candela' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION byte(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_byte' LANGUAGE C IMMUTABLE STRICT; -- extractors CREATE FUNCTION value(unit) RETURNS double precision AS '$libdir/unit', 'unit_value' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION dimension(unit) RETURNS unit AS '$libdir/unit', 'unit_dimension' LANGUAGE C IMMUTABLE STRICT; -- operators CREATE FUNCTION unit_add(unit, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR + ( leftarg = unit, rightarg = unit, procedure = unit_add, commutator = + ); CREATE FUNCTION unit_sub(unit, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR - ( leftarg = unit, rightarg = unit, procedure = unit_sub ); CREATE FUNCTION unit_neg(unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR - ( rightarg = unit, procedure = unit_neg ); CREATE FUNCTION unit_mul(unit, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR * ( leftarg = unit, rightarg = unit, procedure = unit_mul, commutator = * ); CREATE FUNCTION dbl_unit_mul(double precision, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR * ( leftarg = double precision, rightarg = unit, procedure = dbl_unit_mul, commutator = * ); CREATE FUNCTION unit_dbl_mul(unit, double precision) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR * ( leftarg = unit, rightarg = double precision, procedure = unit_dbl_mul, commutator = * ); CREATE FUNCTION unit_div(unit, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR / ( leftarg = unit, rightarg = unit, procedure = unit_div ); CREATE FUNCTION dbl_unit_div(double precision, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR / ( leftarg = double precision, rightarg = unit, procedure = dbl_unit_div ); CREATE FUNCTION unit_dbl_div(unit, double precision) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR / ( leftarg = unit, rightarg = double precision, procedure = unit_dbl_div ); CREATE FUNCTION unit_pow(unit, int) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR ^ ( leftarg = unit, rightarg = int, procedure = unit_pow ); CREATE FUNCTION sqrt(unit) RETURNS unit AS '$libdir/unit', 'unit_sqrt' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR |/ ( rightarg = unit, procedure = sqrt ); CREATE FUNCTION cbrt(unit) RETURNS unit AS '$libdir/unit', 'unit_cbrt' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR ||/ ( rightarg = unit, procedure = cbrt ); CREATE FUNCTION unit_at(unit, text) RETURNS cstring SET search_path = @extschema@ AS '$libdir/unit', 'unit_at_text' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR @ ( leftarg = unit, rightarg = text, procedure = unit_at ); -- derived units CREATE FUNCTION radian (double precision DEFAULT 1.0) -- m·m^-1 RETURNS unit AS $$SELECT meter($1) / meter()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION steradian (double precision DEFAULT 1.0) -- m^2·m^-2 RETURNS unit AS $$SELECT meter($1) * meter() / meter()^2$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION hertz (double precision DEFAULT 1.0) -- s^-1 RETURNS unit AS $$SELECT $1 / second()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION newton (double precision DEFAULT 1.0) -- kg·m·s^-2 RETURNS unit AS $$SELECT kilogram($1) * meter() / second()^2$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION pascal (double precision DEFAULT 1.0) -- N/m^2 RETURNS unit AS $$SELECT newton($1) / meter()^2 $$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION joule (double precision DEFAULT 1.0) -- N·m RETURNS unit AS $$SELECT newton($1) * meter()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION watt (double precision DEFAULT 1.0) -- J/s RETURNS unit AS $$SELECT joule($1) / second()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION coulomb (double precision DEFAULT 1.0) -- A·s RETURNS unit AS $$SELECT ampere($1) * second()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION volt (double precision DEFAULT 1.0) -- W/A RETURNS unit AS $$SELECT watt($1) / ampere() $$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION farad (double precision DEFAULT 1.0) -- C/V RETURNS unit AS $$SELECT coulomb($1) / volt() $$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION ohm (double precision DEFAULT 1.0) -- V/A RETURNS unit AS $$SELECT volt($1) / ampere() $$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION siemens (double precision DEFAULT 1.0) -- A/V RETURNS unit AS $$SELECT ampere($1) / volt()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION weber (double precision DEFAULT 1.0) -- V·s RETURNS unit AS $$SELECT volt($1) * second()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION tesla (double precision DEFAULT 1.0) -- Wb/m^2 RETURNS unit AS $$SELECT weber($1) / meter()^2$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION henry (double precision DEFAULT 1.0) -- Wb/A RETURNS unit AS $$SELECT weber($1) / ampere()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION celsius (double precision DEFAULT 0.0) -- K relative to 273.15, default to 0°C RETURNS unit AS $$SELECT kelvin($1 + 273.15)$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION lumen (double precision DEFAULT 1.0) -- cd·sr RETURNS unit AS $$SELECT candela($1) * steradian()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION lux (double precision DEFAULT 1.0) -- lm/m^2 RETURNS unit AS $$SELECT lumen($1) / meter()^2$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION becquerel (double precision DEFAULT 1.0) -- s^-1 RETURNS unit AS $$SELECT $1 / second()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION gray (double precision DEFAULT 1.0) -- J/kg RETURNS unit AS $$SELECT joule($1) / kilogram()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION sievert (double precision DEFAULT 1.0) -- J/kg RETURNS unit AS $$SELECT joule($1)/ kilogram()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION katal (double precision DEFAULT 1.0) -- mol·s^-1 RETURNS unit AS $$SELECT mole($1) / second()$$ LANGUAGE SQL IMMUTABLE STRICT; -- Non-SI units accepted for use with the SI --minute, hour, day, degree of arc, minute of arc, second of arc, hectare, litre, tonne, astronomical unit and [deci]bel CREATE FUNCTION minute (double precision DEFAULT 1.0) RETURNS unit AS $$SELECT second($1 * 60)$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION hour (double precision DEFAULT 1.0) RETURNS unit AS $$SELECT second($1 * 3600)$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION day (double precision DEFAULT 1.0) RETURNS unit AS $$SELECT second($1 * 86400)$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION degree_arc(double precision DEFAULT 1.0) RETURNS unit AS $$SELECT $1 * '1'::unit * pi() / 180$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION minute_arc(double precision DEFAULT 1.0) RETURNS unit AS $$SELECT $1 * '1'::unit * pi() / 180 / 60$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION second_arc(double precision DEFAULT 1.0) RETURNS unit AS $$SELECT $1 * '1'::unit * pi() / 180 / 3600$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION hectare (double precision DEFAULT 1.0) RETURNS unit AS $$SELECT $1 * meter(100)^2$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION liter (double precision DEFAULT 1.0) RETURNS unit AS $$SELECT $1 * meter(0.1)^3$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION tonne (double precision DEFAULT 1.0) RETURNS unit AS $$SELECT kilogram($1 * 1000)$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION au (double precision DEFAULT 1.0) RETURNS unit AS $$SELECT meter($1 * 149597870700)$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION decibel (double precision DEFAULT 0.0) RETURNS double precision AS $$SELECT 10.0^($1 / 10.0)$$ LANGUAGE SQL IMMUTABLE STRICT; -- comparisons CREATE FUNCTION unit_lt(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_le(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_eq(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_ne(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_ge(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_gt(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR < ( leftarg = unit, rightarg = unit, procedure = unit_lt, commutator = > , negator = >= , restrict = scalarltsel, join = scalarltjoinsel ); CREATE OPERATOR <= ( leftarg = unit, rightarg = unit, procedure = unit_le, commutator = >= , negator = > , restrict = scalarltsel, join = scalarltjoinsel ); CREATE OPERATOR = ( leftarg = unit, rightarg = unit, procedure = unit_eq, commutator = = , negator = <> , restrict = eqsel, join = eqjoinsel ); CREATE OPERATOR <> ( leftarg = unit, rightarg = unit, procedure = unit_ne, commutator = <> , negator = = , restrict = neqsel, join = neqjoinsel ); CREATE OPERATOR >= ( leftarg = unit, rightarg = unit, procedure = unit_ge, commutator = <= , negator = < , restrict = scalargtsel, join = scalargtjoinsel ); CREATE OPERATOR > ( leftarg = unit, rightarg = unit, procedure = unit_gt, commutator = < , negator = <= , restrict = scalargtsel, join = scalargtjoinsel ); CREATE FUNCTION unit_cmp(unit, unit) RETURNS int4 AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR CLASS unit_ops DEFAULT FOR TYPE unit USING btree AS OPERATOR 1 < , OPERATOR 2 <= , OPERATOR 3 = , OPERATOR 4 >= , OPERATOR 5 > , FUNCTION 1 unit_cmp(unit, unit); -- aggregates CREATE AGGREGATE sum(unit) ( sfunc = unit_add, stype = unit ); CREATE FUNCTION unit_least(unit, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE AGGREGATE min(unit) ( sfunc = unit_least, stype = unit ); CREATE FUNCTION unit_greatest(unit, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE AGGREGATE max(unit) ( sfunc = unit_greatest, stype = unit ); CREATE TYPE unit_accum_t AS ( s unit, squares double precision, n bigint ); CREATE FUNCTION unit_accum(a unit_accum_t, u unit) RETURNS unit_accum_t AS $$SELECT (CASE WHEN a.s = '0'::unit THEN u ELSE a.s + u END, a.squares + value(u)^2, a.n + 1)::unit_accum_t$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION unit_avg(a unit_accum_t) RETURNS unit AS $$SELECT CASE WHEN a.n > 0 THEN a.s / a.n ELSE NULL END$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE AGGREGATE avg(unit) ( sfunc = unit_accum, stype = unit_accum_t, finalfunc = unit_avg, initcond = '(0,0,0)' ); CREATE FUNCTION unit_var_pop(a unit_accum_t) RETURNS double precision AS $$SELECT CASE WHEN a.n > 0 THEN (a.squares - value(a.s)^2 / a.n) / a.n ELSE NULL END$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE AGGREGATE var_pop(unit) ( sfunc = unit_accum, stype = unit_accum_t, finalfunc = unit_var_pop, initcond = '(0,0,0)' ); CREATE FUNCTION unit_var_samp(a unit_accum_t) RETURNS double precision AS $$SELECT CASE WHEN a.n > 1 THEN (a.squares - value(a.s)^2 / a.n) / (a.n - 1) WHEN a.n = 1 THEN 0 ELSE NULL END$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE AGGREGATE var_samp(unit) ( sfunc = unit_accum, stype = unit_accum_t, finalfunc = unit_var_samp, initcond = '(0,0,0)' ); CREATE AGGREGATE variance(unit) ( sfunc = unit_accum, stype = unit_accum_t, finalfunc = unit_var_samp, initcond = '(0,0,0)' ); CREATE FUNCTION unit_stddev_pop(a unit_accum_t) RETURNS unit AS $$SELECT CASE WHEN a.n > 0 THEN sqrt((a.squares - value(a.s)^2 / a.n) / a.n) * dimension(a.s) ELSE NULL END$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE AGGREGATE stddev_pop(unit) ( sfunc = unit_accum, stype = unit_accum_t, finalfunc = unit_stddev_pop, initcond = '(0,0,0)' ); CREATE FUNCTION unit_stddev_samp(a unit_accum_t) RETURNS unit AS $$SELECT CASE WHEN a.n > 1 THEN sqrt((a.squares - value(a.s)^2 / a.n) / (a.n - 1)) * dimension(a.s) WHEN a.n = 1 THEN 0 * dimension(a.s) ELSE NULL END$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE AGGREGATE stddev_samp(unit) ( sfunc = unit_accum, stype = unit_accum_t, finalfunc = unit_stddev_samp, initcond = '(0,0,0)' ); CREATE AGGREGATE stddev(unit) ( sfunc = unit_accum, stype = unit_accum_t, finalfunc = unit_stddev_samp, initcond = '(0,0,0)' ); -- internal functions CREATE FUNCTION unit_is_hashed(cstring) RETURNS bool AS '$libdir/unit' LANGUAGE C VOLATILE STRICT; CREATE FUNCTION unit_reset() RETURNS void AS '$libdir/unit' LANGUAGE C VOLATILE STRICT; postgresql-unit-7.8/unit--5--6.sql.in000066400000000000000000000023461450213077700173270ustar00rootroot00000000000000GRANT SELECT ON unit_prefixes, unit_units TO PUBLIC; CREATE FUNCTION unit_load() RETURNS VOID LANGUAGE plpgsql AS $$BEGIN DELETE FROM unit_prefixes WHERE dump IS NOT TRUE; CREATE TEMP TABLE tmp_prefixes (LIKE unit_prefixes) ON COMMIT DROP; COPY tmp_prefixes (prefix, factor, definition, dump) FROM '@MODULEDIR@/unit_prefixes.data'; INSERT INTO unit_prefixes SELECT * FROM tmp_prefixes t WHERE NOT EXISTS (SELECT prefix FROM unit_prefixes u WHERE u.prefix = t.prefix); DROP TABLE tmp_prefixes; DELETE FROM unit_units WHERE dump IS NOT TRUE; CREATE TEMP TABLE tmp_units (LIKE unit_units) ON COMMIT DROP; COPY tmp_units (name, unit, shift, definition, dump) FROM '@MODULEDIR@/unit_units.data'; INSERT INTO unit_units SELECT * FROM tmp_units t WHERE NOT EXISTS (SELECT name FROM unit_units u WHERE u.name = t.name); DROP TABLE tmp_units; END;$$; COMMENT ON FUNCTION unit_load() IS 'Loads/upgrades the unit_units and unit_prefixes contents from the data files on disk'; SELECT unit_load(); CREATE FUNCTION unit_at_double(unit, text) RETURNS double precision SET search_path = @extschema@ AS '$libdir/unit', 'unit_at_double' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR @@ ( leftarg = unit, rightarg = text, procedure = unit_at_double ); postgresql-unit-7.8/unit--5.sql.in000066400000000000000000000363351450213077700171140ustar00rootroot00000000000000/* Copyright (C) 2016-2018 Christoph Berg This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ -- type definition CREATE TYPE unit; CREATE FUNCTION unit_in(cstring) RETURNS unit SET search_path = @extschema@ AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_out(unit) RETURNS cstring AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE TYPE unit ( internallength = 16, input = unit_in, output = unit_out, alignment = double ); -- prefix/unit definition tables CREATE TABLE unit_prefixes ( prefix varchar(32) PRIMARY KEY, factor double precision NOT NULL, definition text, -- original definition, informational dump boolean DEFAULT true ); SELECT pg_catalog.pg_extension_config_dump('unit_prefixes', 'WHERE dump'); COPY unit_prefixes (prefix, factor, definition, dump) FROM '@MODULEDIR@/unit_prefixes.data'; CREATE TABLE unit_units ( name varchar(32) PRIMARY KEY, unit unit NOT NULL, shift double precision, -- NULL means 0.0 here definition text, -- original definition, informational dump boolean DEFAULT true ); SELECT pg_catalog.pg_extension_config_dump('unit_units', 'WHERE dump'); COPY unit_units (name, unit, shift, definition, dump) FROM '@MODULEDIR@/unit_units.data'; -- constructors CREATE FUNCTION unit(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'dbl2unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION meter(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_meter' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION kilogram(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_kilogram' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION second(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_second' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION ampere(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_ampere' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION kelvin(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_kelvin' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION mole(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_mole' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION candela(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_candela' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION byte(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_byte' LANGUAGE C IMMUTABLE STRICT; -- functions without operators CREATE FUNCTION value(unit) RETURNS double precision AS '$libdir/unit', 'unit_value' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION dimension(unit) RETURNS unit AS '$libdir/unit', 'unit_dimension' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION round(unit) RETURNS unit AS '$libdir/unit', 'unit_round' LANGUAGE C IMMUTABLE STRICT; -- operators CREATE FUNCTION unit_add(unit, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR + ( leftarg = unit, rightarg = unit, procedure = unit_add, commutator = + ); CREATE FUNCTION unit_sub(unit, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR - ( leftarg = unit, rightarg = unit, procedure = unit_sub ); CREATE FUNCTION unit_neg(unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR - ( rightarg = unit, procedure = unit_neg ); CREATE FUNCTION unit_mul(unit, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR * ( leftarg = unit, rightarg = unit, procedure = unit_mul, commutator = * ); CREATE FUNCTION dbl_unit_mul(double precision, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR * ( leftarg = double precision, rightarg = unit, procedure = dbl_unit_mul, commutator = * ); CREATE FUNCTION unit_dbl_mul(unit, double precision) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR * ( leftarg = unit, rightarg = double precision, procedure = unit_dbl_mul, commutator = * ); CREATE FUNCTION unit_div(unit, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR / ( leftarg = unit, rightarg = unit, procedure = unit_div ); CREATE FUNCTION dbl_unit_div(double precision, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR / ( leftarg = double precision, rightarg = unit, procedure = dbl_unit_div ); CREATE FUNCTION unit_dbl_div(unit, double precision) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR / ( leftarg = unit, rightarg = double precision, procedure = unit_dbl_div ); CREATE FUNCTION unit_pow(unit, int) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR ^ ( leftarg = unit, rightarg = int, procedure = unit_pow ); CREATE FUNCTION sqrt(unit) RETURNS unit AS '$libdir/unit', 'unit_sqrt' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR |/ ( rightarg = unit, procedure = sqrt ); CREATE FUNCTION cbrt(unit) RETURNS unit AS '$libdir/unit', 'unit_cbrt' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR ||/ ( rightarg = unit, procedure = cbrt ); CREATE FUNCTION unit_at(unit, text) RETURNS cstring SET search_path = @extschema@ AS '$libdir/unit', 'unit_at_text' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR @ ( leftarg = unit, rightarg = text, procedure = unit_at ); -- derived units CREATE FUNCTION radian (double precision DEFAULT 1.0) -- m·m^-1 RETURNS unit AS $$SELECT meter($1) / meter()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION steradian (double precision DEFAULT 1.0) -- m^2·m^-2 RETURNS unit AS $$SELECT meter($1) * meter() / meter()^2$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION hertz (double precision DEFAULT 1.0) -- s^-1 RETURNS unit AS $$SELECT $1 / second()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION newton (double precision DEFAULT 1.0) -- kg·m·s^-2 RETURNS unit AS $$SELECT kilogram($1) * meter() / second()^2$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION pascal (double precision DEFAULT 1.0) -- N/m^2 RETURNS unit AS $$SELECT newton($1) / meter()^2 $$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION joule (double precision DEFAULT 1.0) -- N·m RETURNS unit AS $$SELECT newton($1) * meter()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION watt (double precision DEFAULT 1.0) -- J/s RETURNS unit AS $$SELECT joule($1) / second()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION coulomb (double precision DEFAULT 1.0) -- A·s RETURNS unit AS $$SELECT ampere($1) * second()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION volt (double precision DEFAULT 1.0) -- W/A RETURNS unit AS $$SELECT watt($1) / ampere() $$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION farad (double precision DEFAULT 1.0) -- C/V RETURNS unit AS $$SELECT coulomb($1) / volt() $$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION ohm (double precision DEFAULT 1.0) -- V/A RETURNS unit AS $$SELECT volt($1) / ampere() $$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION siemens (double precision DEFAULT 1.0) -- A/V RETURNS unit AS $$SELECT ampere($1) / volt()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION weber (double precision DEFAULT 1.0) -- V·s RETURNS unit AS $$SELECT volt($1) * second()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION tesla (double precision DEFAULT 1.0) -- Wb/m^2 RETURNS unit AS $$SELECT weber($1) / meter()^2$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION henry (double precision DEFAULT 1.0) -- Wb/A RETURNS unit AS $$SELECT weber($1) / ampere()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION celsius (double precision DEFAULT 0.0) -- K relative to 273.15, default to 0°C RETURNS unit AS $$SELECT kelvin($1 + 273.15)$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION lumen (double precision DEFAULT 1.0) -- cd·sr RETURNS unit AS $$SELECT candela($1) * steradian()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION lux (double precision DEFAULT 1.0) -- lm/m^2 RETURNS unit AS $$SELECT lumen($1) / meter()^2$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION becquerel (double precision DEFAULT 1.0) -- s^-1 RETURNS unit AS $$SELECT $1 / second()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION gray (double precision DEFAULT 1.0) -- J/kg RETURNS unit AS $$SELECT joule($1) / kilogram()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION sievert (double precision DEFAULT 1.0) -- J/kg RETURNS unit AS $$SELECT joule($1)/ kilogram()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION katal (double precision DEFAULT 1.0) -- mol·s^-1 RETURNS unit AS $$SELECT mole($1) / second()$$ LANGUAGE SQL IMMUTABLE STRICT; -- Non-SI units accepted for use with the SI --minute, hour, day, degree of arc, minute of arc, second of arc, hectare, litre, tonne, astronomical unit and [deci]bel CREATE FUNCTION minute (double precision DEFAULT 1.0) RETURNS unit AS $$SELECT second($1 * 60)$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION hour (double precision DEFAULT 1.0) RETURNS unit AS $$SELECT second($1 * 3600)$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION day (double precision DEFAULT 1.0) RETURNS unit AS $$SELECT second($1 * 86400)$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION degree_arc(double precision DEFAULT 1.0) RETURNS unit AS $$SELECT $1 * '1'::unit * pi() / 180$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION minute_arc(double precision DEFAULT 1.0) RETURNS unit AS $$SELECT $1 * '1'::unit * pi() / 180 / 60$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION second_arc(double precision DEFAULT 1.0) RETURNS unit AS $$SELECT $1 * '1'::unit * pi() / 180 / 3600$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION hectare (double precision DEFAULT 1.0) RETURNS unit AS $$SELECT $1 * meter(100)^2$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION liter (double precision DEFAULT 1.0) RETURNS unit AS $$SELECT $1 * meter(0.1)^3$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION tonne (double precision DEFAULT 1.0) RETURNS unit AS $$SELECT kilogram($1 * 1000)$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION au (double precision DEFAULT 1.0) RETURNS unit AS $$SELECT meter($1 * 149597870700)$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION decibel (double precision DEFAULT 0.0) RETURNS double precision AS $$SELECT 10.0^($1 / 10.0)$$ LANGUAGE SQL IMMUTABLE STRICT; -- comparisons CREATE FUNCTION unit_lt(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_le(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_eq(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_ne(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_ge(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_gt(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR < ( leftarg = unit, rightarg = unit, procedure = unit_lt, commutator = > , negator = >= , restrict = scalarltsel, join = scalarltjoinsel ); CREATE OPERATOR <= ( leftarg = unit, rightarg = unit, procedure = unit_le, commutator = >= , negator = > , restrict = scalarltsel, join = scalarltjoinsel ); CREATE OPERATOR = ( leftarg = unit, rightarg = unit, procedure = unit_eq, commutator = = , negator = <> , restrict = eqsel, join = eqjoinsel ); CREATE OPERATOR <> ( leftarg = unit, rightarg = unit, procedure = unit_ne, commutator = <> , negator = = , restrict = neqsel, join = neqjoinsel ); CREATE OPERATOR >= ( leftarg = unit, rightarg = unit, procedure = unit_ge, commutator = <= , negator = < , restrict = scalargtsel, join = scalargtjoinsel ); CREATE OPERATOR > ( leftarg = unit, rightarg = unit, procedure = unit_gt, commutator = < , negator = <= , restrict = scalargtsel, join = scalargtjoinsel ); CREATE FUNCTION unit_cmp(unit, unit) RETURNS int4 AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR CLASS unit_ops DEFAULT FOR TYPE unit USING btree AS OPERATOR 1 < , OPERATOR 2 <= , OPERATOR 3 = , OPERATOR 4 >= , OPERATOR 5 > , FUNCTION 1 unit_cmp(unit, unit); -- aggregates CREATE AGGREGATE sum(unit) ( sfunc = unit_add, stype = unit ); CREATE FUNCTION unit_least(unit, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE AGGREGATE min(unit) ( sfunc = unit_least, stype = unit ); CREATE FUNCTION unit_greatest(unit, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE AGGREGATE max(unit) ( sfunc = unit_greatest, stype = unit ); CREATE TYPE unit_accum_t AS ( s unit, squares double precision, n bigint ); CREATE FUNCTION unit_accum(a unit_accum_t, u unit) RETURNS unit_accum_t AS $$SELECT (CASE WHEN a.s = '0'::unit THEN u ELSE a.s + u END, a.squares + value(u)^2, a.n + 1)::unit_accum_t$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION unit_avg(a unit_accum_t) RETURNS unit AS $$SELECT CASE WHEN a.n > 0 THEN a.s / a.n ELSE NULL END$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE AGGREGATE avg(unit) ( sfunc = unit_accum, stype = unit_accum_t, finalfunc = unit_avg, initcond = '(0,0,0)' ); CREATE FUNCTION unit_var_pop(a unit_accum_t) RETURNS double precision AS $$SELECT CASE WHEN a.n > 0 THEN (a.squares - value(a.s)^2 / a.n) / a.n ELSE NULL END$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE AGGREGATE var_pop(unit) ( sfunc = unit_accum, stype = unit_accum_t, finalfunc = unit_var_pop, initcond = '(0,0,0)' ); CREATE FUNCTION unit_var_samp(a unit_accum_t) RETURNS double precision AS $$SELECT CASE WHEN a.n > 1 THEN (a.squares - value(a.s)^2 / a.n) / (a.n - 1) WHEN a.n = 1 THEN 0 ELSE NULL END$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE AGGREGATE var_samp(unit) ( sfunc = unit_accum, stype = unit_accum_t, finalfunc = unit_var_samp, initcond = '(0,0,0)' ); CREATE AGGREGATE variance(unit) ( sfunc = unit_accum, stype = unit_accum_t, finalfunc = unit_var_samp, initcond = '(0,0,0)' ); CREATE FUNCTION unit_stddev_pop(a unit_accum_t) RETURNS unit AS $$SELECT CASE WHEN a.n > 0 THEN sqrt((a.squares - value(a.s)^2 / a.n) / a.n) * dimension(a.s) ELSE NULL END$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE AGGREGATE stddev_pop(unit) ( sfunc = unit_accum, stype = unit_accum_t, finalfunc = unit_stddev_pop, initcond = '(0,0,0)' ); CREATE FUNCTION unit_stddev_samp(a unit_accum_t) RETURNS unit AS $$SELECT CASE WHEN a.n > 1 THEN sqrt((a.squares - value(a.s)^2 / a.n) / (a.n - 1)) * dimension(a.s) WHEN a.n = 1 THEN 0 * dimension(a.s) ELSE NULL END$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE AGGREGATE stddev_samp(unit) ( sfunc = unit_accum, stype = unit_accum_t, finalfunc = unit_stddev_samp, initcond = '(0,0,0)' ); CREATE AGGREGATE stddev(unit) ( sfunc = unit_accum, stype = unit_accum_t, finalfunc = unit_stddev_samp, initcond = '(0,0,0)' ); -- internal functions CREATE FUNCTION unit_is_hashed(cstring) RETURNS bool AS '$libdir/unit' LANGUAGE C VOLATILE STRICT; CREATE FUNCTION unit_reset() RETURNS void AS '$libdir/unit' LANGUAGE C VOLATILE STRICT; postgresql-unit-7.8/unit--6--7.sql.in000066400000000000000000000065041450213077700173310ustar00rootroot00000000000000-- add recv/send functions CREATE FUNCTION unit_recv(internal) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_send(unit) RETURNS bytea AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; UPDATE pg_type SET typreceive = 'unit_recv', typsend = 'unit_send' WHERE typname = 'unit' AND typnamespace = '@extschema@'::regnamespace; INSERT INTO pg_depend (classid, objid, objsubid, refclassid, refobjid, refobjsubid, deptype) VALUES ('pg_type'::regclass, 'unit'::regtype, 0, 'pg_proc'::regclass, 'unit_recv'::regproc, 0, 'n'), ('pg_type'::regclass, 'unit'::regtype, 0, 'pg_proc'::regclass, 'unit_send'::regproc, 0, 'n'); -- convert @ from (unit, text)->cstring to (unit, text)->text DROP OPERATOR @ (unit, text); DROP FUNCTION unit_at(unit, text); CREATE FUNCTION unit_at(unit, text) RETURNS text SET search_path = @extschema@ AS '$libdir/unit', 'unit_at_text2' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR @ ( leftarg = unit, rightarg = text, procedure = unit_at ); -- strict comparisons CREATE FUNCTION unit_strict_lt(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_strict_le(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_strict_eq(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_strict_ne(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_strict_ge(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_strict_gt(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR << ( leftarg = unit, rightarg = unit, procedure = unit_strict_lt, commutator = >> , negator = >>= , restrict = scalarltsel, join = scalarltjoinsel ); CREATE OPERATOR <<= ( leftarg = unit, rightarg = unit, procedure = unit_strict_le, commutator = >>= , negator = >> , restrict = scalarltsel, join = scalarltjoinsel ); CREATE OPERATOR == ( leftarg = unit, rightarg = unit, procedure = unit_strict_eq, commutator = == , negator = <<>> , restrict = eqsel, join = eqjoinsel ); CREATE OPERATOR <<>> ( leftarg = unit, rightarg = unit, procedure = unit_strict_ne, commutator = <<>> , negator = == , restrict = neqsel, join = neqjoinsel ); CREATE OPERATOR >>= ( leftarg = unit, rightarg = unit, procedure = unit_strict_ge, commutator = <<= , negator = << , restrict = scalargtsel, join = scalargtjoinsel ); CREATE OPERATOR >> ( leftarg = unit, rightarg = unit, procedure = unit_strict_gt, commutator = << , negator = <<= , restrict = scalargtsel, join = scalargtjoinsel ); CREATE FUNCTION unit_strict_cmp(unit, unit) RETURNS int4 AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR CLASS unit_strict_ops FOR TYPE unit USING btree AS OPERATOR 1 << , OPERATOR 2 <<= , OPERATOR 3 == , OPERATOR 4 >>= , OPERATOR 5 >> , FUNCTION 1 unit_strict_cmp(unit, unit); -- range type CREATE FUNCTION unit_diff(unit, unit) RETURNS float8 AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; COMMENT ON FUNCTION unit_diff(unit, unit) IS 'returns difference of two units as float8 for use in the unitrange type'; CREATE TYPE unitrange AS RANGE ( SUBTYPE = unit, SUBTYPE_OPCLASS = unit_strict_ops, SUBTYPE_DIFF = unit_diff ); -- load prefixes and units tables SELECT unit_load(); postgresql-unit-7.8/unit--6.sql.in000066400000000000000000000404131450213077700171050ustar00rootroot00000000000000/* Copyright (C) 2016-2018 Christoph Berg This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ -- type definition CREATE TYPE unit; CREATE FUNCTION unit_in(cstring) RETURNS unit SET search_path = @extschema@ AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_out(unit) RETURNS cstring AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE TYPE unit ( internallength = 16, input = unit_in, output = unit_out, alignment = double ); -- prefix/unit definition tables CREATE TABLE unit_prefixes ( prefix varchar(32) PRIMARY KEY, factor double precision NOT NULL, definition text, -- original definition, informational dump boolean DEFAULT true ); SELECT pg_catalog.pg_extension_config_dump('unit_prefixes', 'WHERE dump'); CREATE TABLE unit_units ( name varchar(32) PRIMARY KEY, unit unit NOT NULL, shift double precision, -- NULL means 0.0 here definition text, -- original definition, informational dump boolean DEFAULT true ); SELECT pg_catalog.pg_extension_config_dump('unit_units', 'WHERE dump'); GRANT SELECT ON unit_prefixes, unit_units TO PUBLIC; CREATE FUNCTION unit_load() RETURNS VOID LANGUAGE plpgsql AS $$BEGIN DELETE FROM unit_prefixes WHERE dump IS NOT TRUE; CREATE TEMP TABLE tmp_prefixes (LIKE unit_prefixes) ON COMMIT DROP; COPY tmp_prefixes (prefix, factor, definition, dump) FROM '@MODULEDIR@/unit_prefixes.data'; INSERT INTO unit_prefixes SELECT * FROM tmp_prefixes t WHERE NOT EXISTS (SELECT prefix FROM unit_prefixes u WHERE u.prefix = t.prefix); DROP TABLE tmp_prefixes; DELETE FROM unit_units WHERE dump IS NOT TRUE; CREATE TEMP TABLE tmp_units (LIKE unit_units) ON COMMIT DROP; COPY tmp_units (name, unit, shift, definition, dump) FROM '@MODULEDIR@/unit_units.data'; INSERT INTO unit_units SELECT * FROM tmp_units t WHERE NOT EXISTS (SELECT name FROM unit_units u WHERE u.name = t.name); DROP TABLE tmp_units; END;$$; COMMENT ON FUNCTION unit_load() IS 'Loads/upgrades the unit_units and unit_prefixes contents from the data files on disk'; SELECT unit_load(); -- constructors CREATE FUNCTION unit(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'dbl2unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION meter(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_meter' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION kilogram(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_kilogram' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION second(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_second' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION ampere(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_ampere' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION kelvin(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_kelvin' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION mole(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_mole' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION candela(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_candela' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION byte(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_byte' LANGUAGE C IMMUTABLE STRICT; -- functions without operators CREATE FUNCTION value(unit) RETURNS double precision AS '$libdir/unit', 'unit_value' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION dimension(unit) RETURNS unit AS '$libdir/unit', 'unit_dimension' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION round(unit) RETURNS unit AS '$libdir/unit', 'unit_round' LANGUAGE C IMMUTABLE STRICT; -- operators CREATE FUNCTION unit_add(unit, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR + ( leftarg = unit, rightarg = unit, procedure = unit_add, commutator = + ); CREATE FUNCTION unit_sub(unit, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR - ( leftarg = unit, rightarg = unit, procedure = unit_sub ); CREATE FUNCTION unit_neg(unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR - ( rightarg = unit, procedure = unit_neg ); CREATE FUNCTION unit_mul(unit, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR * ( leftarg = unit, rightarg = unit, procedure = unit_mul, commutator = * ); CREATE FUNCTION dbl_unit_mul(double precision, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR * ( leftarg = double precision, rightarg = unit, procedure = dbl_unit_mul, commutator = * ); CREATE FUNCTION unit_dbl_mul(unit, double precision) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR * ( leftarg = unit, rightarg = double precision, procedure = unit_dbl_mul, commutator = * ); CREATE FUNCTION unit_div(unit, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR / ( leftarg = unit, rightarg = unit, procedure = unit_div ); CREATE FUNCTION dbl_unit_div(double precision, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR / ( leftarg = double precision, rightarg = unit, procedure = dbl_unit_div ); CREATE FUNCTION unit_dbl_div(unit, double precision) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR / ( leftarg = unit, rightarg = double precision, procedure = unit_dbl_div ); CREATE FUNCTION unit_pow(unit, int) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR ^ ( leftarg = unit, rightarg = int, procedure = unit_pow ); CREATE FUNCTION sqrt(unit) RETURNS unit AS '$libdir/unit', 'unit_sqrt' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR |/ ( rightarg = unit, procedure = sqrt ); CREATE FUNCTION cbrt(unit) RETURNS unit AS '$libdir/unit', 'unit_cbrt' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR ||/ ( rightarg = unit, procedure = cbrt ); CREATE FUNCTION unit_at(unit, text) RETURNS cstring SET search_path = @extschema@ AS '$libdir/unit', 'unit_at_text' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR @ ( leftarg = unit, rightarg = text, procedure = unit_at ); CREATE FUNCTION unit_at_double(unit, text) RETURNS double precision SET search_path = @extschema@ AS '$libdir/unit', 'unit_at_double' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR @@ ( leftarg = unit, rightarg = text, procedure = unit_at_double ); -- derived units CREATE FUNCTION radian (double precision DEFAULT 1.0) -- m·m^-1 RETURNS unit AS $$SELECT meter($1) / meter()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION steradian (double precision DEFAULT 1.0) -- m^2·m^-2 RETURNS unit AS $$SELECT meter($1) * meter() / meter()^2$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION hertz (double precision DEFAULT 1.0) -- s^-1 RETURNS unit AS $$SELECT $1 / second()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION newton (double precision DEFAULT 1.0) -- kg·m·s^-2 RETURNS unit AS $$SELECT kilogram($1) * meter() / second()^2$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION pascal (double precision DEFAULT 1.0) -- N/m^2 RETURNS unit AS $$SELECT newton($1) / meter()^2 $$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION joule (double precision DEFAULT 1.0) -- N·m RETURNS unit AS $$SELECT newton($1) * meter()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION watt (double precision DEFAULT 1.0) -- J/s RETURNS unit AS $$SELECT joule($1) / second()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION coulomb (double precision DEFAULT 1.0) -- A·s RETURNS unit AS $$SELECT ampere($1) * second()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION volt (double precision DEFAULT 1.0) -- W/A RETURNS unit AS $$SELECT watt($1) / ampere() $$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION farad (double precision DEFAULT 1.0) -- C/V RETURNS unit AS $$SELECT coulomb($1) / volt() $$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION ohm (double precision DEFAULT 1.0) -- V/A RETURNS unit AS $$SELECT volt($1) / ampere() $$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION siemens (double precision DEFAULT 1.0) -- A/V RETURNS unit AS $$SELECT ampere($1) / volt()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION weber (double precision DEFAULT 1.0) -- V·s RETURNS unit AS $$SELECT volt($1) * second()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION tesla (double precision DEFAULT 1.0) -- Wb/m^2 RETURNS unit AS $$SELECT weber($1) / meter()^2$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION henry (double precision DEFAULT 1.0) -- Wb/A RETURNS unit AS $$SELECT weber($1) / ampere()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION celsius (double precision DEFAULT 0.0) -- K relative to 273.15, default to 0°C RETURNS unit AS $$SELECT kelvin($1 + 273.15)$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION lumen (double precision DEFAULT 1.0) -- cd·sr RETURNS unit AS $$SELECT candela($1) * steradian()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION lux (double precision DEFAULT 1.0) -- lm/m^2 RETURNS unit AS $$SELECT lumen($1) / meter()^2$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION becquerel (double precision DEFAULT 1.0) -- s^-1 RETURNS unit AS $$SELECT $1 / second()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION gray (double precision DEFAULT 1.0) -- J/kg RETURNS unit AS $$SELECT joule($1) / kilogram()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION sievert (double precision DEFAULT 1.0) -- J/kg RETURNS unit AS $$SELECT joule($1)/ kilogram()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION katal (double precision DEFAULT 1.0) -- mol·s^-1 RETURNS unit AS $$SELECT mole($1) / second()$$ LANGUAGE SQL IMMUTABLE STRICT; -- Non-SI units accepted for use with the SI --minute, hour, day, degree of arc, minute of arc, second of arc, hectare, litre, tonne, astronomical unit and [deci]bel CREATE FUNCTION minute (double precision DEFAULT 1.0) RETURNS unit AS $$SELECT second($1 * 60)$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION hour (double precision DEFAULT 1.0) RETURNS unit AS $$SELECT second($1 * 3600)$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION day (double precision DEFAULT 1.0) RETURNS unit AS $$SELECT second($1 * 86400)$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION degree_arc(double precision DEFAULT 1.0) RETURNS unit AS $$SELECT $1 * '1'::unit * pi() / 180$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION minute_arc(double precision DEFAULT 1.0) RETURNS unit AS $$SELECT $1 * '1'::unit * pi() / 180 / 60$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION second_arc(double precision DEFAULT 1.0) RETURNS unit AS $$SELECT $1 * '1'::unit * pi() / 180 / 3600$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION hectare (double precision DEFAULT 1.0) RETURNS unit AS $$SELECT $1 * meter(100)^2$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION liter (double precision DEFAULT 1.0) RETURNS unit AS $$SELECT $1 * meter(0.1)^3$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION tonne (double precision DEFAULT 1.0) RETURNS unit AS $$SELECT kilogram($1 * 1000)$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION au (double precision DEFAULT 1.0) RETURNS unit AS $$SELECT meter($1 * 149597870700)$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION decibel (double precision DEFAULT 0.0) RETURNS double precision AS $$SELECT 10.0^($1 / 10.0)$$ LANGUAGE SQL IMMUTABLE STRICT; -- comparisons CREATE FUNCTION unit_lt(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_le(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_eq(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_ne(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_ge(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_gt(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR < ( leftarg = unit, rightarg = unit, procedure = unit_lt, commutator = > , negator = >= , restrict = scalarltsel, join = scalarltjoinsel ); CREATE OPERATOR <= ( leftarg = unit, rightarg = unit, procedure = unit_le, commutator = >= , negator = > , restrict = scalarltsel, join = scalarltjoinsel ); CREATE OPERATOR = ( leftarg = unit, rightarg = unit, procedure = unit_eq, commutator = = , negator = <> , restrict = eqsel, join = eqjoinsel ); CREATE OPERATOR <> ( leftarg = unit, rightarg = unit, procedure = unit_ne, commutator = <> , negator = = , restrict = neqsel, join = neqjoinsel ); CREATE OPERATOR >= ( leftarg = unit, rightarg = unit, procedure = unit_ge, commutator = <= , negator = < , restrict = scalargtsel, join = scalargtjoinsel ); CREATE OPERATOR > ( leftarg = unit, rightarg = unit, procedure = unit_gt, commutator = < , negator = <= , restrict = scalargtsel, join = scalargtjoinsel ); CREATE FUNCTION unit_cmp(unit, unit) RETURNS int4 AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR CLASS unit_ops DEFAULT FOR TYPE unit USING btree AS OPERATOR 1 < , OPERATOR 2 <= , OPERATOR 3 = , OPERATOR 4 >= , OPERATOR 5 > , FUNCTION 1 unit_cmp(unit, unit); -- aggregates CREATE AGGREGATE sum(unit) ( sfunc = unit_add, stype = unit ); CREATE FUNCTION unit_least(unit, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE AGGREGATE min(unit) ( sfunc = unit_least, stype = unit ); CREATE FUNCTION unit_greatest(unit, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE AGGREGATE max(unit) ( sfunc = unit_greatest, stype = unit ); CREATE TYPE unit_accum_t AS ( s unit, squares double precision, n bigint ); CREATE FUNCTION unit_accum(a unit_accum_t, u unit) RETURNS unit_accum_t AS $$SELECT (CASE WHEN a.s = '0'::unit THEN u ELSE a.s + u END, a.squares + value(u)^2, a.n + 1)::unit_accum_t$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION unit_avg(a unit_accum_t) RETURNS unit AS $$SELECT CASE WHEN a.n > 0 THEN a.s / a.n ELSE NULL END$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE AGGREGATE avg(unit) ( sfunc = unit_accum, stype = unit_accum_t, finalfunc = unit_avg, initcond = '(0,0,0)' ); CREATE FUNCTION unit_var_pop(a unit_accum_t) RETURNS double precision AS $$SELECT CASE WHEN a.n > 0 THEN (a.squares - value(a.s)^2 / a.n) / a.n ELSE NULL END$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE AGGREGATE var_pop(unit) ( sfunc = unit_accum, stype = unit_accum_t, finalfunc = unit_var_pop, initcond = '(0,0,0)' ); CREATE FUNCTION unit_var_samp(a unit_accum_t) RETURNS double precision AS $$SELECT CASE WHEN a.n > 1 THEN (a.squares - value(a.s)^2 / a.n) / (a.n - 1) WHEN a.n = 1 THEN 0 ELSE NULL END$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE AGGREGATE var_samp(unit) ( sfunc = unit_accum, stype = unit_accum_t, finalfunc = unit_var_samp, initcond = '(0,0,0)' ); CREATE AGGREGATE variance(unit) ( sfunc = unit_accum, stype = unit_accum_t, finalfunc = unit_var_samp, initcond = '(0,0,0)' ); CREATE FUNCTION unit_stddev_pop(a unit_accum_t) RETURNS unit AS $$SELECT CASE WHEN a.n > 0 THEN sqrt((a.squares - value(a.s)^2 / a.n) / a.n) * dimension(a.s) ELSE NULL END$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE AGGREGATE stddev_pop(unit) ( sfunc = unit_accum, stype = unit_accum_t, finalfunc = unit_stddev_pop, initcond = '(0,0,0)' ); CREATE FUNCTION unit_stddev_samp(a unit_accum_t) RETURNS unit AS $$SELECT CASE WHEN a.n > 1 THEN sqrt((a.squares - value(a.s)^2 / a.n) / (a.n - 1)) * dimension(a.s) WHEN a.n = 1 THEN 0 * dimension(a.s) ELSE NULL END$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE AGGREGATE stddev_samp(unit) ( sfunc = unit_accum, stype = unit_accum_t, finalfunc = unit_stddev_samp, initcond = '(0,0,0)' ); CREATE AGGREGATE stddev(unit) ( sfunc = unit_accum, stype = unit_accum_t, finalfunc = unit_stddev_samp, initcond = '(0,0,0)' ); -- internal functions CREATE FUNCTION unit_is_hashed(cstring) RETURNS bool AS '$libdir/unit' LANGUAGE C VOLATILE STRICT; CREATE FUNCTION unit_reset() RETURNS void AS '$libdir/unit' LANGUAGE C VOLATILE STRICT; postgresql-unit-7.8/unit--7.sql.in000066400000000000000000000454151450213077700171150ustar00rootroot00000000000000/* Copyright (C) 2016-2018 Christoph Berg This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ -- type definition CREATE TYPE unit; CREATE FUNCTION unit_in(cstring) RETURNS unit SET search_path = @extschema@ AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_out(unit) RETURNS cstring AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_recv(internal) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_send(unit) RETURNS bytea AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE TYPE unit ( internallength = 16, input = unit_in, output = unit_out, receive = unit_recv, send = unit_send, alignment = double ); -- prefix/unit definition tables CREATE TABLE unit_prefixes ( prefix varchar(32) PRIMARY KEY, factor double precision NOT NULL, definition text, -- original definition, informational dump boolean DEFAULT true ); SELECT pg_catalog.pg_extension_config_dump('unit_prefixes', 'WHERE dump'); CREATE TABLE unit_units ( name varchar(32) PRIMARY KEY, unit unit NOT NULL, shift double precision, -- NULL means 0.0 here definition text, -- original definition, informational dump boolean DEFAULT true ); SELECT pg_catalog.pg_extension_config_dump('unit_units', 'WHERE dump'); GRANT SELECT ON unit_prefixes, unit_units TO PUBLIC; CREATE FUNCTION unit_load() RETURNS VOID LANGUAGE plpgsql AS $$BEGIN DELETE FROM unit_prefixes WHERE dump IS NOT TRUE; CREATE TEMP TABLE tmp_prefixes (LIKE unit_prefixes) ON COMMIT DROP; COPY tmp_prefixes (prefix, factor, definition, dump) FROM '@MODULEDIR@/unit_prefixes.data'; INSERT INTO unit_prefixes SELECT * FROM tmp_prefixes t WHERE NOT EXISTS (SELECT prefix FROM unit_prefixes u WHERE u.prefix = t.prefix); DROP TABLE tmp_prefixes; DELETE FROM unit_units WHERE dump IS NOT TRUE; CREATE TEMP TABLE tmp_units (LIKE unit_units) ON COMMIT DROP; COPY tmp_units (name, unit, shift, definition, dump) FROM '@MODULEDIR@/unit_units.data'; INSERT INTO unit_units SELECT * FROM tmp_units t WHERE NOT EXISTS (SELECT name FROM unit_units u WHERE u.name = t.name); DROP TABLE tmp_units; END;$$; COMMENT ON FUNCTION unit_load() IS 'Loads/upgrades the unit_units and unit_prefixes contents from the data files on disk'; SELECT unit_load(); -- constructors CREATE FUNCTION unit(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'dbl2unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION meter(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_meter' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION kilogram(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_kilogram' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION second(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_second' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION ampere(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_ampere' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION kelvin(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_kelvin' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION mole(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_mole' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION candela(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_candela' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION byte(double precision DEFAULT 1.0) RETURNS unit AS '$libdir/unit', 'unit_byte' LANGUAGE C IMMUTABLE STRICT; -- functions without operators CREATE FUNCTION value(unit) RETURNS double precision AS '$libdir/unit', 'unit_value' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION dimension(unit) RETURNS unit AS '$libdir/unit', 'unit_dimension' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION round(unit) RETURNS unit AS '$libdir/unit', 'unit_round' LANGUAGE C IMMUTABLE STRICT; -- operators CREATE FUNCTION unit_add(unit, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR + ( leftarg = unit, rightarg = unit, procedure = unit_add, commutator = + ); CREATE FUNCTION unit_sub(unit, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR - ( leftarg = unit, rightarg = unit, procedure = unit_sub ); CREATE FUNCTION unit_neg(unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR - ( rightarg = unit, procedure = unit_neg ); CREATE FUNCTION unit_mul(unit, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR * ( leftarg = unit, rightarg = unit, procedure = unit_mul, commutator = * ); CREATE FUNCTION dbl_unit_mul(double precision, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR * ( leftarg = double precision, rightarg = unit, procedure = dbl_unit_mul, commutator = * ); CREATE FUNCTION unit_dbl_mul(unit, double precision) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR * ( leftarg = unit, rightarg = double precision, procedure = unit_dbl_mul, commutator = * ); CREATE FUNCTION unit_div(unit, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR / ( leftarg = unit, rightarg = unit, procedure = unit_div ); CREATE FUNCTION dbl_unit_div(double precision, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR / ( leftarg = double precision, rightarg = unit, procedure = dbl_unit_div ); CREATE FUNCTION unit_dbl_div(unit, double precision) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR / ( leftarg = unit, rightarg = double precision, procedure = unit_dbl_div ); CREATE FUNCTION unit_pow(unit, int) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR ^ ( leftarg = unit, rightarg = int, procedure = unit_pow ); CREATE FUNCTION sqrt(unit) RETURNS unit AS '$libdir/unit', 'unit_sqrt' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR |/ ( rightarg = unit, procedure = sqrt ); CREATE FUNCTION cbrt(unit) RETURNS unit AS '$libdir/unit', 'unit_cbrt' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR ||/ ( rightarg = unit, procedure = cbrt ); CREATE FUNCTION unit_at(unit, text) RETURNS text SET search_path = @extschema@ AS '$libdir/unit', 'unit_at_text2' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR @ ( leftarg = unit, rightarg = text, procedure = unit_at ); CREATE FUNCTION unit_at_double(unit, text) RETURNS double precision SET search_path = @extschema@ AS '$libdir/unit', 'unit_at_double' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR @@ ( leftarg = unit, rightarg = text, procedure = unit_at_double ); -- derived units CREATE FUNCTION radian (double precision DEFAULT 1.0) -- m·m^-1 RETURNS unit AS $$SELECT meter($1) / meter()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION steradian (double precision DEFAULT 1.0) -- m^2·m^-2 RETURNS unit AS $$SELECT meter($1) * meter() / meter()^2$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION hertz (double precision DEFAULT 1.0) -- s^-1 RETURNS unit AS $$SELECT $1 / second()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION newton (double precision DEFAULT 1.0) -- kg·m·s^-2 RETURNS unit AS $$SELECT kilogram($1) * meter() / second()^2$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION pascal (double precision DEFAULT 1.0) -- N/m^2 RETURNS unit AS $$SELECT newton($1) / meter()^2 $$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION joule (double precision DEFAULT 1.0) -- N·m RETURNS unit AS $$SELECT newton($1) * meter()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION watt (double precision DEFAULT 1.0) -- J/s RETURNS unit AS $$SELECT joule($1) / second()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION coulomb (double precision DEFAULT 1.0) -- A·s RETURNS unit AS $$SELECT ampere($1) * second()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION volt (double precision DEFAULT 1.0) -- W/A RETURNS unit AS $$SELECT watt($1) / ampere() $$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION farad (double precision DEFAULT 1.0) -- C/V RETURNS unit AS $$SELECT coulomb($1) / volt() $$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION ohm (double precision DEFAULT 1.0) -- V/A RETURNS unit AS $$SELECT volt($1) / ampere() $$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION siemens (double precision DEFAULT 1.0) -- A/V RETURNS unit AS $$SELECT ampere($1) / volt()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION weber (double precision DEFAULT 1.0) -- V·s RETURNS unit AS $$SELECT volt($1) * second()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION tesla (double precision DEFAULT 1.0) -- Wb/m^2 RETURNS unit AS $$SELECT weber($1) / meter()^2$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION henry (double precision DEFAULT 1.0) -- Wb/A RETURNS unit AS $$SELECT weber($1) / ampere()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION celsius (double precision DEFAULT 0.0) -- K relative to 273.15, default to 0°C RETURNS unit AS $$SELECT kelvin($1 + 273.15)$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION lumen (double precision DEFAULT 1.0) -- cd·sr RETURNS unit AS $$SELECT candela($1) * steradian()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION lux (double precision DEFAULT 1.0) -- lm/m^2 RETURNS unit AS $$SELECT lumen($1) / meter()^2$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION becquerel (double precision DEFAULT 1.0) -- s^-1 RETURNS unit AS $$SELECT $1 / second()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION gray (double precision DEFAULT 1.0) -- J/kg RETURNS unit AS $$SELECT joule($1) / kilogram()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION sievert (double precision DEFAULT 1.0) -- J/kg RETURNS unit AS $$SELECT joule($1)/ kilogram()$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION katal (double precision DEFAULT 1.0) -- mol·s^-1 RETURNS unit AS $$SELECT mole($1) / second()$$ LANGUAGE SQL IMMUTABLE STRICT; -- Non-SI units accepted for use with the SI --minute, hour, day, degree of arc, minute of arc, second of arc, hectare, litre, tonne, astronomical unit and [deci]bel CREATE FUNCTION minute (double precision DEFAULT 1.0) RETURNS unit AS $$SELECT second($1 * 60)$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION hour (double precision DEFAULT 1.0) RETURNS unit AS $$SELECT second($1 * 3600)$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION day (double precision DEFAULT 1.0) RETURNS unit AS $$SELECT second($1 * 86400)$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION degree_arc(double precision DEFAULT 1.0) RETURNS unit AS $$SELECT $1 * '1'::unit * pi() / 180$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION minute_arc(double precision DEFAULT 1.0) RETURNS unit AS $$SELECT $1 * '1'::unit * pi() / 180 / 60$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION second_arc(double precision DEFAULT 1.0) RETURNS unit AS $$SELECT $1 * '1'::unit * pi() / 180 / 3600$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION hectare (double precision DEFAULT 1.0) RETURNS unit AS $$SELECT $1 * meter(100)^2$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION liter (double precision DEFAULT 1.0) RETURNS unit AS $$SELECT $1 * meter(0.1)^3$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION tonne (double precision DEFAULT 1.0) RETURNS unit AS $$SELECT kilogram($1 * 1000)$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION au (double precision DEFAULT 1.0) RETURNS unit AS $$SELECT meter($1 * 149597870700)$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION decibel (double precision DEFAULT 0.0) RETURNS double precision AS $$SELECT 10.0^($1 / 10.0)$$ LANGUAGE SQL IMMUTABLE STRICT; -- comparisons CREATE FUNCTION unit_lt(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_le(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_eq(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_ne(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_ge(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_gt(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR < ( leftarg = unit, rightarg = unit, procedure = unit_lt, commutator = > , negator = >= , restrict = scalarltsel, join = scalarltjoinsel ); CREATE OPERATOR <= ( leftarg = unit, rightarg = unit, procedure = unit_le, commutator = >= , negator = > , restrict = scalarltsel, join = scalarltjoinsel ); CREATE OPERATOR = ( leftarg = unit, rightarg = unit, procedure = unit_eq, commutator = = , negator = <> , restrict = eqsel, join = eqjoinsel ); CREATE OPERATOR <> ( leftarg = unit, rightarg = unit, procedure = unit_ne, commutator = <> , negator = = , restrict = neqsel, join = neqjoinsel ); CREATE OPERATOR >= ( leftarg = unit, rightarg = unit, procedure = unit_ge, commutator = <= , negator = < , restrict = scalargtsel, join = scalargtjoinsel ); CREATE OPERATOR > ( leftarg = unit, rightarg = unit, procedure = unit_gt, commutator = < , negator = <= , restrict = scalargtsel, join = scalargtjoinsel ); CREATE FUNCTION unit_cmp(unit, unit) RETURNS int4 AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR CLASS unit_ops DEFAULT FOR TYPE unit USING btree AS OPERATOR 1 < , OPERATOR 2 <= , OPERATOR 3 = , OPERATOR 4 >= , OPERATOR 5 > , FUNCTION 1 unit_cmp(unit, unit); -- strict comparisons CREATE FUNCTION unit_strict_lt(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_strict_le(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_strict_eq(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_strict_ne(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_strict_ge(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE FUNCTION unit_strict_gt(unit, unit) RETURNS bool AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR << ( leftarg = unit, rightarg = unit, procedure = unit_strict_lt, commutator = >> , negator = >>= , restrict = scalarltsel, join = scalarltjoinsel ); CREATE OPERATOR <<= ( leftarg = unit, rightarg = unit, procedure = unit_strict_le, commutator = >>= , negator = >> , restrict = scalarltsel, join = scalarltjoinsel ); CREATE OPERATOR == ( leftarg = unit, rightarg = unit, procedure = unit_strict_eq, commutator = == , negator = <<>> , restrict = eqsel, join = eqjoinsel ); CREATE OPERATOR <<>> ( leftarg = unit, rightarg = unit, procedure = unit_strict_ne, commutator = <<>> , negator = == , restrict = neqsel, join = neqjoinsel ); CREATE OPERATOR >>= ( leftarg = unit, rightarg = unit, procedure = unit_strict_ge, commutator = <<= , negator = << , restrict = scalargtsel, join = scalargtjoinsel ); CREATE OPERATOR >> ( leftarg = unit, rightarg = unit, procedure = unit_strict_gt, commutator = << , negator = <<= , restrict = scalargtsel, join = scalargtjoinsel ); CREATE FUNCTION unit_strict_cmp(unit, unit) RETURNS int4 AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE OPERATOR CLASS unit_strict_ops FOR TYPE unit USING btree AS OPERATOR 1 << , OPERATOR 2 <<= , OPERATOR 3 == , OPERATOR 4 >>= , OPERATOR 5 >> , FUNCTION 1 unit_strict_cmp(unit, unit); -- range type CREATE FUNCTION unit_diff(unit, unit) RETURNS float8 AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; COMMENT ON FUNCTION unit_diff(unit, unit) IS 'returns difference of two units as float8 for use in the unitrange type'; CREATE TYPE unitrange AS RANGE ( SUBTYPE = unit, SUBTYPE_OPCLASS = unit_strict_ops, SUBTYPE_DIFF = unit_diff ); -- aggregates CREATE AGGREGATE sum(unit) ( sfunc = unit_add, stype = unit ); CREATE FUNCTION unit_least(unit, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE AGGREGATE min(unit) ( sfunc = unit_least, stype = unit ); CREATE FUNCTION unit_greatest(unit, unit) RETURNS unit AS '$libdir/unit' LANGUAGE C IMMUTABLE STRICT; CREATE AGGREGATE max(unit) ( sfunc = unit_greatest, stype = unit ); CREATE TYPE unit_accum_t AS ( s unit, squares double precision, n bigint ); CREATE FUNCTION unit_accum(a unit_accum_t, u unit) RETURNS unit_accum_t AS $$SELECT (CASE WHEN a.s = '0'::unit THEN u ELSE a.s + u END, a.squares + value(u)^2, a.n + 1)::unit_accum_t$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE FUNCTION unit_avg(a unit_accum_t) RETURNS unit AS $$SELECT CASE WHEN a.n > 0 THEN a.s / a.n ELSE NULL END$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE AGGREGATE avg(unit) ( sfunc = unit_accum, stype = unit_accum_t, finalfunc = unit_avg, initcond = '(0,0,0)' ); CREATE FUNCTION unit_var_pop(a unit_accum_t) RETURNS double precision AS $$SELECT CASE WHEN a.n > 0 THEN (a.squares - value(a.s)^2 / a.n) / a.n ELSE NULL END$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE AGGREGATE var_pop(unit) ( sfunc = unit_accum, stype = unit_accum_t, finalfunc = unit_var_pop, initcond = '(0,0,0)' ); CREATE FUNCTION unit_var_samp(a unit_accum_t) RETURNS double precision AS $$SELECT CASE WHEN a.n > 1 THEN (a.squares - value(a.s)^2 / a.n) / (a.n - 1) WHEN a.n = 1 THEN 0 ELSE NULL END$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE AGGREGATE var_samp(unit) ( sfunc = unit_accum, stype = unit_accum_t, finalfunc = unit_var_samp, initcond = '(0,0,0)' ); CREATE AGGREGATE variance(unit) ( sfunc = unit_accum, stype = unit_accum_t, finalfunc = unit_var_samp, initcond = '(0,0,0)' ); CREATE FUNCTION unit_stddev_pop(a unit_accum_t) RETURNS unit AS $$SELECT CASE WHEN a.n > 0 THEN sqrt((a.squares - value(a.s)^2 / a.n) / a.n) * dimension(a.s) ELSE NULL END$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE AGGREGATE stddev_pop(unit) ( sfunc = unit_accum, stype = unit_accum_t, finalfunc = unit_stddev_pop, initcond = '(0,0,0)' ); CREATE FUNCTION unit_stddev_samp(a unit_accum_t) RETURNS unit AS $$SELECT CASE WHEN a.n > 1 THEN sqrt((a.squares - value(a.s)^2 / a.n) / (a.n - 1)) * dimension(a.s) WHEN a.n = 1 THEN 0 * dimension(a.s) ELSE NULL END$$ LANGUAGE SQL IMMUTABLE STRICT; CREATE AGGREGATE stddev_samp(unit) ( sfunc = unit_accum, stype = unit_accum_t, finalfunc = unit_stddev_samp, initcond = '(0,0,0)' ); CREATE AGGREGATE stddev(unit) ( sfunc = unit_accum, stype = unit_accum_t, finalfunc = unit_stddev_samp, initcond = '(0,0,0)' ); -- internal functions CREATE FUNCTION unit_is_hashed(cstring) RETURNS bool AS '$libdir/unit' LANGUAGE C VOLATILE STRICT; CREATE FUNCTION unit_reset() RETURNS void AS '$libdir/unit' LANGUAGE C VOLATILE STRICT; postgresql-unit-7.8/unit.c000066400000000000000000001010541450213077700157020ustar00rootroot00000000000000/* Copyright (C) 2016-2023 Christoph Berg This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ #include "postgres.h" #include "fmgr.h" #include "libpq/pqformat.h" /* send/recv */ #include "utils/builtins.h" /* cstring_to_text (needed on 9.5) */ #include "utils/guc.h" #if PG_VERSION_NUM >= 120000 #include "utils/float.h" /* extra_float_digits */ #endif #include "utils/hsearch.h" #include #include "unit.h" #include "defined_units.h" #include "powers.h" #include "float8out_unit.h" /* global variables */ static bool unit_output_superscript; static bool unit_time_output_custom; static bool unit_byte_output_iec; static bool unit_output_base_units; HTAB *unit_names; static HTAB *unit_dimensions; /* unit definitions */ void unit_get_definitions(void); void unit_get_definitions(void) { HASHCTL hinfo = { 0 }; int i; unit_names_t *unit_name; unit_dimensions_t *unit_dim; static HTAB *tmp_unit_names; static HTAB *tmp_unit_dimensions; /* unit_names: char *name -> Unit unit * Lookup table that initially contains the base units and will cache all * units resolved at run time */ hinfo.keysize = UNIT_NAME_LENGTH; hinfo.entrysize = sizeof(unit_names_t); Assert(UNIT_NAME_LENGTH + sizeof(UnitShift) == sizeof(unit_names_t)); tmp_unit_names = hash_create("unit_names", 20, &hinfo, #if PG_VERSION_NUM >= 140000 HASH_STRINGS | #endif HASH_ELEM); /* Set keysize and entrysize */ PG_TRY(); { for (i = 0; i < N_UNITS; i++) { unit_name = hash_search(tmp_unit_names, base_units[i], HASH_ENTER, NULL); strlcpy(unit_name->name, base_units[i], UNIT_NAME_LENGTH); unit_name->unit_shift.unit.value = 1.0; memset(unit_name->unit_shift.unit.units, 0, N_UNITS); unit_name->unit_shift.unit.units[i] = 1; unit_name->unit_shift.shift = 0.0; } } PG_CATCH(); { /* free partially initialized table */ hash_destroy(tmp_unit_names); PG_RE_THROW(); } PG_END_TRY(); /* No OOM errors were thrown, use the new table */ if (unit_names) hash_destroy(unit_names); unit_names = tmp_unit_names; /* unit_dimensions: char dimension[N_UNITS] -> char *name * Lookup table for formatting the well-known derived units on output */ hinfo.keysize = N_UNITS; hinfo.entrysize = sizeof(unit_dimensions_t); Assert(N_UNITS + UNIT_NAME_LENGTH == sizeof(unit_dimensions_t)); tmp_unit_dimensions = hash_create("unit_dimensions", 20, &hinfo, HASH_ELEM | HASH_BLOBS); PG_TRY(); { for (i = 0; si_derived_units[i].name; i++) { unit_dim = hash_search(tmp_unit_dimensions, si_derived_units[i].units, HASH_ENTER, NULL); memcpy(unit_dim->units, si_derived_units[i].units, N_UNITS); strlcpy(unit_dim->name, si_derived_units[i].name, UNIT_NAME_LENGTH); } } PG_CATCH(); { /* free partially initialized table */ hash_destroy(tmp_unit_dimensions); PG_RE_THROW(); } PG_END_TRY(); /* No OOM errors were thrown, use the new table */ if (unit_dimensions) hash_destroy(unit_dimensions); unit_dimensions = tmp_unit_dimensions; } /* module initialization */ PG_MODULE_MAGIC; void _PG_init(void); void _PG_init(void) { DefineCustomBoolVariable("unit.output_superscript", "Output unit exponents using Unicode superscripts", "Set to on to output unit exponents using Unicode superscripts", &unit_output_superscript, false, PGC_USERSET, 0, /* no flags */ NULL, NULL, NULL); DefineCustomBoolVariable("unit.time_output_custom", "Output time values in minutes, hours, days, and julianyears", "Set to on to output time unit values greater or equal to 60 s " "using minutes, hours, days, and julianyears instead of seconds " "with SI prefixes", &unit_time_output_custom, true, PGC_USERSET, 0, /* no flags */ NULL, NULL, NULL); DefineCustomBoolVariable("unit.byte_output_iec", "Output byte unit values with binary IEC prefixes", "Set to on to output byte unit values using binary IEC prefixes " "instead of decimal SI prefixes", &unit_byte_output_iec, false, PGC_USERSET, 0, /* no flags */ NULL, NULL, NULL); DefineCustomBoolVariable("unit.output_base_units", "Output unit values using base units without prefixes", "Set to on to output unit values using base units only " "and without prefixes", &unit_output_base_units, false, PGC_USERSET, 0, /* no flags */ NULL, NULL, NULL); EmitWarningsOnPlaceholders("unit"); unit_get_definitions(); } /* internal functions */ static char *superscripts[] = { "⁰", "¹", "²", "³", "⁴", "⁵", "⁶", "⁷", "⁸", "⁹", }; static void print_exponent (char **output_p, int e) { if (unit_output_superscript) { char ascii_exp[5]; int i = 0; sprintf(ascii_exp, "%d", e); if (ascii_exp[0] == '-') { *output_p += sprintf(*output_p, "%s", "⁻"); i++; } for (; ascii_exp[i] != '\0'; i++) { Assert (ascii_exp[i] >= '0' && ascii_exp[i] <= '9'); *output_p += sprintf(*output_p, "%s", superscripts[ascii_exp[i] - '0']); } } else { *output_p += sprintf(*output_p, "^%d", e); } } /* this function is used to format time values of at least one minute */ static void print_time_interval (char **output_p, double t) { int h, m; char *sign = "+"; int ndig; /* print - */ if (t < 0) { *output_p += sprintf(*output_p, "-"); t = -t; sign = "-"; } ndig = DBL_DIG #if PG_VERSION_NUM >= 120000 + (extra_float_digits == 1 ? 0 : extra_float_digits) /* revert to pre-12 default */ #else + extra_float_digits #endif - log10(t); /* adjust seconds precision for d/h/min already printed */ /* print years */ if (t >= TIME_YEAR) { double years = trunc(t / TIME_YEAR); t = fmod(t, TIME_YEAR); *output_p += sprintf(*output_p, "%g " TIME_YEAR_NAME, years); if (t != 0) *output_p += sprintf(*output_p, " %s ", sign); } if (t == 0) return; /* print days */ if (t >= TIME_DAY) { int days = trunc(t / TIME_DAY); t = fmod(t, TIME_DAY); *output_p += sprintf(*output_p, "%d d", days); if (t != 0) *output_p += sprintf(*output_p, " %s ", sign); } if (t == 0) return; /* print hh:mm: */ h = trunc(t / TIME_HOUR); t = fmod(t, TIME_HOUR); m = trunc(t / TIME_MINUTE); t = fmod(t, TIME_MINUTE); *output_p += sprintf(*output_p, "%02d:%02d:", h, m); /* print ss.sss */ if (t < 10.0) /* zero-pad */ *output_p += sprintf(*output_p, "0"); if (ndig < 0) ndig = 0; *output_p += sprintf(*output_p, "%.*f", ndig, t); if (ndig > 0) { /* strip trailing zeros from %f format */ while (*(*output_p - 1) == '0') { --*output_p; } if (*(*output_p - 1) == '.') { --*output_p; } **output_p = '\0'; } *output_p += sprintf(*output_p, " s"); } /* format Unit as string */ char * unit_cstring (Unit *unit) { int i; int n_numerator = 0; int u_numerator = -1; unit_dimensions_t *derived_unit = NULL; char *output; char *output_p; bool numerator = false; bool denominator = false; /* check if this is a combination of base units we have a specific name for */ derived_unit = hash_search(unit_dimensions, unit->units, HASH_FIND, NULL); if (! derived_unit) /* otherwise, sum up positive exponents */ for (i = 0; i < N_UNITS; i++) { if (unit->units[i] > 0) { n_numerator += unit->units[i]; u_numerator = i; } } output_p = output = palloc(128); #define print_output(...) output_p += sprintf(output_p, __VA_ARGS__); /* case 1a: kg in numerator (exponent 1): print with SI prefix */ if (!unit_output_base_units && n_numerator == 1 && u_numerator == UNIT_kg) { double v_abs = fabs(unit->value); char *prefix = "k"; double factor = 1.0; if (v_abs >= POWER_30) { /* do nothing */ } else if (v_abs >= POWER_27) { prefix = "Q"; factor = 1e-27; } else if (v_abs >= POWER_24) { prefix = "R"; factor = 1e-24; } else if (v_abs >= POWER_21) { prefix = "Y"; factor = 1e-21; } else if (v_abs >= POWER_18) { prefix = "Z"; factor = 1e-18; } else if (v_abs >= POWER_15) { prefix = "E"; factor = 1e-15; } else if (v_abs >= POWER_12) { prefix = "P"; factor = 1e-12; } else if (v_abs >= POWER_9) { prefix = "T"; factor = 1e-9; } else if (v_abs >= POWER_6) { prefix = "G"; factor = 1e-6; } else if (v_abs >= POWER_3) { prefix = "M"; factor = 1e-3; } else if (v_abs >= POWER_0) { prefix = "k"; } else if (v_abs >= POWER__3) { prefix = ""; factor = 1e3; } else if (v_abs >= POWER__6) { prefix = "m"; factor = 1e6; } else if (v_abs >= POWER__9) { prefix = "µ"; factor = 1e9; } else if (v_abs >= POWER__12) { prefix = "n"; factor = 1e12; } else if (v_abs >= POWER__15) { prefix = "p"; factor = 1e15; } else if (v_abs >= POWER__18) { prefix = "f"; factor = 1e18; } else if (v_abs >= POWER__21) { prefix = "a"; factor = 1e21; } else if (v_abs >= POWER__24) { prefix = "z"; factor = 1e24; } else if (v_abs >= POWER__27) { prefix = "y"; factor = 1e27; } else if (v_abs >= POWER__30) { prefix = "r"; factor = 1e30; } else if (v_abs >= POWER__33) { prefix = "q"; factor = 1e33; } /* else: smaller value or 0 (or -0), print using kg */ print_output("%s %sg", float8out_unit (unit->value * factor), prefix); /* gram with SI prefix */ numerator = true; /* case 1b: byte in numerator (exponent 1), and binary IEC prefix requested */ } else if (!unit_output_base_units && n_numerator == 1 && u_numerator == UNIT_B && unit_byte_output_iec) { double v_abs = fabs(unit->value); char *prefix = ""; double factor = 1.0; if (v_abs >= 0x1p+110) { // do nothing } else if (v_abs >= 0x1p+100) { prefix = "Qi"; factor = 0x1p-100; } else if (v_abs >= 0x1p+90) { prefix = "Ri"; factor = 0x1p-90; } else if (v_abs >= 0x1p+80) { prefix = "Yi"; factor = 0x1p-80; } else if (v_abs >= 0x1p+70) { prefix = "Zi"; factor = 0x1p-70; } else if (v_abs >= 0x1p+60) { prefix = "Ei"; factor = 0x1p-60; } else if (v_abs >= 0x1p+50) { prefix = "Pi"; factor = 0x1p-50; } else if (v_abs >= 0x1p+40) { prefix = "Ti"; factor = 0x1p-40; } else if (v_abs >= 0x1p+30) { prefix = "Gi"; factor = 0x1p-30; } else if (v_abs >= 0x1p+20) { prefix = "Mi"; factor = 0x1p-20; } else if (v_abs >= 0x1p+10) { prefix = "Ki"; factor = 0x1p-10; } /* else do nothing */ print_output("%s %sB", float8out_unit (unit->value * factor), prefix); /* byte with binary prefix */ numerator = true; /* case 2: derived unit, or numerator with exactly one unit (exponent 1) * not covered above */ } else if (!unit_output_base_units && (derived_unit || n_numerator == 1)) { double v_abs = fabs(unit->value); char *prefix = ""; double factor = 1.0; char *unit_name = derived_unit ? derived_unit->name : (char *)base_units[u_numerator]; /* case 2a: minute/hour/day output requested, unit is seconds, and * absolute value is >= 60 seconds. Print as interval and exit */ if (unit_time_output_custom && derived_unit && !strcmp(derived_unit->name, "s") && v_abs >= TIME_MINUTE) { print_time_interval(&output_p, unit->value); return output; } if (v_abs >= POWER_33) { // do nothing } else if (v_abs >= POWER_30) { prefix = "Q"; factor = 1e-30; } else if (v_abs >= POWER_27) { prefix = "R"; factor = 1e-27; } else if (v_abs >= POWER_24) { prefix = "Y"; factor = 1e-24; } else if (v_abs >= POWER_21) { prefix = "Z"; factor = 1e-21; } else if (v_abs >= POWER_18) { prefix = "E"; factor = 1e-18; } else if (v_abs >= POWER_15) { prefix = "P"; factor = 1e-15; } else if (v_abs >= POWER_12) { prefix = "T"; factor = 1e-12; } else if (v_abs >= POWER_9) { prefix = "G"; factor = 1e-9; if (!strcmp(unit_name, "s")) unit_name = "sec"; /* avoid Gs because it's gauss, not time */ } else if (v_abs >= POWER_6) { prefix = "M"; factor = 1e-6; } else if (v_abs >= POWER_3) { prefix = "k"; factor = 1e-3; } else if (v_abs >= POWER_0) { // do nothing } else if (v_abs >= POWER__3) { prefix = "m"; factor = 1e3; } else if (v_abs >= POWER__6) { prefix = "µ"; factor = 1e6; } else if (v_abs >= POWER__9) { prefix = "n"; factor = 1e9; } else if (v_abs >= POWER__12) { prefix = "p"; factor = 1e12; } else if (v_abs >= POWER__15) { prefix = "f"; factor = 1e15; } else if (v_abs >= POWER__18) { prefix = "a"; factor = 1e18; } else if (v_abs >= POWER__21) { prefix = "z"; factor = 1e21; } else if (v_abs >= POWER__24) { prefix = "y"; factor = 1e24; } else if (v_abs >= POWER__27) { prefix = "r"; factor = 1e27; } else if (v_abs >= POWER__30) { prefix = "q"; factor = 1e30; } /* else do nothing */ /* print with SI prefix */ print_output("%s %s%s", float8out_unit (unit->value * factor), prefix, unit_name); /* case 2b: derived unit: stop here */ if (derived_unit) return output; /* case 2c: single unit in numerator (exponent 1): continue */ numerator = true; /* case 3: zero or more than one unit in numerator */ } else { /* always use scientific notation here */ print_output("%s", float8out_unit (unit->value)); for (i = 0; i < N_UNITS; i++) /* format units in numerator */ if (unit->units[i] > 0) { print_output("%s%s", numerator ? "*" : " ", base_units[i]); if (unit->units[i] > 1) print_exponent(&output_p, unit->units[i]); numerator = true; } } /* print units in denominator */ for (i = 0; i < N_UNITS; i++) /* format units in denominator */ if (unit->units[i] < 0) { if (numerator) { /* format as .../a^x*b^y */ print_output("%s%s", denominator ? "*" : "/", base_units[i]); if (unit->units[i] < -1) print_exponent(&output_p, -unit->units[i]); } else { /* format as a^-x*b^-y */ print_output("%s%s", denominator ? "*" : " ", base_units[i]); print_exponent(&output_p, unit->units[i]); } denominator = true; } /* done */ return output; } /* input and output */ char *yyerrstr; /* copy of error catched by yyuniterror() */ void yyuniterror (char *s); void yyuniterror (char *s) { /* store error for later use in unit_in */ yyerrstr = pstrdup(s); } /* needs search_path = @extschema@ due to use of unit_parse() */ PG_FUNCTION_INFO_V1 (unit_in); Datum unit_in (PG_FUNCTION_ARGS) { char *str = PG_GETARG_CSTRING(0); UnitShift *result; result = (UnitShift *) palloc(sizeof(UnitShift)); if (unit_parse(str, result) > 0) ereport(ERROR, (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("invalid input syntax for unit: \"%s\", %s", str, yyerrstr))); PG_RETURN_POINTER(&result->unit); } PG_FUNCTION_INFO_V1(unit_out); Datum unit_out(PG_FUNCTION_ARGS) { Unit *unit = (Unit *) PG_GETARG_POINTER(0); PG_RETURN_CSTRING(unit_cstring(unit)); } PG_FUNCTION_INFO_V1(unit_recv); Datum unit_recv(PG_FUNCTION_ARGS) { StringInfo buf = (StringInfo) PG_GETARG_POINTER(0); Unit *unit = palloc(sizeof(Unit)); unit->value = pq_getmsgfloat8(buf); memcpy(unit->units, pq_getmsgbytes(buf, N_UNITS), N_UNITS); PG_RETURN_POINTER(unit); } PG_FUNCTION_INFO_V1(unit_send); Datum unit_send(PG_FUNCTION_ARGS) { Unit *unit = (Unit *) PG_GETARG_POINTER(0); StringInfoData buf; pq_begintypsend(&buf); pq_sendfloat8(&buf, unit->value); pq_sendbytes(&buf, (const char *)unit->units, N_UNITS); PG_RETURN_BYTEA_P(pq_endtypsend(&buf)); } /* constructors */ PG_FUNCTION_INFO_V1 (dbl2unit); Datum dbl2unit (PG_FUNCTION_ARGS) { Unit *result; result = (Unit *) palloc0(sizeof(Unit)); result->value = PG_GETARG_FLOAT8(0); PG_RETURN_POINTER(result); } PG_FUNCTION_INFO_V1 (unit_meter); Datum unit_meter (PG_FUNCTION_ARGS) { Unit *result; result = (Unit *) palloc0(sizeof(Unit)); result->value = PG_GETARG_FLOAT8(0); result->units[UNIT_m] = 1; PG_RETURN_POINTER(result); } PG_FUNCTION_INFO_V1 (unit_kilogram); Datum unit_kilogram (PG_FUNCTION_ARGS) { Unit *result; result = (Unit *) palloc0(sizeof(Unit)); result->value = PG_GETARG_FLOAT8(0); result->units[UNIT_kg] = 1; PG_RETURN_POINTER(result); } PG_FUNCTION_INFO_V1 (unit_second); Datum unit_second (PG_FUNCTION_ARGS) { Unit *result; result = (Unit *) palloc0(sizeof(Unit)); result->value = PG_GETARG_FLOAT8(0); result->units[UNIT_s] = 1; PG_RETURN_POINTER(result); } PG_FUNCTION_INFO_V1 (unit_ampere); Datum unit_ampere (PG_FUNCTION_ARGS) { Unit *result; result = (Unit *) palloc0(sizeof(Unit)); result->value = PG_GETARG_FLOAT8(0); result->units[UNIT_A] = 1; PG_RETURN_POINTER(result); } PG_FUNCTION_INFO_V1 (unit_kelvin); Datum unit_kelvin (PG_FUNCTION_ARGS) { Unit *result; result = (Unit *) palloc0(sizeof(Unit)); result->value = PG_GETARG_FLOAT8(0); result->units[UNIT_K] = 1; PG_RETURN_POINTER(result); } PG_FUNCTION_INFO_V1 (unit_mole); Datum unit_mole (PG_FUNCTION_ARGS) { Unit *result; result = (Unit *) palloc0(sizeof(Unit)); result->value = PG_GETARG_FLOAT8(0); result->units[UNIT_mol] = 1; PG_RETURN_POINTER(result); } PG_FUNCTION_INFO_V1 (unit_candela); Datum unit_candela (PG_FUNCTION_ARGS) { Unit *result; result = (Unit *) palloc0(sizeof(Unit)); result->value = PG_GETARG_FLOAT8(0); result->units[UNIT_cd] = 1; PG_RETURN_POINTER(result); } PG_FUNCTION_INFO_V1 (unit_byte); Datum unit_byte (PG_FUNCTION_ARGS) { Unit *result; result = (Unit *) palloc0(sizeof(Unit)); result->value = PG_GETARG_FLOAT8(0); result->units[UNIT_B] = 1; PG_RETURN_POINTER(result); } /* functions without operators */ PG_FUNCTION_INFO_V1(unit_value); Datum unit_value(PG_FUNCTION_ARGS) { Unit *a = (Unit *) PG_GETARG_POINTER(0); PG_RETURN_FLOAT8(a->value); } PG_FUNCTION_INFO_V1(unit_dimension); Datum unit_dimension(PG_FUNCTION_ARGS) { Unit *a = (Unit *) PG_GETARG_POINTER(0); Unit *result; result = (Unit *) palloc(sizeof(Unit)); result->value = 1; memcpy(result->units, a->units, N_UNITS); PG_RETURN_POINTER(result); } PG_FUNCTION_INFO_V1(unit_round); Datum unit_round(PG_FUNCTION_ARGS) { Unit *a = (Unit *) PG_GETARG_POINTER(0); Unit *result; result = (Unit *) palloc(sizeof(Unit)); result->value = round(a->value); memcpy(result->units, a->units, N_UNITS); PG_RETURN_POINTER(result); } PG_FUNCTION_INFO_V1(unit_diff); Datum unit_diff(PG_FUNCTION_ARGS) { Unit *a = (Unit *) PG_GETARG_POINTER(0); Unit *b = (Unit *) PG_GETARG_POINTER(1); Unit result; unit_sub_internal(a, b, &result); PG_RETURN_FLOAT8(result.value); } /* operators */ PG_FUNCTION_INFO_V1(unit_add); Datum unit_add(PG_FUNCTION_ARGS) { Unit *a = (Unit *) PG_GETARG_POINTER(0); Unit *b = (Unit *) PG_GETARG_POINTER(1); Unit *result; result = (Unit *) palloc(sizeof(Unit)); unit_add_internal(a, b, result); PG_RETURN_POINTER(result); } PG_FUNCTION_INFO_V1(unit_sub); Datum unit_sub(PG_FUNCTION_ARGS) { Unit *a = (Unit *) PG_GETARG_POINTER(0); Unit *b = (Unit *) PG_GETARG_POINTER(1); Unit *result; result = (Unit *) palloc(sizeof(Unit)); unit_sub_internal(a, b, result); PG_RETURN_POINTER(result); } PG_FUNCTION_INFO_V1(unit_neg); Datum unit_neg(PG_FUNCTION_ARGS) { Unit *a = (Unit *) PG_GETARG_POINTER(0); Unit *result; result = (Unit *) palloc(sizeof(Unit)); result->value = - a->value; memcpy(result->units, a->units, N_UNITS); PG_RETURN_POINTER(result); } PG_FUNCTION_INFO_V1(unit_mul); Datum unit_mul(PG_FUNCTION_ARGS) { Unit *a = (Unit *) PG_GETARG_POINTER(0); Unit *b = (Unit *) PG_GETARG_POINTER(1); Unit *result; result = (Unit *) palloc(sizeof(Unit)); unit_mult_internal(a, b, result); PG_RETURN_POINTER(result); } PG_FUNCTION_INFO_V1(dbl_unit_mul); Datum dbl_unit_mul(PG_FUNCTION_ARGS) { double a = PG_GETARG_FLOAT8(0); Unit *b = (Unit *) PG_GETARG_POINTER(1); Unit *result; result = (Unit *) palloc(sizeof(Unit)); result->value = a * b->value; memcpy(result->units, b->units, N_UNITS); PG_RETURN_POINTER(result); } PG_FUNCTION_INFO_V1(unit_dbl_mul); Datum unit_dbl_mul(PG_FUNCTION_ARGS) { Unit *a = (Unit *) PG_GETARG_POINTER(0); double b = PG_GETARG_FLOAT8(1); Unit *result; result = (Unit *) palloc(sizeof(Unit)); result->value = a->value * b; memcpy(result->units, a->units, N_UNITS); PG_RETURN_POINTER(result); } PG_FUNCTION_INFO_V1(unit_div); Datum unit_div(PG_FUNCTION_ARGS) { Unit *a = (Unit *) PG_GETARG_POINTER(0); Unit *b = (Unit *) PG_GETARG_POINTER(1); Unit *result; result = (Unit *) palloc(sizeof(Unit)); unit_div_internal(a, b, result); PG_RETURN_POINTER(result); } PG_FUNCTION_INFO_V1(dbl_unit_div); Datum dbl_unit_div(PG_FUNCTION_ARGS) { double a = PG_GETARG_FLOAT8(0); Unit *b = (Unit *) PG_GETARG_POINTER(1); Unit *result; int i; if (b->value == 0) ereport(ERROR, (errcode(ERRCODE_DIVISION_BY_ZERO), errmsg("division by zero-valued unit: \"%s\"", unit_cstring(b)))); result = (Unit *) palloc(sizeof(Unit)); result->value = a / b->value; for (i = 0; i < N_UNITS; i++) result->units[i] = - b->units[i]; PG_RETURN_POINTER(result); } PG_FUNCTION_INFO_V1(unit_dbl_div); Datum unit_dbl_div(PG_FUNCTION_ARGS) { Unit *a = (Unit *) PG_GETARG_POINTER(0); double b = PG_GETARG_FLOAT8(1); Unit *result; if (b == 0) ereport(ERROR, (errcode(ERRCODE_DIVISION_BY_ZERO), errmsg("division of unit by zero"))); result = (Unit *) palloc(sizeof(Unit)); result->value = a->value / b; memcpy(result->units, a->units, N_UNITS); PG_RETURN_POINTER(result); } PG_FUNCTION_INFO_V1(unit_pow); Datum unit_pow(PG_FUNCTION_ARGS) { Unit *a = (Unit *) PG_GETARG_POINTER(0); int b = PG_GETARG_INT32(1); Unit *result; int i; result = (Unit *) palloc(sizeof(Unit)); result->value = pow(a->value, b); for (i = 0; i < N_UNITS; i++) result->units[i] = a->units[i] * b; PG_RETURN_POINTER(result); } void unit_sqrt_internal(Unit *a, Unit *result) { int i; /* compute root of value */ if (a->value < 0) ereport(ERROR, (errcode(ERRCODE_INVALID_ARGUMENT_FOR_POWER_FUNCTION), errmsg("cannot take square root of a negative-valued unit"))); result->value = sqrt(a->value); /* compute root of base units */ for (i = 0; i < N_UNITS; i++) { if (a->units[i] % 2 != 0) ereport(ERROR, (errcode(ERRCODE_INVALID_ARGUMENT_FOR_POWER_FUNCTION), errmsg("cannot take square root of a unit with odd \"%s\" exponent", base_units[i]))); result->units[i] = a->units[i] >> 1; } } PG_FUNCTION_INFO_V1(unit_sqrt); Datum unit_sqrt(PG_FUNCTION_ARGS) { Unit *a = (Unit *) PG_GETARG_POINTER(0); Unit *result = (Unit *) palloc(sizeof(Unit)); unit_sqrt_internal(a, result); PG_RETURN_POINTER(result); } PG_FUNCTION_INFO_V1(unit_cbrt); Datum unit_cbrt(PG_FUNCTION_ARGS) { Unit *a = (Unit *) PG_GETARG_POINTER(0); Unit *result; int i; /* compute root of value */ result = (Unit *) palloc(sizeof(Unit)); result->value = cbrt(a->value); /* compute root of base units */ for (i = 0; i < N_UNITS; i++) { if (a->units[i] % 3 != 0) ereport(ERROR, (errcode(ERRCODE_INVALID_ARGUMENT_FOR_POWER_FUNCTION), errmsg("cannot take cube root of a unit with \"%s\" exponent not divisible by three", base_units[i]))); result->units[i] = a->units[i] / 3; } PG_RETURN_POINTER(result); } void unit_exp_internal(Unit *a, Unit *result) { int i; /* compute exp of value */ result->value = exp(a->value); /* check dimension */ for (i = 0; i < N_UNITS; i++) { if (a->units[i] != 0) ereport(ERROR, (errcode(ERRCODE_INVALID_ARGUMENT_FOR_POWER_FUNCTION), errmsg("cannot take base-e exponent of value that is not dimension-less"))); result->units[i] = 0; } } void unit_ln_internal(Unit *a, Unit *result) { int i; /* compute ln of value */ if (a->value < 0) ereport(ERROR, (errcode(ERRCODE_INVALID_ARGUMENT_FOR_POWER_FUNCTION), errmsg("cannot take ln of a negative-valued unit"))); result->value = log(a->value); /* check dimension */ for (i = 0; i < N_UNITS; i++) { if (a->units[i] != 0) ereport(ERROR, (errcode(ERRCODE_INVALID_ARGUMENT_FOR_POWER_FUNCTION), errmsg("cannot take ln of value that is not dimension-less"))); result->units[i] = 0; } } void unit_log2_internal(Unit *a, Unit *result) { int i; /* compute log2 of value */ if (a->value < 0) ereport(ERROR, (errcode(ERRCODE_INVALID_ARGUMENT_FOR_POWER_FUNCTION), errmsg("cannot take log2 of a negative-valued unit"))); result->value = log2(a->value); /* check dimension */ for (i = 0; i < N_UNITS; i++) { if (a->units[i] != 0) ereport(ERROR, (errcode(ERRCODE_INVALID_ARGUMENT_FOR_POWER_FUNCTION), errmsg("cannot take log2 of value that is not dimension-less"))); result->units[i] = 0; } } void unit_asin_internal(Unit *a, Unit *result) { int i; /* compute asin of value */ if (a->value < -1 || a->value > 1) ereport(ERROR, (errcode(ERRCODE_INVALID_ARGUMENT_FOR_POWER_FUNCTION), errmsg("cannot asin of values outside the range -1 to 1"))); result->value = asin(a->value); /* check dimension */ for (i = 0; i < N_UNITS; i++) { if (a->units[i] != 0) ereport(ERROR, (errcode(ERRCODE_INVALID_ARGUMENT_FOR_POWER_FUNCTION), errmsg("cannot take asin of value that is not dimension-less"))); result->units[i] = 0; } } void unit_tan_internal(Unit *a, Unit *result) { int i; /* compute tan of value */ result->value = tan(a->value); /* check dimension */ for (i = 0; i < N_UNITS; i++) { if (a->units[i] != 0) ereport(ERROR, (errcode(ERRCODE_INVALID_ARGUMENT_FOR_POWER_FUNCTION), errmsg("cannot take tan of value that is not dimension-less"))); result->units[i] = 0; } } /* obsolete version of unit_at_text used in v1..3 */ /* needs search_path = @extschema@ due to use of unit_parse() */ PG_FUNCTION_INFO_V1(unit_at); Datum unit_at(PG_FUNCTION_ARGS) { Unit *a = (Unit *) PG_GETARG_POINTER(0); char *b = PG_GETARG_CSTRING(1); UnitShift bu; if (unit_parse(b, &bu) > 0) ereport(ERROR, (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("invalid input syntax for unit: \"%s\", %s", b, yyerrstr))); test_same_dimension("@", a, &bu.unit); if (bu.unit.value == 0) ereport(ERROR, (errcode(ERRCODE_DIVISION_BY_ZERO), errmsg("division by zero-valued unit: \"%s\"", b))); PG_RETURN_CSTRING(psprintf("%s %s%s", float8out_unit ((a->value - bu.shift) / bu.unit.value), (atof(b) > 0 ? "* " : ""), b)); } /* obsolete version of unit_at_text2 used in v4..6 */ /* needs search_path = @extschema@ due to use of unit_parse() */ PG_FUNCTION_INFO_V1(unit_at_text); Datum unit_at_text(PG_FUNCTION_ARGS) { Unit *a = (Unit *) PG_GETARG_POINTER(0); char *b = text_to_cstring(PG_GETARG_TEXT_PP(1)); UnitShift bu; if (unit_parse(b, &bu) > 0) ereport(ERROR, (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("invalid input syntax for unit: \"%s\", %s", b, yyerrstr))); test_same_dimension("@", a, &bu.unit); if (bu.unit.value == 0) ereport(ERROR, (errcode(ERRCODE_DIVISION_BY_ZERO), errmsg("division by zero-valued unit: \"%s\"", b))); PG_RETURN_CSTRING(psprintf("%s %s%s", float8out_unit ((a->value - bu.shift) / bu.unit.value), (atof(b) > 0 ? "* " : ""), b)); } /* needs search_path = @extschema@ due to use of unit_parse() */ PG_FUNCTION_INFO_V1(unit_at_text2); Datum unit_at_text2(PG_FUNCTION_ARGS) { Unit *a = (Unit *) PG_GETARG_POINTER(0); char *b = text_to_cstring(PG_GETARG_TEXT_PP(1)); UnitShift bu; if (unit_parse(b, &bu) > 0) ereport(ERROR, (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("invalid input syntax for unit: \"%s\", %s", b, yyerrstr))); test_same_dimension("@", a, &bu.unit); if (bu.unit.value == 0) ereport(ERROR, (errcode(ERRCODE_DIVISION_BY_ZERO), errmsg("division by zero-valued unit: \"%s\"", b))); PG_RETURN_TEXT_P(cstring_to_text(psprintf("%s %s%s", float8out_unit ((a->value - bu.shift) / bu.unit.value), (atof(b) > 0 ? "* " : ""), b))); } /* needs search_path = @extschema@ due to use of unit_parse() */ PG_FUNCTION_INFO_V1(unit_at_double); Datum unit_at_double(PG_FUNCTION_ARGS) { Unit *a = (Unit *) PG_GETARG_POINTER(0); char *b = text_to_cstring(PG_GETARG_TEXT_PP(1)); UnitShift bu; if (unit_parse(b, &bu) > 0) ereport(ERROR, (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("invalid input syntax for unit: \"%s\", %s", b, yyerrstr))); test_same_dimension("@@", a, &bu.unit); if (bu.unit.value == 0) ereport(ERROR, (errcode(ERRCODE_DIVISION_BY_ZERO), errmsg("division by zero-valued unit: \"%s\"", b))); PG_RETURN_FLOAT8((a->value - bu.shift) / bu.unit.value); } /* comparisons */ static int unit_cmp_internal(Unit *a, Unit *b) { if (a->value < b->value) return -1; if (a->value > b->value) return 1; return memcmp(a->units, b->units, N_UNITS); } PG_FUNCTION_INFO_V1(unit_lt); Datum unit_lt(PG_FUNCTION_ARGS) { Unit *a = (Unit *) PG_GETARG_POINTER(0); Unit *b = (Unit *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(unit_cmp_internal(a, b) < 0); } PG_FUNCTION_INFO_V1(unit_le); Datum unit_le(PG_FUNCTION_ARGS) { Unit *a = (Unit *) PG_GETARG_POINTER(0); Unit *b = (Unit *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(unit_cmp_internal(a, b) <= 0); } PG_FUNCTION_INFO_V1(unit_eq); Datum unit_eq(PG_FUNCTION_ARGS) { Unit *a = (Unit *) PG_GETARG_POINTER(0); Unit *b = (Unit *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(unit_cmp_internal(a, b) == 0); } PG_FUNCTION_INFO_V1(unit_ne); Datum unit_ne(PG_FUNCTION_ARGS) { Unit *a = (Unit *) PG_GETARG_POINTER(0); Unit *b = (Unit *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(unit_cmp_internal(a, b) != 0); } PG_FUNCTION_INFO_V1(unit_ge); Datum unit_ge(PG_FUNCTION_ARGS) { Unit *a = (Unit *) PG_GETARG_POINTER(0); Unit *b = (Unit *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(unit_cmp_internal(a, b) >= 0); } PG_FUNCTION_INFO_V1(unit_gt); Datum unit_gt(PG_FUNCTION_ARGS) { Unit *a = (Unit *) PG_GETARG_POINTER(0); Unit *b = (Unit *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(unit_cmp_internal(a, b) > 0); } PG_FUNCTION_INFO_V1(unit_cmp); Datum unit_cmp(PG_FUNCTION_ARGS) { Unit *a = (Unit *) PG_GETARG_POINTER(0); Unit *b = (Unit *) PG_GETARG_POINTER(1); PG_RETURN_INT32(unit_cmp_internal(a, b)); } /* strict comparisons (error out when dimensions do not match) */ static int unit_strict_cmp_internal(Unit *a, Unit *b) { test_same_dimension("strict comparison", a, b); if (a->value < b->value) return -1; if (a->value > b->value) return 1; return memcmp(a->units, b->units, N_UNITS); } PG_FUNCTION_INFO_V1(unit_strict_lt); Datum unit_strict_lt(PG_FUNCTION_ARGS) { Unit *a = (Unit *) PG_GETARG_POINTER(0); Unit *b = (Unit *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(unit_strict_cmp_internal(a, b) < 0); } PG_FUNCTION_INFO_V1(unit_strict_le); Datum unit_strict_le(PG_FUNCTION_ARGS) { Unit *a = (Unit *) PG_GETARG_POINTER(0); Unit *b = (Unit *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(unit_strict_cmp_internal(a, b) <= 0); } PG_FUNCTION_INFO_V1(unit_strict_eq); Datum unit_strict_eq(PG_FUNCTION_ARGS) { Unit *a = (Unit *) PG_GETARG_POINTER(0); Unit *b = (Unit *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(unit_strict_cmp_internal(a, b) == 0); } PG_FUNCTION_INFO_V1(unit_strict_ne); Datum unit_strict_ne(PG_FUNCTION_ARGS) { Unit *a = (Unit *) PG_GETARG_POINTER(0); Unit *b = (Unit *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(unit_strict_cmp_internal(a, b) != 0); } PG_FUNCTION_INFO_V1(unit_strict_ge); Datum unit_strict_ge(PG_FUNCTION_ARGS) { Unit *a = (Unit *) PG_GETARG_POINTER(0); Unit *b = (Unit *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(unit_strict_cmp_internal(a, b) >= 0); } PG_FUNCTION_INFO_V1(unit_strict_gt); Datum unit_strict_gt(PG_FUNCTION_ARGS) { Unit *a = (Unit *) PG_GETARG_POINTER(0); Unit *b = (Unit *) PG_GETARG_POINTER(1); PG_RETURN_BOOL(unit_strict_cmp_internal(a, b) > 0); } PG_FUNCTION_INFO_V1(unit_strict_cmp); Datum unit_strict_cmp(PG_FUNCTION_ARGS) { Unit *a = (Unit *) PG_GETARG_POINTER(0); Unit *b = (Unit *) PG_GETARG_POINTER(1); PG_RETURN_INT32(unit_strict_cmp_internal(a, b)); } PG_FUNCTION_INFO_V1(unit_least); Datum unit_least(PG_FUNCTION_ARGS) { Unit *a = (Unit *) PG_GETARG_POINTER(0); Unit *b = (Unit *) PG_GETARG_POINTER(1); test_same_dimension("unit_least", a, b); if (unit_cmp_internal(a, b) <= 0) PG_RETURN_POINTER(a); PG_RETURN_POINTER(b); } PG_FUNCTION_INFO_V1(unit_greatest); Datum unit_greatest(PG_FUNCTION_ARGS) { Unit *a = (Unit *) PG_GETARG_POINTER(0); Unit *b = (Unit *) PG_GETARG_POINTER(1); test_same_dimension("unit_greatest", a, b); if (unit_cmp_internal(a, b) >= 0) PG_RETURN_POINTER(a); PG_RETURN_POINTER(b); } /* internal functions */ /* used in load-units.pl */ PG_FUNCTION_INFO_V1(unit_is_hashed); Datum unit_is_hashed(PG_FUNCTION_ARGS) { char *name = PG_GETARG_CSTRING(0); PG_RETURN_BOOL (hash_search(unit_names, name, HASH_FIND, NULL) != NULL); } PG_FUNCTION_INFO_V1(unit_reset); Datum unit_reset(PG_FUNCTION_ARGS) { /* reinitialize hash tables */ unit_get_definitions(); PG_RETURN_VOID(); } postgresql-unit-7.8/unit.control000066400000000000000000000003641450213077700171420ustar00rootroot00000000000000default_version = '7' comment = 'SI units extension' # the unit_prefixes/unit_units tables can be installed in an arbitrary schema, # but can not be relocated later: relocatable = false # unit_load() is written in plpgsql: requires = 'plpgsql' postgresql-unit-7.8/unit.h000066400000000000000000000065561450213077700157220ustar00rootroot00000000000000#ifndef _UNIT_H #define _UNIT_H 1 #include #include /* indices */ #define UNIT_m 0 /* meter */ #define UNIT_kg 1 /* kilogram */ #define UNIT_s 2 /* second */ #define UNIT_A 3 /* ampere */ #define UNIT_K 4 /* kelvin */ #define UNIT_mol 5 /* mole */ #define UNIT_cd 6 /* candela */ #define UNIT_B 7 /* byte */ #define N_UNITS 8 /* functions recognized in parser */ enum parser_function { FUNCTION_SQRT, FUNCTION_EXP, FUNCTION_LN, FUNCTION_LOG2, FUNCTION_ASIN, FUNCTION_TAN, }; /* defined units */ #define UNIT_NAME_LENGTH 32 /* longest unit names (without prefixes) observed in definitions.units: * specificheat_glass_silica (25 chars) * hardtranslucentarkansas (23 chars) * venezuelanbolivarfuerte */ #define MIN_PLURAL_LENGTH 3 /* minimum length of input unit to consider stripping a trailing plural 's' * lbs secs */ #define DBL_DIG 15 #define TIME_MINUTE 60 #define TIME_HOUR (60 * TIME_MINUTE) #define TIME_DAY (24 * TIME_HOUR) #define TIME_YEAR (365 * TIME_DAY) #define TIME_YEAR_NAME "commonyear" extern const char *base_units[N_UNITS]; /* names of base units */ struct derived_unit_t { char *name; signed char units[N_UNITS]; }; extern const struct derived_unit_t si_derived_units[]; /* type def */ typedef struct Unit { double value; signed char units[N_UNITS]; } Unit; typedef struct UnitShift { Unit unit; double shift; } UnitShift; /* hash table and regex interface */ extern HTAB *unit_names; typedef struct unit_names_t { char name[UNIT_NAME_LENGTH]; UnitShift unit_shift; } unit_names_t; typedef struct unit_dimensions_t { char units[N_UNITS]; char name[UNIT_NAME_LENGTH]; } unit_dimensions_t; /* parser interface */ int unit_parse (char *s, UnitShift *unit); /* in unit.y */ char *unit_cstring (Unit *unit); /* static functions */ /* test if two Units have the same dimension */ static inline void test_same_dimension (char *op, Unit *a, Unit *b) { if (memcmp(a->units, b->units, N_UNITS)) ereport(ERROR, (errcode(ERRCODE_DATA_EXCEPTION), errmsg("dimension mismatch in \"%s\" operation: \"%s\", \"%s\"", op, unit_cstring(a), unit_cstring(b)))); } static inline void unit_add_internal (Unit *a, Unit *b, Unit *result) { test_same_dimension("+", a, b); result->value = a->value + b->value; memcpy(result->units, a->units, N_UNITS); } static inline void unit_sub_internal (Unit *a, Unit *b, Unit *result) { test_same_dimension("-", a, b); result->value = a->value - b->value; memcpy(result->units, a->units, N_UNITS); } static inline void unit_mult_internal (Unit *a, Unit *b, Unit *result) { int i; result->value = a->value * b->value; for (i = 0; i < N_UNITS; i++) result->units[i] = a->units[i] + b->units[i]; } static inline void unit_div_internal (Unit *a, Unit *b, Unit *result) { int i; if (b->value == 0) ereport(ERROR, (errcode(ERRCODE_DIVISION_BY_ZERO), errmsg("division by zero-valued unit: \"%s\"", unit_cstring(b)))); result->value = a->value / b->value; for (i = 0; i < N_UNITS; i++) result->units[i] = a->units[i] - b->units[i]; } void unit_sqrt_internal(Unit *a, Unit *result); void unit_exp_internal(Unit *a, Unit *result); void unit_ln_internal(Unit *a, Unit *result); void unit_log2_internal(Unit *a, Unit *result); void unit_asin_internal(Unit *a, Unit *result); void unit_tan_internal(Unit *a, Unit *result); #endif /* _UNIT_H */ postgresql-unit-7.8/unit_prefixes.data000066400000000000000000000054471450213077700203070ustar00rootroot00000000000000quetta 1e+30 1e30 \N ronna 1e+27 1e27 \N yotta 1e+24 1e24 \N zetta 1e+21 1e21 \N exa 1e+18 1e18 \N peta 1e+15 1e15 \N tera 1000000000000 1e12 \N giga 1000000000 1e9 \N mega 1000000 1e6 \N myria 10000 1e4 \N kilo 1000 1e3 \N hecto 100 1e2 \N deca 10 1e1 \N deka 10 deca \N deci 0.1 1e-1 \N centi 0.01 1e-2 \N milli 0.001 1e-3 \N micro 1e-06 1e-6 \N nano 1e-09 1e-9 \N pico 1e-12 1e-12 \N femto 1e-15 1e-15 \N atto 1e-18 1e-18 \N zepto 1e-21 1e-21 \N yocto 1e-24 1e-24 \N ronto 1e-27 1e-27 \N quecto 1e-30 1e-30 \N quarter 0.25 1|4 \N semi 0.5 0.5 \N demi 0.5 0.5 \N hemi 0.5 0.5 \N half 0.5 0.5 \N double 2 2 \N triple 3 3 \N treble 3 3 \N kibi 1024 2^10 \N mebi 1048576 2^20 \N gibi 1073741824 2^30 \N tebi 1099511627776 2^40 \N pebi 1.125899906842624e+15 2^50 \N exbi 1.152921504606847e+18 2^60 \N zebi 1.1805916207174113e+21 2^70 \N yobi 1.2089258196146292e+24 2^80 \N robi 1.2379400392853803e+27 2^90 \N quebi 1.2676506002282294e+30 2^100 \N Ki 1024 kibi \N Mi 1048576 mebi \N Gi 1073741824 gibi \N Ti 1099511627776 tebi \N Pi 1.125899906842624e+15 pebi \N Ei 1.152921504606847e+18 exbi \N Zi 1.1805916207174113e+21 zebi \N Yi 1.2089258196146292e+24 yobi \N Ri 1.2379400392853803e+27 robi \N Qi 1.2676506002282294e+30 quebi \N Q 1e+30 quetta \N R 1e+27 ronna \N Y 1e+24 yotta \N Z 1e+21 zetta \N E 1e+18 exa \N P 1e+15 peta \N T 1000000000000 tera \N G 1000000000 giga \N M 1000000 mega \N k 1000 kilo \N h 100 hecto \N da 10 deka \N d 0.1 deci \N c 0.01 centi \N m 0.001 milli \N u 1e-06 micro \N mu 1e-06 micro \N n 1e-09 nano \N p 1e-12 pico \N f 1e-15 femto \N a 1e-18 atto \N z 1e-21 zepto \N y 1e-24 yocto \N r 1e-27 ronto \N q 1e-30 quecto \N US 1.000002000004 US \N survey 1.000002000004 US \N geodetic 1.000002000004 US \N int 0.999998 int \N Zena 12 12 \N Duna 144 12^2 \N Trina 1728 12^3 \N Quedra 20736 12^4 \N Quena 248832 12^5 \N Hesa 2985984 12^6 \N Seva 35831808 12^7 \N Aka 429981696 12^8 \N Neena 5159780352 12^9 \N Dexa 61917364224 12^10 \N Lefa 743008370688 12^11 \N Zennila 8916100448256 12^12 \N Zeni 0.08333333333333333 12^-1 \N Duni 0.006944444444444444 12^-2 \N Trini 0.0005787037037037037 12^-3 \N Quedri 4.8225308641975306e-05 12^-4 \N Queni 4.018775720164609e-06 12^-5 \N Hesi 3.3489797668038406e-07 12^-6 \N Sevi 2.790816472336534e-08 12^-7 \N Aki 2.3256803936137784e-09 12^-8 \N Neeni 1.9380669946781485e-10 12^-9 \N Dexi 1.615055828898457e-11 12^-10 \N Lefi 1.345879857415381e-12 12^-11 \N Zennili 1.1215665478461509e-13 12^-12 \N ⅛ 0.125 1|8 \N ¼ 0.25 1|4 \N ⅜ 0.375 3|8 \N ½ 0.5 1|2 \N ⅝ 0.625 5|8 \N ¾ 0.75 3|4 \N ⅞ 0.875 7|8 \N ⅙ 0.16666666666666666 1|6 \N ⅓ 0.3333333333333333 1|3 \N ⅔ 0.6666666666666666 2|3 \N ⅚ 0.8333333333333334 5|6 \N ⅕ 0.2 1|5 \N ⅖ 0.4 2|5 \N ⅗ 0.6 3|5 \N ⅘ 0.8 4|5 \N µ 1e-06 micro \N μ 1e-06 micro \N UK 0.9999982611548556 UK \N british 0.9999982611548556 UK \N postgresql-unit-7.8/unit_units.data000066400000000000000000005054101450213077700176170ustar00rootroot00000000000000s 1 s \N s \N second 1 s \N s \N c_SI 299792458 \N 299792458 \N c 299792458 m/s \N 299792458 m/s \N m 1 m \N m \N meter 1 m \N m \N metre 1 m \N m \N h_SI 6.62607014999999983e-34 \N 6.62607015e-34 \N h 6.62607014999999983e-34 m^2*kg/s \N 6.62607015e-34 (m^2*kg/s^2) s \N kg 1 kg \N kg \N kilogram 1 kg \N kg \N k_SI 1.38064900000000009e-23 \N 1.380649e-23 \N boltzmann 1.38064900000000009e-23 m^2*kg/s^2*K \N 1.380649e-23 (m^2*kg/s^2)/K \N k 1.38064900000000009e-23 m^2*kg/s^2*K \N boltzmann \N K 1 K \N K \N kelvin 1 K \N K \N e_SI 1.60217663399999989e-19 \N 1.602176634e-19 \N e 1.60217663399999989e-19 s*A \N 1.602176634e-19 A s \N A 1 A \N A \N ampere 1 A \N A \N amp 1 A \N ampere \N avogadro 6.02214075999999987e+23 mol^-1 \N 6.02214076e23 / mol \N N_A 6.02214075999999987e+23 mol^-1 \N avogadro \N mol 1 mol \N mol \N mole 1 mol \N mol \N cd 1 cd \N cd \N candela 1 cd \N cd \N radian 1 \N 1 \N sr 1 \N 1 \N steradian 1 \N sr \N B 1 B \N B \N byte 1 B \N B \N bit 0.125 B \N 1|8 B \N one 1 \N 1 \N two 2 \N 2 \N double 2 \N 2 \N couple 2 \N 2 \N three 3 \N 3 \N triple 3 \N 3 \N four 4 \N 4 \N quadruple 4 \N 4 \N five 5 \N 5 \N quintuple 5 \N 5 \N six 6 \N 6 \N seven 7 \N 7 \N eight 8 \N 8 \N nine 9 \N 9 \N ten 10 \N 10 \N eleven 11 \N 11 \N twelve 12 \N 12 \N thirteen 13 \N 13 \N fourteen 14 \N 14 \N fifteen 15 \N 15 \N sixteen 16 \N 16 \N seventeen 17 \N 17 \N eighteen 18 \N 18 \N nineteen 19 \N 19 \N twenty 20 \N 20 \N thirty 30 \N 30 \N forty 40 \N 40 \N fifty 50 \N 50 \N sixty 60 \N 60 \N seventy 70 \N 70 \N eighty 80 \N 80 \N ninety 90 \N 90 \N hundred 100 \N 100 \N thousand 1000 \N 1000 \N million 1000000 \N 1e6 \N shortbillion 1000000000 \N 1e9 \N shorttrillion 1000000000000 \N 1e12 \N shortquadrillion 1000000000000000 \N 1e15 \N shortquintillion 1e+18 \N 1e18 \N shortsextillion 1e+21 \N 1e21 \N shortseptillion 9.99999999999999983e+23 \N 1e24 \N shortoctillion 1.00000000000000001e+27 \N 1e27 \N shortnonillion 1.00000000000000002e+30 \N 1e30 \N shortnoventillion 1.00000000000000002e+30 \N shortnonillion \N shortdecillion 9.99999999999999946e+32 \N 1e33 \N shortundecillion 1.00000000000000004e+36 \N 1e36 \N shortduodecillion 9.9999999999999994e+38 \N 1e39 \N shorttredecillion 1.00000000000000004e+42 \N 1e42 \N shortquattuordecillion 9.9999999999999993e+44 \N 1e45 \N shortquindecillion 1.00000000000000004e+48 \N 1e48 \N shortsexdecillion 9.99999999999999993e+50 \N 1e51 \N shortseptendecillion 1.00000000000000008e+54 \N 1e54 \N shortoctodecillion 1.00000000000000005e+57 \N 1e57 \N shortnovemdecillion 9.99999999999999949e+59 \N 1e60 \N shortvigintillion 1.00000000000000006e+63 \N 1e63 \N centillion 1e+303 \N 1e303 \N googol 1.00000000000000002e+100 \N 1e100 \N longbillion 1000000000000 \N million^2 \N longtrillion 1e+18 \N million^3 \N longquadrillion 9.99999999999999983e+23 \N million^4 \N longquintillion 1.00000000000000002e+30 \N million^5 \N longsextillion 1.00000000000000004e+36 \N million^6 \N longseptillion 1.00000000000000004e+42 \N million^7 \N longoctillion 1.00000000000000004e+48 \N million^8 \N longnonillion 1.00000000000000008e+54 \N million^9 \N longnoventillion 1.00000000000000008e+54 \N longnonillion \N longdecillion 9.99999999999999949e+59 \N million^10 \N longundecillion 9.99999999999999945e+65 \N million^11 \N longduodecillion 9.99999999999999944e+71 \N million^12 \N longtredecillion 1.00000000000000001e+78 \N million^13 \N longquattuordecillion 1.00000000000000006e+84 \N million^14 \N longquindecillion 9.99999999999999966e+89 \N million^15 \N longsexdecillion 1.00000000000000005e+96 \N million^16 \N longseptdecillion 9.99999999999999977e+101 \N million^17 \N longoctodecillion 1.00000000000000003e+108 \N million^18 \N longnovemdecillion 1.00000000000000002e+114 \N million^19 \N longvigintillion 9.9999999999999998e+119 \N million^20 \N milliard 1000000000 \N 1000 million \N billiard 1000000000000000 \N 1000 million^2 \N trilliard 1e+21 \N 1000 million^3 \N quadrilliard 1.00000000000000001e+27 \N 1000 million^4 \N quintilliard 1.00000000000000009e+33 \N 1000 million^5 \N sextilliard 1.00000000000000009e+39 \N 1000 million^6 \N septilliard 1.00000000000000009e+45 \N 1000 million^7 \N octilliard 9.99999999999999993e+50 \N 1000 million^8 \N nonilliard 1.00000000000000005e+57 \N 1000 million^9 \N noventilliard 1.00000000000000005e+57 \N nonilliard \N decilliard 9.99999999999999875e+62 \N 1000 million^10 \N longmilliard 1000000000 \N milliard \N longbilliard 1000000000000000 \N billiard \N longtrilliard 1e+21 \N trilliard \N longquadrilliard 1.00000000000000001e+27 \N quadrilliard \N longquintilliard 1.00000000000000009e+33 \N quintilliard \N longsextilliard 1.00000000000000009e+39 \N sextilliard \N longseptilliard 1.00000000000000009e+45 \N septilliard \N longoctilliard 9.99999999999999993e+50 \N octilliard \N longnonilliard 1.00000000000000005e+57 \N nonilliard \N longnoventilliard 1.00000000000000005e+57 \N noventilliard \N longdecilliard 9.99999999999999875e+62 \N decilliard \N billion 1000000000 \N shortbillion \N trillion 1000000000000 \N shorttrillion \N quadrillion 1000000000000000 \N shortquadrillion \N quintillion 1e+18 \N shortquintillion \N sextillion 1e+21 \N shortsextillion \N septillion 9.99999999999999983e+23 \N shortseptillion \N octillion 1.00000000000000001e+27 \N shortoctillion \N nonillion 1.00000000000000002e+30 \N shortnonillion \N noventillion 1.00000000000000002e+30 \N shortnoventillion \N decillion 9.99999999999999946e+32 \N shortdecillion \N undecillion 1.00000000000000004e+36 \N shortundecillion \N duodecillion 9.9999999999999994e+38 \N shortduodecillion \N tredecillion 1.00000000000000004e+42 \N shorttredecillion \N quattuordecillion 9.9999999999999993e+44 \N shortquattuordecillion \N quindecillion 1.00000000000000004e+48 \N shortquindecillion \N sexdecillion 9.99999999999999993e+50 \N shortsexdecillion \N septendecillion 1.00000000000000008e+54 \N shortseptendecillion \N octodecillion 1.00000000000000005e+57 \N shortoctodecillion \N novemdecillion 9.99999999999999949e+59 \N shortnovemdecillion \N vigintillion 1.00000000000000006e+63 \N shortvigintillion \N lakh 100000 \N 1e5 \N crore 10000000 \N 1e7 \N arab 1000000000 \N 1e9 \N kharab 100000000000 \N 1e11 \N neel 10000000000000 \N 1e13 \N padm 1000000000000000 \N 1e15 \N shankh 100000000000000000 \N 1e17 \N pi 3.14159265358979312 \N 3.14159265358979323846 \N π 3.14159265358979312 \N pi \N astronomicalunit 149597870700 m \N 149597870700 m \N au 149597870700 m \N astronomicalunit \N m2 1 m^2 \N m^2 \N newton 1 m*kg/s^2 \N kg m / s^2 \N N 1 m*kg/s^2 \N newton \N pascal 1 kg/m*s^2 \N N/m^2 \N Pa 1 kg/m*s^2 \N pascal \N joule 1 m^2*kg/s^2 \N N m \N J 1 m^2*kg/s^2 \N joule \N watt 1 m^2*kg/s^3 \N J/s \N W 1 m^2*kg/s^3 \N watt \N coulomb 1 s*A \N A s \N C 1 s*A \N coulomb \N volt 1 m^2*kg/s^3*A \N W/A \N V 1 m^2*kg/s^3*A \N volt \N ohm 1 m^2*kg/s^3*A^2 \N V/A \N siemens 1 s^3*A^2/m^2*kg \N A/V \N S 1 s^3*A^2/m^2*kg \N siemens \N farad 1 s^4*A^2/m^2*kg \N C/V \N F 1 s^4*A^2/m^2*kg \N farad \N weber 1 m^2*kg/s^2*A \N V s \N Wb 1 m^2*kg/s^2*A \N weber \N henry 1 m^2*kg/s^2*A^2 \N V s / A \N H 1 m^2*kg/s^2*A^2 \N henry \N tesla 1 kg/s^2*A \N Wb/m^2 \N T 1 kg/s^2*A \N tesla \N hertz 1 s^-1 \N /s \N Hz 1 s^-1 \N hertz \N LENGTH 1 m \N meter \N AREA 1 m^2 \N LENGTH^2 \N VOLUME 1 m^3 \N LENGTH^3 \N MASS 1 kg \N kilogram \N AMOUNT 1 mol \N mole \N ANGLE 1 \N radian \N SOLID_ANGLE 1 \N steradian \N FORCE 1 m*kg/s^2 \N newton \N PRESSURE 1 kg/m*s^2 \N FORCE / AREA \N STRESS 1 kg/m*s^2 \N FORCE / AREA \N FREQUENCY 1 s^-1 \N hertz \N DISPLACEMENT 1 m \N LENGTH \N DISTANCE 1 m \N LENGTH \N ELONGATION 1 m \N LENGTH \N STRAIN 1 \N ELONGATION / LENGTH \N ENERGY 1 m^2*kg/s^2 \N joule \N POWER 1 m^2*kg/s^3 \N watt \N WORK 1 m^2*kg/s^2 \N FORCE DISTANCE \N DENSITY 1 kg/m^3 \N MASS / VOLUME \N LINEAR_DENSITY 1 kg/m \N MASS / LENGTH \N CURRENT 1 A \N ampere \N CHARGE 1 s*A \N coulomb \N CAPACITANCE 1 s^4*A^2/m^2*kg \N farad \N RESISTANCE 1 m^2*kg/s^3*A^2 \N ohm \N CONDUCTANCE 1 s^3*A^2/m^2*kg \N siemens \N RESISTIVITY 1 m^3*kg/s^3*A^2 \N RESISTANCE AREA / LENGTH \N CONDUCTIVITY 1 s^3*A^2/m^3*kg \N CONDUCTANCE LENGTH / AREA \N INDUCTANCE 1 m^2*kg/s^2*A^2 \N henry \N B_FIELD 1 kg/s^2*A \N tesla \N ELECTRIC_DIPOLE_MOMENT 1 m*s*A \N C m \N MAGNETIC_DIPOLE_MOMENT 1 m^2*A \N J / T \N POLARIZATION 1 s*A/m^2 \N ELECTRIC_DIPOLE_MOMENT / VOLUME \N MAGNETIZATION 1 A/m \N MAGNETIC_DIPOLE_MOMENT / VOLUME \N ELECTRIC_POTENTIAL 1 m^2*kg/s^3*A \N ENERGY / CHARGE \N VOLTAGE 1 m^2*kg/s^3*A \N ELECTRIC_POTENTIAL \N B_FLUX 1 m^2*kg/s^2*A \N B_FIELD AREA \N gram 0.00100000000000000002 kg \N millikg \N gm 0.00100000000000000002 kg \N gram \N g 0.00100000000000000002 kg \N gram \N tonne 1000 kg \N 1000 kg \N t 1000 kg \N tonne \N metricton 1000 kg \N tonne \N sthene 1000 m*kg/s^2 \N tonne m / s^2 \N funal 1000 m*kg/s^2 \N sthene \N pieze 1000 kg/m*s^2 \N sthene / m^2 \N quintal 100 kg \N 100 kg \N bar 100000 kg/m*s^2 \N 1e5 Pa \N b 100000 kg/m*s^2 \N bar \N vac 100 kg/m*s^2 \N millibar \N micron 9.99999999999999955e-07 m \N micrometer \N bicron 9.9999999999999998e-13 m \N picometer \N cc 1.00000000000000017e-06 m^3 \N cm^3 \N are 100 m^2 \N 100 m^2 \N a 100 m^2 \N are \N liter 0.00100000000000000024 m^3 \N 1000 cc \N oldliter 0.00100002800000000024 m^3 \N 1.000028 dm^3 \N L 0.00100000000000000024 m^3 \N liter \N l 0.00100000000000000024 m^3 \N liter \N mho 1 s^3*A^2/m^2*kg \N siemens \N galvat 1 A \N ampere \N angstrom 1.00000000000000004e-10 m \N 1e-10 m \N xunit_cu 1.00207697000000001e-13 m \N 1.00207697e-13 m \N xunit_mo 1.00209952000000005e-13 m \N 1.00209952e-13 m \N angstromstar 1.00001494999999994e-10 m \N 1.00001495 angstrom \N silicon_d220 1.92015571599999989e-10 m \N 1.920155716e-10 m \N siliconlattice 5.43102051087084223e-10 m \N sqrt(8) silicon_d220 \N fermi 1.00000000000000008e-15 m \N 1e-15 m \N barn 9.99999999999999971e-29 m^2 \N 1e-28 m^2 \N shed 9.99999999999999822e-53 m^2 \N 1e-24 barn \N brewster 9.9999999999999998e-13 m*s^2/kg \N micron^2/N \N diopter 1 m^-1 \N /m \N fresnel 1000000000000 s^-1 \N 1e12 Hz \N svedberg 1.00000000000000003e-13 s \N 1e-13 s \N gamma 1.00000000000000006e-09 kg \N microgram \N lambda 1.00000000000000027e-09 m^3 \N microliter \N spat 1000000000000 m \N 1e12 m \N preece 10000000000000 m^3*kg/s^3*A^2 \N 1e13 ohm m \N planck 1 m^2*kg/s \N J s \N sturgeon 1 s^2*A^2/m^2*kg \N /henry \N daraf 1 m^2*kg/s^4*A^2 \N 1/farad \N leo 10 m/s^2 \N 10 m/s^2 \N poiseuille 1 kg/m*s \N N s / m^2 \N mayer 1000 m^2/s^2*K \N J/g K \N mired 1000000 K^-1 \N / microK \N crocodile 1000000 m^2*kg/s^3*A \N megavolt \N metricounce 0.0250000000000000014 kg \N 25 g \N mounce 0.0250000000000000014 kg \N metricounce \N finsenunit 100000 kg/s^3 \N 1e5 W/m^2 \N fluxunit 1.00000000000000004e-26 kg/s^2 \N 1e-26 W/m^2 Hz \N jansky 1.00000000000000004e-26 kg/s^2 \N fluxunit \N Jy 1.00000000000000004e-26 kg/s^2 \N jansky \N flick 10000000000 kg/m*s^3 \N W / cm^2 sr micrometer \N pfu 10000 m^-2*s^-1 \N / cm^2 sr s \N solarluminosity 3.82800000000000009e+26 m^2*kg/s^3 \N 382.8e24 W \N sec 1 s \N s \N minute 60 s \N 60 s \N min 60 s \N minute \N hour 3600 s \N 60 min \N hr 3600 s \N hour \N day 86400 s \N 24 hr \N d 86400 s \N day \N da 86400 s \N day \N week 604800 s \N 7 day \N wk 604800 s \N week \N sennight 604800 s \N 7 day \N fortnight 1209600 s \N 14 day \N blink 0.864000000000000101 s \N 1e-5 day \N ce 864 s \N 1e-2 day \N watch 14400 s \N 4 hours \N bell 1800 s \N 1|8 watch \N decimalhour 8640 s \N 1|10 day \N decimalminute 86.4000000000000057 s \N 1|100 decimalhour \N decimalsecond 0.864000000000000101 s \N 1|100 decimalminute \N beat 86.4000000000000057 s \N decimalminute \N circle 6.28318530717958623 \N 2 pi radian \N degree 0.0174532925199432955 \N 1|360 circle \N deg 0.0174532925199432955 \N degree \N arcdeg 0.0174532925199432955 \N degree \N arcmin 0.00029088820866572158 \N 1|60 degree \N arcminute 0.00029088820866572158 \N arcmin \N ' 0.00029088820866572158 \N arcmin \N arcsec 4.84813681109535984e-06 \N 1|60 arcmin \N arcsecond 4.84813681109535984e-06 \N arcsec \N " 4.84813681109535984e-06 \N arcsec \N '' 4.84813681109535984e-06 \N " \N rightangle 1.57079632679489656 \N 90 degrees \N quadrant 1.57079632679489656 \N 1|4 circle \N quintant 1.25663706143591725 \N 1|5 circle \N sextant 1.04719755119659763 \N 1|6 circle \N sign 0.523598775598298816 \N 1|12 circle \N turn 6.28318530717958623 \N circle \N revolution 6.28318530717958623 \N turn \N rev 6.28318530717958623 \N turn \N pulsatance 1 s^-1 \N radian / sec \N gon 0.015707963267948967 \N 1|100 rightangle \N grade 0.015707963267948967 \N gon \N centesimalminute 0.000157079632679489682 \N 1|100 grade \N centesimalsecond 1.57079632679489688e-06 \N 1|100 centesimalminute \N milangle 0.000981747704246810435 \N 1|6400 circle \N pointangle 0.19634954084936207 \N 1|32 circle \N centrad 0.0100000000000000002 \N 0.01 radian \N mas 4.84813681109536025e-09 \N milliarcsec \N seclongitude 7.27220521664303951e-05 \N circle (seconds/day) \N sphere 12.5663706143591725 \N 4 pi sr \N squaredegree 0.000304617419786708569 \N 1|180^2 pi^2 sr \N squareminute 8.46159499407523867e-08 \N 1|60^2 squaredegree \N squaresecond 2.35044305390978853e-11 \N 1|60^2 squareminute \N squarearcmin 8.46159499407523867e-08 \N squareminute \N squarearcsec 2.35044305390978853e-11 \N squaresecond \N sphericalrightangle 1.57079632679489656 \N 0.5 pi sr \N octant 1.57079632679489656 \N 0.5 pi sr \N percent 0.0100000000000000002 \N 0.01 \N % 0.0100000000000000002 \N percent \N mill 0.00100000000000000002 \N 0.001 \N proof 0.0050000000000000001 \N 1|200 \N ppm 9.99999999999999955e-07 \N 1e-6 \N partspermillion 9.99999999999999955e-07 \N ppm \N ppb 1.00000000000000006e-09 \N 1e-9 \N partsperbillion 1.00000000000000006e-09 \N ppb \N ppt 9.9999999999999998e-13 \N 1e-12 \N partspertrillion 9.9999999999999998e-13 \N ppt \N karat 0.0416666666666666644 \N 1|24 \N caratgold 0.0416666666666666644 \N karat \N gammil 0.000999999999999999804 kg/m^3 \N mg/l \N basispoint 0.000100000000000000005 \N 0.01 % \N fine 0.00100000000000000002 \N 1|1000 \N TEMPERATURE 1 K \N kelvin \N TEMPERATURE_DIFFERENCE 1 K \N kelvin \N degcelsius 1 K 273.15 K \N degC 1 K 273.15 K \N degfahrenheit 0.55555555555555558 K 255.37222222222223 5|9 * degC \N degF 0.55555555555555558 K 255.37222222222223 5|9 * degC \N degreesrankine 0.55555555555555558 K \N degF \N degrankine 0.55555555555555558 K \N degreesrankine \N degreerankine 0.55555555555555558 K \N degF \N degR 0.55555555555555558 K \N degrankine \N tempR 0.55555555555555558 K \N degrankine \N temprankine 0.55555555555555558 K \N degrankine \N degreaumur 1.25 K 273.15 10|8 * degC \N degK 1 K \N K \N tempK 1 K \N K \N tau 6.28318530717958623 \N 2 pi \N phi 1.6180339887498949 \N (sqrt(5)+1)/2 \N light 299792458 m/s \N c \N energy 89875517873681760 m^2/s^2 \N c^2 \N hbar 1.05457181764615647e-34 m^2*kg/s \N h / 2 pi \N hbar_SI 1.05457181764615647e-34 \N h_SI / 2 pi \N spin 1.05457181764615647e-34 m^2*kg/s \N hbar \N G_SI 6.67429999999999938e-11 \N 6.67430e-11 \N G 6.67429999999999938e-11 m^3/kg*s^2 \N 6.67430e-11 N m^2 / kg^2 \N atomicmassunit_SI 1.66053906659999997e-27 \N 1.66053906660e-27 \N atomicmassunit 1.66053906659999997e-27 kg \N 1.66053906660e-27 kg \N u 1.66053906659999997e-27 kg \N atomicmassunit \N amu 1.66053906659999997e-27 kg \N atomicmassunit \N dalton 1.66053906659999997e-27 kg \N u \N Da 1.66053906659999997e-27 kg \N dalton \N amu_chem 1.66026000000000016e-27 kg \N 1.66026e-27 kg \N amu_phys 1.65980999999999993e-27 kg \N 1.65981e-27 kg \N gasconstant 8.3144626181532395 m^2*kg/s^2*K*mol \N k N_A \N R 8.3144626181532395 m^2*kg/s^2*K*mol \N gasconstant \N kboltzmann 1.38064900000000009e-23 m^2*kg/s^2*K \N boltzmann \N molarvolume_si 1.20588319868414834e-05 m^3/mol \N N_A siliconlattice^3 / 8 \N stefanboltzmann 5.67037441918442942e-08 kg/s^3*K^4 \N pi^2 k^4 / 60 hbar^3 c^2 \N sigma 5.67037441918442942e-08 kg/s^3*K^4 \N stefanboltzmann \N wiendisplacement 0.00289777195518517265 m*K \N (h c/k)/4.9651142317442763 \N K_J90 483597900000000 s^2*A/m^2*kg \N 483597.9 GHz/V \N K_J 483597848416983.625 s^2*A/m^2*kg \N 2e/h \N R_K90 25812.8070000000007 m^2*kg/s^3*A^2 \N 25812.807 ohm \N R_K 25812.807459304513 m^2*kg/s^3*A^2 \N h/e^2 \N ampere90 1.00000008887143799 A \N (K_J90 R_K90 / K_J R_K) A \N coulomb90 1.00000008887143799 s*A \N (K_J90 R_K90 / K_J R_K) C \N farad90 0.999999982206332572 s^4*A^2/m^2*kg \N (R_K90/R_K) F \N henry90 1.00000001779366787 m^2*kg/s^2*A^2 \N (R_K/R_K90) H \N ohm90 1.00000001779366787 m^2*kg/s^3*A^2 \N (R_K/R_K90) ohm \N volt90 1.00000010666510719 m^2*kg/s^3*A \N (K_J90/K_J) V \N watt90 1.0000001955365545 m^2*kg/s^3 \N (K_J90^2 R_K90 / K_J^2 R_K) W \N gravity 9.80664999999999942 m/s^2 \N 9.80665 m/s^2 \N force 9.80664999999999942 m/s^2 \N gravity \N atm 101325 kg/m*s^2 \N 101325 Pa \N atmosphere 101325 kg/m*s^2 \N atm \N Hg 133322.387414999976 kg/m^2*s^2 \N 13.5951 gram force / cm^3 \N water 9806.64999999999782 kg/m^2*s^2 \N gram force/cm^3 \N waterdensity 999.999999999999886 kg/m^3 \N gram / cm^3 \N H2O 9806.64999999999782 kg/m^2*s^2 \N water \N wc 9806.64999999999782 kg/m^2*s^2 \N water \N mach 331.45999999999998 m/s \N 331.46 m/s \N standardtemp 273.149999999999977 K \N 273.15 K \N stdtemp 273.149999999999977 K \N standardtemp \N Hg10C 133084.085819999978 kg/m^2*s^2 \N 13.5708 force gram / cm^3 \N Hg20C 132842.84222999998 kg/m^2*s^2 \N 13.5462 force gram / cm^3 \N Hg23C 132768.311689999973 kg/m^2*s^2 \N 13.5386 force gram / cm^3 \N Hg30C 132602.579304999963 kg/m^2*s^2 \N 13.5217 force gram / cm^3 \N Hg40C 132363.297044999985 kg/m^2*s^2 \N 13.4973 force gram / cm^3 \N Hg60F 132952.676709999971 kg/m^2*s^2 \N 13.5574 force gram / cm^3 \N H2O0C 9805.37513549999858 kg/m^2*s^2 \N 0.99987 force gram / cm^3 \N H2O5C 9806.55193349999718 kg/m^2*s^2 \N 0.99999 force gram / cm^3 \N H2O10C 9804.0022044999987 kg/m^2*s^2 \N 0.99973 force gram / cm^3 \N H2O15C 9798.11821449999661 kg/m^2*s^2 \N 0.99913 force gram / cm^3 \N H2O18C 9793.11682299999666 kg/m^2*s^2 \N 0.99862 force gram / cm^3 \N H2O20C 9789.29222949999894 kg/m^2*s^2 \N 0.99823 force gram / cm^3 \N H2O25C 9777.91651549999733 kg/m^2*s^2 \N 0.99707 force gram / cm^3 \N H2O50C 9689.65666549999878 kg/m^2*s^2 \N 0.98807 force gram / cm^3 \N H2O100C 9398.49722699999984 kg/m^2*s^2 \N 0.95838 force gram / cm^3 \N inch 0.0254000000000000024 m \N 2.54 cm \N in 0.0254000000000000024 m \N inch \N inches 0.0254000000000000024 m \N inch \N foot 0.304800000000000015 m \N 12 inch \N feet 0.304800000000000015 m \N foot \N ft 0.304800000000000015 m \N foot \N ft3 0.0283168465920000043 m^3 \N ft^3 \N hartree 4.35974472220709998e-18 m^2*kg/s^2 \N 4.3597447222071e-18 J \N E_h 4.35974472220709998e-18 m^2*kg/s^2 \N hartree \N Rinfinity 10973731.5681598242 m^-1 \N hartree / 2 h c \N alpha 0.00729735256930000038 \N 7.2973525693e-3 \N bohrradius 5.29177210903471087e-11 m \N alpha / 4 pi Rinfinity \N conductancequantum 7.74809172986364871e-05 s^3*A^2/m^2*kg \N 2 e^2 / h \N deuteronchargeradius 2.12799000000000009e-15 m \N 2.12799e-15 m \N protonchargeradius 8.75099999999999961e-16 m \N 0.8751e-15 m \N electronmass_u 0.000548579909065000028 \N 5.48579909065e-4 \N electronmass 9.10938370154308021e-31 kg \N 5.48579909065e-4 u \N m_e 9.10938370154308021e-31 kg \N electronmass \N muonmass 1.88353162739426563e-28 kg \N 0.1134289259 u \N m_mu 1.88353162739426563e-28 kg \N muonmass \N taumass 3.1675446911021641e-27 kg \N 1.90754 u \N m_tau 3.1675446911021641e-27 kg \N taumass \N protonmass 1.67262192369098123e-27 kg \N 1.007276466621 u \N m_p 1.67262192369098123e-27 kg \N protonmass \N neutronmass 1.67492749804378069e-27 kg \N 1.00866491595 u \N m_n 1.67492749804378069e-27 kg \N neutronmass \N deuteronmass 3.34358377244101388e-27 kg \N 2.013553212745 u \N m_d 3.34358377244101388e-27 kg \N deuteronmass \N alphaparticlemass 6.6446573356816816e-27 kg \N 4.001506179127 u \N m_alpha 6.6446573356816816e-27 kg \N alphaparticlemass \N tritonmass 5.00735674462698467e-27 kg \N 3.01550071621 u \N m_t 5.00735674462698467e-27 kg \N tritonmass \N helionmass 5.00641277958621486e-27 kg \N 3.014932247175 u \N m_h 5.00641277958621486e-27 kg \N helionmass \N electronwavelength 2.42631023867161786e-12 m \N h / m_e c \N lambda_C 2.42631023867161786e-12 m \N electronwavelength \N protonwavelength 1.32140985538855929e-15 m \N h / m_p c \N lambda_C,p 1.32140985538855929e-15 m \N protonwavelength \N neutronwavelength 1.31959090580675449e-15 m \N h / m_n c \N lambda_C,n 1.31959090580675449e-15 m \N neutronwavelength \N muonwavelength 1.17344411007417876e-14 m \N h / m_mu c \N lambda_C,mu 1.17344411007417876e-14 m \N muonwavelength \N g_d 0.857438233799999949 \N 0.8574382338 \N g_e -2.00231930436256 \N -2.00231930436256 \N g_h -4.25525061499999957 \N -4.255250615 \N g_mu -2.00233184179999979 \N -2.0023318418 \N g_n -3.82608544999999989 \N -3.82608545 \N g_p 5.58569468930000035 \N 5.5856946893 \N g_t 5.95792493099999998 \N 5.957924931 \N bohrmagneton 9.27401007831830583e-24 m^2*A \N e hbar / 2 electronmass \N mu_B 9.27401007831830583e-24 m^2*A \N bohrmagneton \N nuclearmagneton 5.05078374609341255e-27 m^2*A \N e hbar / 2 protonmass \N mu_N 5.05078374609341255e-27 m^2*A \N nuclearmagneton \N mu_e -9.28476470433484073e-24 m^2*A \N g_e mu_B / 2 \N mu_mu -4.49044829536168336e-26 m^2*A \N g_mu e hbar / 4 muonmass \N mu_p 1.41060679736783667e-26 m^2*A \N g_p mu_N / 2 \N mu_n -9.66236510101225028e-27 m^2*A \N g_n mu_N / 2 \N mu_t 1.50460952009697584e-26 m^2*A \N g_t mu_N / 2 \N mu_d 4.33073509455608299e-27 m^2*A \N g_d mu_N \N mu_h -1.07461753208979971e-26 m^2*A \N g_h mu_N / 2 \N kgf 9.80664999999999942 m*kg/s^2 \N kg force \N technicalatmosphere 98066.4999999999854 kg/m*s^2 \N kgf / cm^2 \N at 98066.4999999999854 kg/m*s^2 \N technicalatmosphere \N hyl 9.80664999999999942 kg \N kgf s^2 / m \N mmHg 133.32238741499998 kg/m*s^2 \N mm Hg \N torr 133.32236842105263 kg/m*s^2 \N atm / 760 \N tor 1 kg/m*s^2 \N Pa \N inHg 3386.3886403409997 kg/m*s^2 \N inch Hg \N inH2O 249.08890999999997 kg/m*s^2 \N inch water \N mmH2O 9.80664999999999765 kg/m*s^2 \N mm water \N eV 1.60217663399999989e-19 m^2*kg/s^2 \N e V \N electronvolt 1.60217663399999989e-19 m^2*kg/s^2 \N eV \N lightsecond 299792458 m \N c s \N lightminute 17987547480 m \N c min \N parsec 30856775814671916 m \N au / tan(arcsec) \N pc 30856775814671916 m \N parsec \N rydberg 2.17987236110354999e-18 m^2*kg/s^2 \N 1|2 hartree \N crith 8.9885000000000011e-05 kg \N 0.089885 gram \N lorentz 46.6864477828202453 s^2*A/m*kg \N bohrmagneton / h c \N cminv 1.9864458571489285e-23 m^2*kg/s^2 \N h c / cm \N invcm 1.9864458571489285e-23 m^2*kg/s^2 \N cminv \N wavenumber 1.9864458571489285e-23 m^2*kg/s^2 \N cminv \N dyne 1.00000000000000008e-05 m*kg/s^2 \N cm gram / s^2 \N dyn 1.00000000000000008e-05 m*kg/s^2 \N dyne \N erg 1.00000000000000009e-07 m^2*kg/s^2 \N cm dyne \N poise 0.100000000000000006 kg/m*s \N gram / cm s \N P 0.100000000000000006 kg/m*s \N poise \N rhe 10 m*s/kg \N /poise \N stokes 0.000100000000000000005 m^2/s \N cm^2 / s \N St 0.000100000000000000005 m^2/s \N stokes \N stoke 0.000100000000000000005 m^2/s \N stokes \N lentor 0.000100000000000000005 m^2/s \N stokes \N Gal 0.0100000000000000002 m/s^2 \N cm / s^2 \N galileo 0.0100000000000000002 m/s^2 \N Gal \N barye 0.100000000000000006 kg/m*s^2 \N dyne/cm^2 \N barad 0.100000000000000006 kg/m*s^2 \N barye \N kayser 100 m^-1 \N 1/cm \N balmer 100 m^-1 \N kayser \N kine 0.0100000000000000002 m/s \N cm/s \N bole 1.00000000000000008e-05 m*kg/s \N g cm / s \N pond 0.00980665000000000009 m*kg/s^2 \N gram force \N glug 0.980665000000000009 kg \N gram force s^2 / cm \N darcy 9.86923266716012824e-13 m^2 \N centipoise cm^2 / s atm \N mobileohm 999.999999999999886 s/kg \N cm / dyn s \N mechanicalohm 0.00100000000000000002 kg/s \N dyn s / cm \N acousticalohm 99999.9999999999854 kg/m^4*s \N dyn s / cm^5 \N ray 99999.9999999999854 kg/m^4*s \N acousticalohm \N rayl 10 kg/m^2*s \N dyn s / cm^3 \N eotvos 1.00000000000000006e-09 s^-2 \N 1e-9 Gal/cm \N statcoulomb 3.33564095198152074e-10 s*A \N 10 coulomb cm / s c \N esu 3.33564095198152074e-10 s*A \N statcoulomb \N statcoul 3.33564095198152074e-10 s*A \N statcoulomb \N statC 3.33564095198152074e-10 s*A \N statcoulomb \N stC 3.33564095198152074e-10 s*A \N statcoulomb \N franklin 3.33564095198152074e-10 s*A \N statcoulomb \N Fr 3.33564095198152074e-10 s*A \N franklin \N statampere 3.33564095198152074e-10 A \N statcoulomb / s \N statamp 3.33564095198152074e-10 A \N statampere \N statA 3.33564095198152074e-10 A \N statampere \N stA 3.33564095198152074e-10 A \N statampere \N statvolt 299.792458000000011 m^2*kg/s^3*A \N dyne cm / statamp sec \N statV 299.792458000000011 m^2*kg/s^3*A \N statvolt \N stV 299.792458000000011 m^2*kg/s^3*A \N statvolt \N statfarad 1.11265005605361846e-12 s^4*A^2/m^2*kg \N statamp sec / statvolt \N statF 1.11265005605361846e-12 s^4*A^2/m^2*kg \N statfarad \N stF 1.11265005605361846e-12 s^4*A^2/m^2*kg \N statfarad \N cmcapacitance 1.11265005605361846e-12 s^4*A^2/m^2*kg \N statfarad \N stathenry 898755178736.817627 m^2*kg/s^2*A^2 \N statvolt sec / statamp \N statH 898755178736.817627 m^2*kg/s^2*A^2 \N stathenry \N stH 898755178736.817627 m^2*kg/s^2*A^2 \N stathenry \N statohm 898755178736.817627 m^2*kg/s^3*A^2 \N statvolt / statamp \N stohm 898755178736.817627 m^2*kg/s^3*A^2 \N statohm \N statmho 1.11265005605361846e-12 s^3*A^2/m^2*kg \N /statohm \N stmho 1.11265005605361846e-12 s^3*A^2/m^2*kg \N statmho \N statweber 299.792458000000011 m^2*kg/s^2*A \N statvolt sec \N statWb 299.792458000000011 m^2*kg/s^2*A \N statweber \N stWb 299.792458000000011 m^2*kg/s^2*A \N statweber \N stattesla 2997924.58000000007 kg/s^2*A \N statWb/cm^2 \N statT 2997924.58000000007 kg/s^2*A \N stattesla \N stT 2997924.58000000007 kg/s^2*A \N stattesla \N debye 3.33564095198152075e-30 m*s*A \N 1e-10 statC angstrom \N helmholtz 3.33564095198152022e-10 s*A/m \N debye/angstrom^2 \N jar 1.11265005605361843e-09 s^4*A^2/m^2*kg \N 1000 statfarad \N abampere 10 A \N 10 A \N abamp 10 A \N abampere \N abA 10 A \N abampere \N biot 10 A \N abampere \N Bi 10 A \N biot \N abcoulomb 10 s*A \N abamp sec \N abcoul 10 s*A \N abcoulomb \N abC 10 s*A \N abcoulomb \N abvolt 1.00000000000000002e-08 m^2*kg/s^3*A \N dyne cm / abamp sec \N abV 1.00000000000000002e-08 m^2*kg/s^3*A \N abvolt \N abohm 1.00000000000000006e-09 m^2*kg/s^3*A^2 \N abvolt / abamp \N abmho 999999999.999999881 s^3*A^2/m^2*kg \N /abohm \N gauss 9.99999999999999912e-05 kg/s^2*A \N abvolt sec / cm^2 \N Gs 9.99999999999999912e-05 kg/s^2*A \N gauss \N maxwell 1.00000000000000002e-08 m^2*kg/s^2*A \N gauss cm^2 \N Mx 1.00000000000000002e-08 m^2*kg/s^2*A \N maxwell \N unitpole 1.25663706143591724e-07 m^2*kg/s^2*A \N 4 pi maxwell \N emu 0.00100000000000000024 m^2*A \N erg/gauss \N hlu_charge 9.4096693978164779e-11 s*A \N statcoulomb / sqrt(4 pi) \N hlu_current 9.4096693978164779e-11 A \N hlu_charge / sec \N hlu_volt 1062.73659330906025 m^2*kg/s^3*A \N erg / hlu_charge \N hlu_efield 106273.659330906026 m*kg/s^3*A \N hlu_volt / cm \N hlu_bfield 0.000354490770181103141 kg/s^2*A \N sqrt(4 pi) gauss \N natural_energy 1.60217663399999989e-19 m^2*kg/s^2 \N eV \N natural_charge 5.29081768988981784e-19 s*A \N e / sqrt(4 pi alpha) \N natural_time 6.58211956950906704e-16 s \N hbar / natural_energy \N natural_length 1.97326980459302515e-07 m \N natural_time c \N natural_mass 1.78266192162789753e-36 kg \N natural_energy / c^2 \N natural_temp 11604.5181215500816 K \N natural_energy / boltzmann \N natural_force 8.11939974082986136e-13 m*kg/s^2 \N natural_energy / natural_length \N natural_power 0.000243413480578794718 m^2*kg/s^3 \N natural_energy / natural_time \N natural_volt 0.302822120872088762 m^2*kg/s^3*A \N natural_energy / natural_charge \N natural_Efield 1534620.96347510861 m*kg/s^3*A \N natural_volt / natural_length \N natural_Bfield 0.00511894453153690938 kg/s^2*A \N natural_Efield / c \N natural_current 0.000803816708890999019 A \N natural_charge / natural_time \N planckmass 2.17643434271789836e-08 kg \N sqrt(hbar c / G) \N m_P 2.17643434271789836e-08 kg \N planckmass \N planckenergy 1956081636.69837284 m^2*kg/s^2 \N planckmass c^2 \N E_P 1956081636.69837284 m^2*kg/s^2 \N planckenergy \N plancktime 5.39124644831360455e-44 s \N hbar / planckenergy \N t_P 5.39124644831360455e-44 s \N plancktime \N plancklength 1.61625502442370555e-35 m \N plancktime c \N l_P 1.61625502442370555e-35 m \N plancklength \N plancktemperature 1.41678416215734246e+32 K \N planckenergy / k \N T_P 1.41678416215734246e+32 K \N plancktemperature \N planckforce 1.21025556433820609e+44 m*kg/s^2 \N planckenergy / plancklength \N planckmass_red 4.34135839913935817e-09 kg \N sqrt(hbar c / 8 pi G) \N planckenergy_red 390181834.397907794 m^2*kg/s^2 \N planckmass_red c^2 \N plancktime_red 2.70277015656936788e-43 s \N hbar / planckenergy_red \N plancklength_red 8.102701086469756e-35 m \N plancktime_red c \N plancktemperature_red 2.82607552243841675e+31 K \N planckenergy_red / k \N planckforce_red 4.81545388672242224e+42 m*kg/s^2 \N planckenergy_red / plancklength_red \N intampere 0.999835000000000029 A \N 0.999835 A \N intamp 0.999835000000000029 A \N intampere \N intfarad 0.999504999999999977 s^4*A^2/m^2*kg \N 0.999505 F \N intvolt 1.00032999999999994 m^2*kg/s^3*A \N 1.00033 V \N intohm 1.00049499999999991 m^2*kg/s^3*A^2 \N 1.000495 ohm \N daniell 1.04200000000000004 m^2*kg/s^3*A \N 1.042 V \N faraday 96485.3321233100141 s*A \N N_A e mol \N faraday_phys 96521.8999999999942 s*A \N 96521.9 C \N faraday_chem 96495.6999999999971 s*A \N 96495.7 C \N kappline 6.00000000000000015e-05 m^2*kg/s^2*A \N 6000 maxwell \N siemensunit 0.953400000000000025 m^2*kg/s^3*A^2 \N 0.9534 ohm \N copperconductivity 58000000 s^3*A^2/m^3*kg \N 58 siemens m / mm^2 \N IACS 58000000 s^3*A^2/m^3*kg \N copperconductivity \N copperdensity 8889.99999999999818 kg/m^3 \N 8.89 g/cm^3 \N LUMINOUS_INTENSITY 1 cd \N candela \N candle 1.02000000000000002 cd \N 1.02 candela \N hefnerunit 0.918000000000000038 cd \N 0.9 candle \N hefnercandle 0.918000000000000038 cd \N hefnerunit \N violle 20.1700000000000017 cd \N 20.17 cd \N lumen 1 cd \N cd sr \N lm 1 cd \N lumen \N talbot 1 s*cd \N lumen s \N lumberg 1 s*cd \N talbot \N lumerg 1 s*cd \N talbot \N lux 1 cd/m^2 \N lm/m^2 \N lx 1 cd/m^2 \N lux \N phot 10000 cd/m^2 \N lumen / cm^2 \N ph 10000 cd/m^2 \N phot \N footcandle 10.7639104167097219 cd/m^2 \N lumen/ft^2 \N metercandle 1 cd/m^2 \N lumen/m^2 \N mcs 1 s*cd/m^2 \N metercandle s \N nox 0.00100000000000000002 cd/m^2 \N 1e-3 lux \N nit 1 cd/m^2 \N cd/m^2 \N stilb 10000 cd/m^2 \N cd / cm^2 \N sb 10000 cd/m^2 \N stilb \N apostilb 0.318309886183790691 cd/m^2 \N cd/pi m^2 \N asb 0.318309886183790691 cd/m^2 \N apostilb \N blondel 0.318309886183790691 cd/m^2 \N apostilb \N equivalentlux 0.318309886183790691 cd/m^2 \N cd / pi m^2 \N equivalentphot 3183.09886183790695 cd/m^2 \N cd / pi cm^2 \N lambert 3183.09886183790695 cd/m^2 \N cd / pi cm^2 \N footlambert 3.42625909963539055 cd/m^2 \N cd / pi ft^2 \N sunlum 1600000000 cd/m^2 \N 1.6e9 cd/m^2 \N sunillum 100000 cd/m^2 \N 100e3 lux \N sunillum_o 10000 cd/m^2 \N 10e3 lux \N sunlum_h 6000000 cd/m^2 \N 6e6 cd/m^2 \N skylum 8000 cd/m^2 \N 8000 cd/m^2 \N skylum_o 2000 cd/m^2 \N 2000 cd/m^2 \N moonlum 2500 cd/m^2 \N 2500 cd/m^2 \N s100 100 m^2/s*cd \N 100 / lx s \N iso100 100 m^2/s*cd \N s100 \N k1250 12.5 s^-1 \N 12.5 (cd/m2) / lx s \N k1400 14 s^-1 \N 14 (cd/m2) / lx s \N c250 250 s^-1 \N 250 lx / lx s \N N_exif 0.320000000000000007 s*cd/m^2 \N 1|3.125 lx s \N K_apex1961 11.4000000000000004 s^-1 \N 11.4 (cd/m2) / lx s \N K_apex1971 12.5 s^-1 \N 12.5 (cd/m2) / lx s \N C_apex1961 224 s^-1 \N 224 lx / lx s \N C_apex1971 322 s^-1 \N 322 lx / lx s \N N_speed 0.320000000000000007 s*cd/m^2 \N N_exif \N K_lum 12.5 s^-1 \N K_apex1971 \N C_illum 224 s^-1 \N C_apex1961 \N TIME 1 s \N second \N anomalisticyear 31558429.4399999976 s \N 365.2596 days \N siderealyear 31558149.5400287993 s \N 365.256360417 day \N tropicalyear 31556925.9746784009 s \N 365.242198781 day \N eclipseyear 29947968 s \N 346.62 days \N solarday 86400 s \N day \N siderealday 86164.0905400000047 s \N 86164.09054 s \N siderealhour 3590.17043916666671 s \N 1|24 siderealday \N siderealminute 59.8361739861111133 s \N 1|60 siderealhour \N siderealsecond 0.997269566435185162 s \N 1|60 siderealminute \N anomalisticmonth 2380713.10012800014 s \N 27.55454977 day \N nodicalmonth 2351135.79936000006 s \N 27.2122199 day \N draconicmonth 2351135.79936000006 s \N nodicalmonth \N draconiticmonth 2351135.79936000006 s \N nodicalmonth \N siderealmonth 2360591.51040000003 s \N 27.321661 day \N lunarmonth 2551442.79999999981 s \N 29 days + 12 hours + 44 minutes + 2.8 seconds \N synodicmonth 2551442.79999999981 s \N lunarmonth \N lunation 2551442.79999999981 s \N synodicmonth \N lune 85048.0933333333232 s \N 1|30 lunation \N lunour 3543.67055555555498 s \N 1|24 lune \N year 31556925.9746784009 s \N tropicalyear \N yr 31556925.9746784009 s \N year \N month 2629743.83122320008 s \N 1|12 year \N mo 2629743.83122320008 s \N month \N lustrum 157784629.873392016 s \N 5 years \N decade 315569259.746784031 s \N 10 years \N century 3155692597.46784019 s \N 100 years \N millennium 31556925974.6784019 s \N 1000 years \N millennia 31556925974.6784019 s \N millennium \N solaryear 31556925.9746784009 s \N year \N lunaryear 30617313.5999999978 s \N 12 lunarmonth \N calendaryear 31536000 s \N 365 day \N commonyear 31536000 s \N 365 day \N leapyear 31622400 s \N 366 day \N julianyear 31557600 s \N 365.25 day \N gregorianyear 31556952 s \N 365.2425 day \N islamicyear 30585600 s \N 354 day \N islamicleapyear 30672000 s \N 355 day \N islamicmonth 2548800 s \N 1|12 islamicyear \N mercuryday_sidereal 5067360 s \N 1407.6 hr \N venusday_sidereal 20997360 s \N 5832.6 hr \N earthday_sidereal 86164.0905400000047 s \N siderealday \N marsday_sidereal 88642.4400000000023 s \N 24.6229 hr \N jupiterday_sidereal 35730 s \N 9.9250 hr \N saturnday_sidereal 38361.5999999999985 s \N 10.656 hr \N uranusday_sidereal 62063.9999999999927 s \N 17.24 hr \N neptuneday_sidereal 57996 s \N 16.11 hr \N plutoday_sidereal 551854.079999999958 s \N 153.2928 hr \N mercuryday_solar 15201360.0000000019 s \N 4222.6 hr \N venusday_solar 10087200 s \N 2802.0 hr \N earthday_solar 86400 s \N 24 hr \N marsday_solar 88774.9199999999983 s \N 24.6597 hr \N jupiterday_solar 35733.239999999998 s \N 9.9259 hr \N saturnday_solar 38361.5999999999985 s \N 10.656 hr \N uranusday_solar 62063.9999999999927 s \N 17.24 hr \N neptuneday_solar 57996 s \N 16.11 hr \N plutoday_solar 551815.20000000007 s \N 153.2820 hr \N mercuryyear 7600521.59999999963 s \N 87.969 day \N venusyear 19414166.3999999985 s \N 224.701 day \N earthyear 31558149.5400287993 s \N siderealyear \N marsyear 59355072 s \N 686.980 day \N jupiteryear 374335689.600000024 s \N 4332.589 day \N saturnyear 929596608 s \N 10759.22 day \N uranusyear 2651218560 s \N 30685.4 day \N neptuneyear 5200329600 s \N 60189 day \N plutoyear 7824384000 s \N 90560 day \N mercuryradius 2440500 m \N 2440.5 km \N venusradius 6051800 m \N 6051.8 km \N earthradius 6371010 m \N 6371.01 km \N marsradius 3396200 m \N 3396.2 km \N jupiterradius 71492000 m \N 71492 km \N saturnradius 60268000 m \N 60268 km \N uranusradius 25559000 m \N 25559 km \N neptuneradius 24764000 m \N 24764 km \N plutoradius 1188000 m \N 1188 km \N mercurysundist_min 46000000000 m \N 46.000 Gm \N mercurysundist_max 69818000000 m \N 69.818 Gm \N venussundist_min 107480000000 m \N 107.480 Gm \N venussundist_max 108941000000 m \N 108.941 Gm \N marssundist_min 206650000000 m \N 206.650 Gm \N marssundist_max 249261000000 m \N 249.261 Gm \N jupitersundist_min 740595000000 m \N 740.595 Gm \N jupitersundist_max 816363000000 m \N 816.363 Gm \N saturnsundist_min 1357554000000 m \N 1357.554 Gm \N saturnsundist_max 1506527000000 m \N 1506.527 Gm \N uranussundist_min 2732696000000 m \N 2732.696 Gm \N uranussundist_max 3001390000000 m \N 3001.390 Gm \N neptunesundist_min 4471050000000 m \N 4471.050 Gm \N neptunesundist_max 4558857000000 m \N 4558.857 Gm \N plutosundist_min 4434987000000 m \N 4434.987 Gm \N plutosundist_max 7304326000000 m \N 7304.326 Gm \N sundist 149598022960.712799 m \N 1.0000010178 au \N moondist 384400000 m \N 3.844e8 m \N sundist_near 147095000000 m \N 147.095 Gm \N sundist_min 147095000000 m \N sundist_near \N sundist_far 152100000000 m \N 152.100 Gm \N sundist_max 152100000000 m \N sundist_far \N moondist_min 356371 m \N 356.371 km \N moondist_max 406720 m \N 406.720 km \N WGS84_earthflattening 0.00335281066474748049 \N 1|298.257223563 \N WGS84_earthradius_equatorial 6378137 m \N 6378137 m \N WGS84_earthradius_polar 6356752.3142451793 m \N (1-WGS84_earthflattening) WGS84_earthradius_equatorial \N IERS_earthflattening 0.00335281969789619303 \N 1|298.25642 \N IERS_earthradius_equatorial 6378136.59999999963 m \N 6378136.6 m \N IERS_earthradius_polar 6356751.85797164682 m \N (1-IERS_earthflattening) IERS_earthradius_equatorial \N landarea 148847000000000 m^2 \N 148.847e6 km^2 \N oceanarea 361254000000000 m^2 \N 361.254e6 km^2 \N moonradius 1738000 m \N 1738 km \N sunradius 696000000 m \N 6.96e8 m \N gauss_k 0.0172020989500000013 \N 0.01720209895 \N gaussianyear 31558196.0153947473 s \N (2 pi / gauss_k) days \N GMsun 1.32712440041279422e+20 m^3/s^2 \N 132712440041.279419 km^3 / s^2 \N solarmass 1.98840987131653396e+30 kg \N GMsun/G \N sunmass 1.98840987131653396e+30 kg \N solarmass \N mercurymass 3.30100063692072606e+23 kg \N 22031.868551 km^3 / s^2 G \N venusmass 4.86730581484200644e+24 kg \N 324858.592000 km^3 / s^2 G \N marsmass 6.41690901158173969e+23 kg \N 42828.375816 km^3 / s^2 G \N jupitermass 1.89851765878069623e+27 kg \N 126712764.100000 km^3 / s^2 G \N saturnmass 5.68457888344845174e+26 kg \N 37940584.841800 km^3 / s^2 G \N uranusmass 8.68189383156286049e+25 kg \N 5794556.400000 km^3 / s^2 G \N neptunemass 1.02430623444855642e+26 kg \N 6836527.100580 km^3 / s^2 G \N plutomass 1.46157649491332442e+22 kg \N 975.500000 km^3 / s^2 G \N ceresmass 9.38359078854711443e+20 kg \N 62.62890 km^3 / s^2 G \N vestamass 2.59027088983114351e+20 kg \N 17.288245 km^3 / s^2 G \N earthmass 5.97216839978724456e+24 kg \N 398600.435507 km^3 / s^2 G \N moonmass 7.34578924831068505e+22 kg \N 4902.800118 km^3 / s^2 G \N moonearthmassratio 0.0123000370327339976 \N moonmass/earthmass \N earthmoonmass 6.04562629227035133e+24 kg \N earthmass+moonmass \N moongravity 1.62000000000000011 m/s^2 \N 1.62 m/s^2 \N gravity_equatorial 9.78032633589999989 m/s^2 \N 9.7803263359 m / s^2 \N gravity_polar 9.83218493779999925 m/s^2 \N 9.8321849378 m / s^2 \N hubble 2.26854550262882893e-18 s^-1 \N 70 km/s/Mpc \N H0 2.26854550262882893e-18 s^-1 \N hubble \N extinction_coeff 0.209999999999999992 \N 0.21 \N moonvmag -12.7400000000000002 \N -12.74 \N sunvmag -26.7399999999999984 \N -26.74 \N moonsd 0.0045213473505428441 \N asin(moonradius / moondist) \N sunsd 0.00465248468611326182 \N asin(sunradius / sundist) \N atomicmass 9.10938370154308021e-31 kg \N electronmass \N atomiccharge 1.60217663399999989e-19 s*A \N e \N atomicaction 1.05457181764615647e-34 m^2*kg/s \N hbar \N atomicenergy 4.35974472220709998e-18 m^2*kg/s^2 \N hartree \N atomicvelocity 2187691.26364000095 m/s \N sqrt(atomicenergy / atomicmass) \N atomictime 2.41888432658571915e-17 s \N atomicaction / atomicenergy \N atomiclength 5.29177210902730437e-11 m \N atomicvelocity atomictime \N atomicforce 8.23872349825827401e-08 m*kg/s^2 \N atomicenergy / atomiclength \N atomicmomentum 1.99285191410104071e-24 m*kg/s \N atomicenergy / atomicvelocity \N atomiccurrent 0.00662361823750989061 A \N atomiccharge / atomictime \N atomicpotential 27.2113862459880345 m^2*kg/s^3*A \N atomicenergy / atomiccharge \N atomicvolt 27.2113862459880345 m^2*kg/s^3*A \N atomicpotential \N atomicEfield 514220674763.521423 m*kg/s^3*A \N atomicpotential / atomiclength \N atomicBfield 235051.756758370379 kg/s^2*A \N atomicEfield / atomicvelocity \N atomictemperature 315775.02480406675 K \N atomicenergy / boltzmann \N thermalcoulomb 1 m^2*kg/s^2*K \N J/K \N thermalampere 1 m^2*kg/s^3*K \N W/K \N thermalfarad 1 m^2*kg/s^2*K^2 \N J/K^2 \N thermalohm 1 s^3*K^2/m^2*kg \N K^2/W \N fourier 1 s^3*K^2/m^2*kg \N thermalohm \N thermalhenry 1 s^4*K^2/m^2*kg \N J K^2/W^2 \N thermalvolt 1 K \N K \N US 1.00000200000399997 \N 1200|3937 m/ft \N int 0.999998000000000054 \N 3937|1200 ft/m \N yard 0.914400000000000102 m \N 3 ft \N yd 0.914400000000000102 m \N yard \N mile 1609.34400000000005 m \N 5280 ft \N line 0.00211666666666666687 m \N 1|12 inch \N rod 5.02920000000000034 m \N 5.5 yard \N perch 5.02920000000000034 m \N rod \N furlong 201.168000000000006 m \N 40 rod \N statutemile 1609.34400000000005 m \N mile \N league 4828.03200000000015 m \N 3 mile \N surveyorschain 20.1168402336804668 m \N 66 surveyft \N surveychain 20.1168402336804668 m \N surveyorschain \N surveyorspole 5.0292100584201167 m \N 1|4 surveyorschain \N surveyorslink 0.201168402336804664 m \N 1|100 surveyorschain \N chain 20.1168000000000013 m \N 66 ft \N link 0.201168000000000013 m \N 1|100 chain \N ch 20.1168000000000013 m \N chain \N USacre 4046.87260987425179 m^2 \N 10 surveychain^2 \N intacre 4046.85642240000061 m^2 \N 10 chain^2 \N USacrefoot 1233.48923846814887 m^3 \N USacre surveyfoot \N acre 4046.85642240000061 m^2 \N intacre \N section 2589988.1103360001 m^2 \N mile^2 \N township 93239571.9720959961 m^2 \N 36 section \N homestead 647497.027584000141 m^2 \N 160 acre \N gunterschain 20.1168402336804668 m \N surveyorschain \N engineerschain 30.4800000000000004 m \N 100 ft \N engineerslink 0.304800000000000015 m \N 1|100 engineerschain \N ramsdenschain 30.4800000000000004 m \N engineerschain \N ramsdenslink 0.304800000000000015 m \N engineerslink \N gurleychain 10.0584000000000007 m \N 33 feet \N gurleylink 0.201168000000000013 m \N 1|50 gurleychain \N wingchain 20.1168000000000013 m \N 66 feet \N winglink 0.251460000000000017 m \N 1|80 wingchain \N troughtonyard 0.914421900000000121 m \N 914.42190 mm \N bronzeyard11 0.914399800000000096 m \N 914.39980 mm \N mendenhallyard 0.914401828803657724 m \N surveyyard \N internationalyard 0.914400000000000102 m \N yard \N fathom 1.8288000000000002 m \N 6 ft \N nauticalmile 1852 m \N 1852 m \N cable 185.200000000000017 m \N 1|10 nauticalmile \N intcable 185.200000000000017 m \N cable \N cablelength 185.200000000000017 m \N cable \N UScable 182.880365760731536 m \N 100 USfathom \N navycablelength 219.456438912877815 m \N 720 USft \N marineleague 5556 m \N 3 nauticalmile \N knot 0.514444444444444482 m/s \N nauticalmile / hr \N click 1000 m \N km \N klick 1000 m \N click \N pound 0.453592370000000022 kg \N 0.45359237 kg \N lb 0.453592370000000022 kg \N pound \N grain 6.47989100000000081e-05 kg \N 1|7000 pound \N ounce 0.0283495231250000014 kg \N 1|16 pound \N oz 0.0283495231250000014 kg \N ounce \N dram 0.00177184519531250009 kg \N 1|16 ounce \N dr 0.00177184519531250009 kg \N dram \N ushundredweight 45.3592370000000003 kg \N 100 pounds \N shorthundredweight 45.3592370000000003 kg \N ushundredweight \N shortton 907.184740000000033 kg \N 2000 lb \N shortquarterweight 226.796185000000008 kg \N 1|4 shortton \N shortquarter 226.796185000000008 kg \N shortquarterweight \N troypound 0.37324172160000002 kg \N 5760 grain \N troyounce 0.0311034768000000017 kg \N 1|12 troypound \N ozt 0.0311034768000000017 kg \N troyounce \N pennyweight 0.00155517384000000009 kg \N 1|20 troyounce \N dwt 0.00155517384000000009 kg \N pennyweight \N fineounce 0.0311034768000000017 kg \N troyounce \N metriccarat 0.00020000000000000001 kg \N 0.2 gram \N metricgrain 4.99999999999999956e-05 kg \N 50 mg \N carat 0.00020000000000000001 kg \N metriccarat \N ct 0.00020000000000000001 kg \N carat \N jewelerspoint 2.00000000000000033e-06 kg \N 1|100 carat \N silversmithpoint 6.35000000000000104e-06 m \N 1|4000 inch \N momme 0.00374999999999999986 kg \N 3.75 grams \N appound 0.37324172160000002 kg \N troypound \N apounce 0.0311034768000000017 kg \N troyounce \N apdram 0.00388793460000000021 kg \N 1|8 apounce \N apscruple 0.0012959782 kg \N 1|3 apdram \N usgallon 0.00378541178400000145 m^3 \N 231 in^3 \N gallon 0.00378541178400000145 m^3 \N usgallon \N gal 0.00378541178400000145 m^3 \N gallon \N quart 0.000946352946000000362 m^3 \N 1|4 gallon \N pint 0.000473176473000000181 m^3 \N 1|2 quart \N gill 0.000118294118250000045 m^3 \N 1|4 pint \N usquart 0.000946352946000000362 m^3 \N 1|4 usgallon \N uspint 0.000473176473000000181 m^3 \N 1|2 usquart \N usgill 0.000118294118250000045 m^3 \N 1|4 uspint \N usfluidounce 2.95735295625000113e-05 m^3 \N 1|16 uspint \N qt 0.000946352946000000362 m^3 \N quart \N pt 0.000473176473000000181 m^3 \N pint \N usfloz 2.95735295625000113e-05 m^3 \N usfluidounce \N liquidbarrel 0.11924047119600005 m^3 \N 31.5 usgallon \N beerkeg 0.0586738826520000201 m^3 \N 15.5 usgallon \N ponykeg 0.02933694132600001 m^3 \N 1|2 beerkeg \N winekeg 0.0454249414080000191 m^3 \N 12 usgallon \N petroleumbarrel 0.158987294928000067 m^3 \N 42 usgallon \N barrel 0.158987294928000067 m^3 \N petroleumbarrel \N bbl 0.158987294928000067 m^3 \N barrel \N ushogshead 0.2384809423920001 m^3 \N 2 liquidbarrel \N usfirkin 0.0340687060560000143 m^3 \N 9 usgallon \N usbushel 0.0352390701668800141 m^3 \N 2150.42 in^3 \N uspeck 0.00880976754172000352 m^3 \N 1|4 usbushel \N drygallon 0.00440488377086000176 m^3 \N 1|2 uspeck \N dryquart 0.00110122094271500044 m^3 \N 1|4 drygallon \N drypint 0.00055061047135750022 m^3 \N 1|2 dryquart \N drybarrel 0.115627123584000041 m^3 \N 7056 in^3 \N cranberrybarrel 0.0954710348640000345 m^3 \N 5826 in^3 \N heapedbushel 0.0450355316732726565 m^3 \N 1.278 usbushel \N wheatbushel 27.2155422000000016 kg \N 60 lb \N soybeanbushel 27.2155422000000016 kg \N 60 lb \N cornbushel 25.4011727200000017 kg \N 56 lb \N ryebushel 25.4011727200000017 kg \N 56 lb \N barleybushel 21.772433760000002 kg \N 48 lb \N oatbushel 14.5149558400000007 kg \N 32 lb \N ricebushel 20.4116566500000012 kg \N 45 lb \N canada_oatbushel 15.4221405800000007 kg \N 34 lb \N ponyvolume 2.95735295625000113e-05 m^3 \N 1 usfloz \N jigger 4.43602943437500187e-05 m^3 \N 1.5 usfloz \N shot 4.43602943437500187e-05 m^3 \N jigger \N eushot 2.50000000000000046e-05 m^3 \N 25 ml \N fifth 0.000757082356800000311 m^3 \N 1|5 usgallon \N winebottle 0.000750000000000000124 m^3 \N 750 ml \N winesplit 0.000187500000000000031 m^3 \N 1|4 winebottle \N magnum 0.00150000000000000046 m^3 \N 1.5 liter \N metrictenth 0.000375000000000000062 m^3 \N 375 ml \N metricfifth 0.000750000000000000124 m^3 \N 750 ml \N metricquart 0.00100000000000000024 m^3 \N 1 liter \N split 0.000200000000000000037 m^3 \N 200 ml \N jeroboam 0.00300000000000000093 m^3 \N 2 magnum \N rehoboam 0.00450000000000000139 m^3 \N 3 magnum \N methuselah 0.00600000000000000186 m^3 \N 4 magnum \N imperialbottle 0.00600000000000000186 m^3 \N 4 magnum \N salmanazar 0.00900000000000000279 m^3 \N 6 magnum \N balthazar 0.0120000000000000037 m^3 \N 8 magnum \N nebuchadnezzar 0.0150000000000000046 m^3 \N 10 magnum \N solomon 0.0180000000000000056 m^3 \N 12 magnum \N melchior 0.0180000000000000056 m^3 \N 12 magnum \N sovereign 0.0262500000000000094 m^3 \N 17.5 magnum \N primat 0.0270000000000000101 m^3 \N 18 magnum \N goliath 0.0270000000000000101 m^3 \N 18 magnum \N melchizedek 0.0300000000000000093 m^3 \N 20 magnum \N midas 0.0300000000000000093 m^3 \N 20 magnum \N wineglass 0.000150000000000000014 m^3 \N 150 mL \N coffeeratio 54.9999999999999858 kg/m^3 \N 55 g/L \N gpg 0.0171180610452709436 kg/m^3 \N grains/usgallon \N shoeiron 0.000529166666666666717 m \N 1|48 inch \N shoeounce 0.000396875000000000038 m \N 1|64 inch \N shoesize_delta 0.00846666666666666748 m \N 1|3 inch \N shoe_men0 0.209550000000000014 m \N 8.25 inch \N shoe_women0 0.201083333333333364 m \N (7+11|12) inch \N shoe_boys0 0.0994833333333333403 m \N (3+11|12) inch \N shoe_girls0 0.0910166666666666763 m \N (3+7|12) inch \N europeshoesize 0.00666666666666666623 m \N 2|3 cm \N key 1 kg \N kg \N lid 0.0283495231250000014 kg \N 1 oz \N usfootballfield 91.4400000000000119 m \N 100 yards \N canadafootballfield 100.584000000000017 m \N 110 yards \N marathon 42194.9880000000048 m \N 26 miles + 385 yards \N UKlength_B 0.999999125109361175 \N 0.9143992 meter / yard \N UKlength_SJJ 0.999998261154855572 \N 0.91439841 meter / yard \N UKlength_K 0.9999819343263745 \N meter / 39.37079 inch \N UKlength_C 0.999991028296492002 \N meter / 1.09362311 yard \N brnauticalmile 1853.1840000000002 m \N 6080 ft \N brknot 0.514773333333333416 m/s \N brnauticalmile / hr \N brcable 185.318400000000025 m \N 1|10 brnauticalmile \N admiraltymile 1853.1840000000002 m \N brnauticalmile \N admiraltyknot 0.514773333333333416 m/s \N brknot \N admiraltycable 185.318400000000025 m \N brcable \N seamile 1828.80000000000018 m \N 6000 ft \N shackle 27.4320000000000022 m \N 15 fathoms \N clove 3.17514659000000021 kg \N 7 lb \N stone 6.35029318000000043 kg \N 14 lb \N tod 12.7005863600000009 kg \N 28 lb \N brhundredweight 50.8023454400000034 kg \N 8 stone \N longhundredweight 50.8023454400000034 kg \N brhundredweight \N longton 1016.0469088000001 kg \N 20 brhundredweight \N brton 1016.0469088000001 kg \N longton \N brgallon 0.00454609000000000176 m^3 \N 4.54609 l \N brbarrel 0.163659240000000067 m^3 \N 36 brgallon \N brbushel 0.0363687200000000141 m^3 \N 8 brgallon \N brheapedbushel 0.0464792241600000197 m^3 \N 1.278 brbushel \N brquarter 0.290949760000000113 m^3 \N 8 brbushel \N brchaldron 1.30927392000000054 m^3 \N 36 brbushel \N bag 0.145474880000000056 m^3 \N 4 brbushel \N bucket 0.018184360000000007 m^3 \N 4 brgallon \N last 1.45474880000000062 m^3 \N 40 brbushel \N pottle 0.00227304500000000088 m^3 \N 0.5 brgallon \N pin 0.0204574050000000084 m^3 \N 4.5 brgallon \N puncheon 0.327318480000000134 m^3 \N 72 brgallon \N seam 0.290949760000000113 m^3 \N 8 brbushel \N coomb 0.145474880000000056 m^3 \N 4 brbushel \N boll 0.218212320000000071 m^3 \N 6 brbushel \N firlot 0.0545530800000000177 m^3 \N 1|4 boll \N brfirkin 0.0409148100000000167 m^3 \N 9 brgallon \N cran 0.170478375000000071 m^3 \N 37.5 brgallon \N brwinehogshead 0.238669725000000083 m^3 \N 52.5 brgallon \N brhogshead 0.238669725000000083 m^3 \N brwinehogshead \N brbeerhogshead 0.245488860000000086 m^3 \N 54 brgallon \N brbeerbutt 0.490977720000000173 m^3 \N 2 brbeerhogshead \N registerton 2.83168465920000045 m^3 \N 100 ft^3 \N shippington 1.13267386368000023 m^3 \N 40 ft^3 \N brshippington 1.18930755686400014 m^3 \N 42 ft^3 \N freightton 1.13267386368000023 m^3 \N shippington \N displacementton 0.991089630720000114 m^3 \N 35 ft^3 \N waterton 1.01832416000000037 m^3 \N 224 brgallon \N strike 0.070500000000000021 m^3 \N 70.5 l \N amber 0.145474880000000056 m^3 \N 4 brbushel \N imperialgallon 0.00454609000000000176 m^3 \N brgallon \N imperialbarrel 0.163659240000000067 m^3 \N brbarrel \N imperialbushel 0.0363687200000000141 m^3 \N brbushel \N imperialheapedbushel 0.0464792241600000197 m^3 \N brheapedbushel \N imperialquarter 0.290949760000000113 m^3 \N brquarter \N imperialchaldron 1.30927392000000054 m^3 \N brchaldron \N imperialwinehogshead 0.238669725000000083 m^3 \N brwinehogshead \N imperialhogshead 0.238669725000000083 m^3 \N brhogshead \N imperialbeerhogshead 0.245488860000000086 m^3 \N brbeerhogshead \N imperialbeerbutt 0.490977720000000173 m^3 \N brbeerbutt \N imperialfirkin 0.0409148100000000167 m^3 \N brfirkin \N hide 485622.770688000077 m^2 \N 120 acre \N virgate 121405.692672000019 m^2 \N 1|4 hide \N nook 60702.8463360000096 m^2 \N 1|2 virgate \N rood 1011.71410560000015 m^2 \N furlong rod \N englishcarat 0.000205303477227722776 kg \N troyounce/151.5 \N mancus 0.0566990462500000028 kg \N 2 oz \N mast 1.13398092500000014 kg \N 2.5 lb \N nailkeg 45.3592370000000003 kg \N 100 lbs \N basebox 20.232217600000002 m^2 \N 31360 in^2 \N gramme 0.00100000000000000002 kg \N gram \N litre 0.00100000000000000024 m^3 \N liter \N dioptre 1 m^-1 \N diopter \N geometricpace 1.52400000000000002 m \N 5 ft \N pace 0.762000000000000011 m \N 2.5 ft \N USmilitarypace 0.762000000000000122 m \N 30 in \N USdoubletimepace 0.914400000000000102 m \N 36 in \N fingerbreadth 0.0222250000000000017 m \N 7|8 in \N fingerlength 0.114300000000000013 m \N 4.5 in \N finger 0.0222250000000000017 m \N fingerbreadth \N palmlength 0.203200000000000019 m \N 8 in \N hand 0.10160000000000001 m \N 4 inch \N shaftment 0.152400000000000008 m \N 6 inch \N smoot 1.70179999999999998 m \N 5 ft + 7 in \N tomcruise 1.72084999999999999 m \N 5 ft + 7.75 in \N uscup 0.000236588236500000091 m^3 \N 8 usfloz \N ustablespoon 1.47867647812500057e-05 m^3 \N 1|16 uscup \N usteaspoon 4.92892159375000132e-06 m^3 \N 1|3 ustablespoon \N ustbl 1.47867647812500057e-05 m^3 \N ustablespoon \N ustbsp 1.47867647812500057e-05 m^3 \N ustablespoon \N ustblsp 1.47867647812500057e-05 m^3 \N ustablespoon \N ustsp 4.92892159375000132e-06 m^3 \N usteaspoon \N metriccup 0.000250000000000000059 m^3 \N 250 ml \N stickbutter 0.113398092500000006 kg \N 1|4 lb \N legalcup 0.000240000000000000033 m^3 \N 240 ml \N legaltablespoon 1.50000000000000021e-05 m^3 \N 1|16 legalcup \N legaltbsp 1.50000000000000021e-05 m^3 \N legaltablespoon \N number1can 0.000295735295625000106 m^3 \N 10 usfloz \N number2can 0.000561897061687500164 m^3 \N 19 usfloz \N number2_5can 0.000828058827750000276 m^3 \N 3.5 uscups \N number3can 0.000946352946000000362 m^3 \N 4 uscups \N number5can 0.00165611765550000055 m^3 \N 7 uscups \N number10can 0.00310522060406250109 m^3 \N 105 usfloz \N brtablespoon 1.50000000000000021e-05 m^3 \N 15 ml \N brteaspoon 5.00000000000000041e-06 m^3 \N 1|3 brtablespoon \N brdessertspoon 1.00000000000000008e-05 m^3 \N 2 brteaspoon \N dessertspoon 1.00000000000000008e-05 m^3 \N brdessertspoon \N dsp 1.00000000000000008e-05 m^3 \N dessertspoon \N brtsp 5.00000000000000041e-06 m^3 \N brteaspoon \N brtbl 1.50000000000000021e-05 m^3 \N brtablespoon \N brtbsp 1.50000000000000021e-05 m^3 \N brtablespoon \N brtblsp 1.50000000000000021e-05 m^3 \N brtablespoon \N australiatablespoon 2.0000000000000005e-05 m^3 \N 20 ml \N austbl 2.0000000000000005e-05 m^3 \N australiatablespoon \N austbsp 2.0000000000000005e-05 m^3 \N australiatablespoon \N austblsp 2.0000000000000005e-05 m^3 \N australiatablespoon \N australiateaspoon 5.00000000000000126e-06 m^3 \N 1|4 australiatablespoon \N austsp 5.00000000000000126e-06 m^3 \N australiateaspoon \N etto 0.100000000000000006 kg \N 100 g \N etti 0.100000000000000006 kg \N etto \N catty 0.5 kg \N 0.5 kg \N oldcatty 0.604789826666666697 kg \N 4|3 lbs \N tael 0.0377993641666666685 kg \N 1|16 oldcatty \N mace 0.00377993641666666711 kg \N 0.1 tael \N oldpicul 60.478982666666667 kg \N 100 oldcatty \N picul 50 kg \N 100 catty \N seer 0.933104304000000107 kg \N 14400 grain \N ser 0.933104304000000107 kg \N seer \N maund 37.3241721600000034 kg \N 40 seer \N pakistanseer 1 kg \N 1 kg \N pakistanmaund 40 kg \N 40 pakistanseer \N chittak 0.0583190190000000067 kg \N 1|16 seer \N tola 0.0116638038000000024 kg \N 1|5 chittak \N ollock 0.000250000000000000059 m^3 \N 1|4 liter \N japancup 0.000200000000000000037 m^3 \N 200 ml \N butter 958.611418535172675 kg/m^3 \N 8 oz/uscup \N butter_clarified 814.819705754896859 kg/m^3 \N 6.8 oz/uscup \N cocoa_butter 1078.43784585206936 kg/m^3 \N 9 oz/uscup \N shortening 808.828384389051962 kg/m^3 \N 6.75 oz/uscup \N oil 898.69820487672439 kg/m^3 \N 7.5 oz/uscup \N cakeflour_sifted 419.392495609138052 kg/m^3 \N 3.5 oz/uscup \N cakeflour_spooned 479.305709267586337 kg/m^3 \N 4 oz/uscup \N cakeflour_scooped 539.218922926034679 kg/m^3 \N 4.5 oz/uscup \N flour_sifted 479.305709267586337 kg/m^3 \N 4 oz/uscup \N flour_spooned 509.26231609681048 kg/m^3 \N 4.25 oz/uscup \N flour_scooped 599.132136584482964 kg/m^3 \N 5 oz/uscup \N breadflour_sifted 509.26231609681048 kg/m^3 \N 4.25 oz/uscup \N breadflour_spooned 539.218922926034679 kg/m^3 \N 4.5 oz/uscup \N breadflour_scooped 659.045350242931249 kg/m^3 \N 5.5 oz/uscup \N cornstarch 507.210340527644746 kg/m^3 \N 120 grams/uscup \N dutchcocoa_sifted 317.006462829777945 kg/m^3 \N 75 g/uscup \N dutchcocoa_spooned 388.861261071194292 kg/m^3 \N 92 g/uscup \N dutchcocoa_scooped 401.541519584385469 kg/m^3 \N 95 g/uscup \N cocoa_sifted 317.006462829777945 kg/m^3 \N 75 g/uscup \N cocoa_spooned 346.593732693890615 kg/m^3 \N 82 g/uscup \N cocoa_scooped 401.541519584385469 kg/m^3 \N 95 g/uscup \N heavycream 980.606658353446619 kg/m^3 \N 232 g/uscup \N milk 1022.87418673075024 kg/m^3 \N 242 g/uscup \N sourcream 1022.87418673075024 kg/m^3 \N 242 g/uscup \N molasses 1348.04730731508653 kg/m^3 \N 11.25 oz/uscup \N cornsyrup 1378.00391414431078 kg/m^3 \N 11.5 oz/uscup \N honey 1407.96052097353481 kg/m^3 \N 11.75 oz/uscup \N sugar 845.350567546074672 kg/m^3 \N 200 g/uscup \N powdered_sugar 479.305709267586337 kg/m^3 \N 4 oz/uscup \N brownsugar_light 917.205365787490905 kg/m^3 \N 217 g/uscup \N brownsugar_dark 1010.19392821755923 kg/m^3 \N 239 g/uscup \N baking_powder 933.267026570866506 kg/m^3 \N 4.6 grams / ustsp \N salt 1217.30481726634753 kg/m^3 \N 6 g / ustsp \N koshersalt 568.075581390962157 kg/m^3 \N 2.8 g / ustsp \N koshersalt_morton 973.843853813077999 kg/m^3 \N 4.8 g / ustsp \N egg 0.0500000000000000028 kg \N 50 grams \N eggwhite 0.0299999999999999989 kg \N 30 grams \N eggyolk 0.0186000000000000019 kg \N 18.6 grams \N eggvolume 4.68247551406250227e-05 m^3 \N 3 ustablespoons + 1|2 ustsp \N eggwhitevolume 2.95735295625000113e-05 m^3 \N 2 ustablespoons \N eggyolkvolume 1.72512255781250046e-05 m^3 \N 3.5 ustsp \N ethanoldensity 789.299999999999955 kg/m^3 \N 0.7893 g/cm^3 \N alcoholdensity 789.299999999999955 kg/m^3 \N ethanoldensity \N baumeconst 145 \N 145 \N wood_cherry 560.646218088604883 kg/m^3 \N 35 lb/ft^3 \N wood_redoak 704.812388454246161 kg/m^3 \N 44 lb/ft^3 \N wood_whiteoak 752.867778576126398 kg/m^3 \N 47 lb/ft^3 \N wood_blackwalnut 608.701608210485233 kg/m^3 \N 38 lb/ft^3 \N wood_walnut 608.701608210485233 kg/m^3 \N wood_blackwalnut \N wood_birch 688.793925080285931 kg/m^3 \N 43 lb/ft^3 \N wood_hardmaple 704.812388454246161 kg/m^3 \N 44 lb/ft^3 \N wood_bigleafmaple 544.627754714644652 kg/m^3 \N 34 lb/ft^3 \N wood_boxeldermaple 480.553901218804128 kg/m^3 \N 30 lb/ft^3 \N wood_redmaple 608.701608210485233 kg/m^3 \N 38 lb/ft^3 \N wood_silvermaple 528.609291340684535 kg/m^3 \N 33 lb/ft^3 \N wood_stripedmaple 512.590827966724419 kg/m^3 \N 32 lb/ft^3 \N wood_softmaple 535.016676690268696 kg/m^3 \N (wood_bigleafmaple + wood_boxeldermaple + wood_redmaple + wood_silvermaple + wood_stripedmaple) / 5 \N wood_poplar 464.535437844843955 kg/m^3 \N 29 lb/ft^3 \N wood_beech 720.830851828206164 kg/m^3 \N 45 lb/ft^3 \N wood_jeffreypine 448.516974470883895 kg/m^3 \N 28 lb/ft^3 \N wood_ocotepine 704.812388454246161 kg/m^3 \N 44 lb/ft^3 \N wood_ponderosapine 448.516974470883895 kg/m^3 \N 28 lb/ft^3 \N wood_loblollypine 560.646218088604883 kg/m^3 \N 35 lb/ft^3 \N wood_longleafpine 656.756998332365697 kg/m^3 \N 41 lb/ft^3 \N wood_shortleafpine 560.646218088604883 kg/m^3 \N 35 lb/ft^3 \N wood_slashpine 656.756998332365697 kg/m^3 \N 41 lb/ft^3 \N wood_yellowpine 608.701608210485347 kg/m^3 \N (wood_loblollypine + wood_longleafpine + wood_shortleafpine + wood_slashpine) / 4 \N wood_redpine 544.627754714644652 kg/m^3 \N 34 lb/ft^3 \N wood_easternwhitepine 400.461584349003431 kg/m^3 \N 25 lb/ft^3 \N wood_westernwhitepine 432.498511096923721 kg/m^3 \N 27 lb/ft^3 \N wood_whitepine 416.480047722963604 kg/m^3 \N (wood_easternwhitepine + wood_westernwhitepine) / 2 \N wood_douglasfir 512.590827966724419 kg/m^3 \N 32 lb/ft^3 \N wood_blackspruce 448.516974470883895 kg/m^3 \N 28 lb/ft^3 \N wood_engelmannspruce 384.443120975043314 kg/m^3 \N 24 lb/ft^3 \N wood_redspruce 432.498511096923721 kg/m^3 \N 27 lb/ft^3 \N wood_sitkaspruce 432.498511096923721 kg/m^3 \N 27 lb/ft^3 \N wood_whitespruce 432.498511096923721 kg/m^3 \N 27 lb/ft^3 \N wood_spruce 426.091125747339731 kg/m^3 \N (wood_blackspruce + wood_engelmannspruce + wood_redspruce + wood_sitkaspruce + wood_whitespruce) / 5 \N wood_basswood 416.480047722963604 kg/m^3 \N 26 lb/ft^3 \N wood_balsa 144.16617036564125 kg/m^3 \N 9 lb/ft^3 \N wood_ebony_gaboon 961.107802437608257 kg/m^3 \N 60 lb/ft^3 \N wood_ebony_macassar 1121.29243617720977 kg/m^3 \N 70 lb/ft^3 \N wood_mahogany 592.683144836525116 kg/m^3 \N 37 lb/ft^3 \N wood_teak 656.756998332365697 kg/m^3 \N 41 lb/ft^3 \N wood_rosewood_brazilian 832.960095445927209 kg/m^3 \N 52 lb/ft^3 \N wood_rosewood_honduran 1025.18165593344884 kg/m^3 \N 64 lb/ft^3 \N wood_rosewood_indian 832.960095445927209 kg/m^3 \N 52 lb/ft^3 \N wood_cocobolo 1105.27397280324953 kg/m^3 \N 69 lb/ft^3 \N wood_bubinga 897.03394894176779 kg/m^3 \N 56 lb/ft^3 \N wood_zebrawood 800.923168698006862 kg/m^3 \N 50 lb/ft^3 \N wood_koa 608.701608210485233 kg/m^3 \N 38 lb/ft^3 \N wood_snakewood 1212.59767740878237 kg/m^3 \N 75.7 lb/ft^3 \N wood_lignumvitae 1257.44937485587093 kg/m^3 \N 78.5 lb/ft^3 \N wood_blackwood 1270.26414555503879 kg/m^3 \N 79.3 lb/ft^3 \N wood_blackironwood 1353.56015509963163 kg/m^3 \N 84.5 lb/ft^3 \N area_russia 17098246000000 m^2 \N 17098246 km^2 \N area_antarctica 14000000000000 m^2 \N 14000000 km^2 \N area_china 9596961000000 m^2 \N 9596961 km^2 \N area_brazil 8515767000000 m^2 \N 8515767 km^2 \N area_australia 7692024000000 m^2 \N 7692024 km^2 \N area_india 3287263000000 m^2 \N 3287263 km^2 \N area_argentina 2780400000000 m^2 \N 2780400 km^2 \N area_kazakhstan 2724900000000 m^2 \N 2724900 km^2 \N area_algeria 2381741000000 m^2 \N 2381741 km^2 \N area_drcongo 2344858000000 m^2 \N 2344858 km^2 \N area_greenland 2166086000000 m^2 \N 2166086 km^2 \N area_saudiarabia 2149690000000 m^2 \N 2149690 km^2 \N area_mexico 1964375000000 m^2 \N 1964375 km^2 \N area_indonesia 1910931000000 m^2 \N 1910931 km^2 \N area_sudan 1861484000000 m^2 \N 1861484 km^2 \N area_libya 1759540000000 m^2 \N 1759540 km^2 \N area_iran 1648195000000 m^2 \N 1648195 km^2 \N area_mongolia 1564110000000 m^2 \N 1564110 km^2 \N area_peru 1285216000000 m^2 \N 1285216 km^2 \N area_chad 1284000000000 m^2 \N 1284000 km^2 \N area_niger 1267000000000 m^2 \N 1267000 km^2 \N area_angola 1246700000000 m^2 \N 1246700 km^2 \N area_mali 1240192000000 m^2 \N 1240192 km^2 \N area_southafrica 1221037000000 m^2 \N 1221037 km^2 \N area_colombia 1141748000000 m^2 \N 1141748 km^2 \N area_ethiopia 1104300000000 m^2 \N 1104300 km^2 \N area_bolivia 1098581000000 m^2 \N 1098581 km^2 \N area_mauritania 1030700000000 m^2 \N 1030700 km^2 \N area_egypt 1002450000000 m^2 \N 1002450 km^2 \N area_tanzania 945087000000 m^2 \N 945087 km^2 \N area_nigeria 923768000000 m^2 \N 923768 km^2 \N area_venezuela 916445000000 m^2 \N 916445 km^2 \N area_pakistan 881912000000 m^2 \N 881912 km^2 \N area_namibia 825615000000 m^2 \N 825615 km^2 \N area_mozambique 801590000000 m^2 \N 801590 km^2 \N area_turkey 783562000000 m^2 \N 783562 km^2 \N area_chile 756102000000 m^2 \N 756102 km^2 \N area_zambia 752612000000 m^2 \N 752612 km^2 \N area_myanmar 676578000000 m^2 \N 676578 km^2 \N area_burma 676578000000 m^2 \N area_myanmar \N area_afghanistan 652230000000 m^2 \N 652230 km^2 \N area_southsudan 644329000000 m^2 \N 644329 km^2 \N area_france 640679000000 m^2 \N 640679 km^2 \N area_somalia 637657000000 m^2 \N 637657 km^2 \N area_centralafrica 622984000000 m^2 \N 622984 km^2 \N area_ukraine 603500000000 m^2 \N 603500 km^2 \N area_crimea 27000000000 m^2 \N 27000 km^2 \N area_madagascar 587041000000 m^2 \N 587041 km^2 \N area_botswana 581730000000 m^2 \N 581730 km^2 \N area_kenya 580367000000 m^2 \N 580367 km^2 \N area_yemen 527968000000 m^2 \N 527968 km^2 \N area_thailand 513120000000 m^2 \N 513120 km^2 \N area_spain 505992000000 m^2 \N 505992 km^2 \N area_turkmenistan 488100000000 m^2 \N 488100 km^2 \N area_cameroon 475422000000 m^2 \N 475422 km^2 \N area_papuanewguinea 462840000000 m^2 \N 462840 km^2 \N area_sweden 450295000000 m^2 \N 450295 km^2 \N area_uzbekistan 447400000000 m^2 \N 447400 km^2 \N area_morocco 446550000000 m^2 \N 446550 km^2 \N area_iraq 438317000000 m^2 \N 438317 km^2 \N area_paraguay 406752000000 m^2 \N 406752 km^2 \N area_zimbabwe 390757000000 m^2 \N 390757 km^2 \N area_japan 377973000000 m^2 \N 377973 km^2 \N area_germany 357114000000 m^2 \N 357114 km^2 \N area_congorepublic 342000000000 m^2 \N 342000 km^2 \N area_finland 338424000000 m^2 \N 338424 km^2 \N area_vietnam 331212000000 m^2 \N 331212 km^2 \N area_malaysia 330803000000 m^2 \N 330803 km^2 \N area_norway 323802000000 m^2 \N 323802 km^2 \N area_ivorycoast 322463000000 m^2 \N 322463 km^2 \N area_poland 312696000000 m^2 \N 312696 km^2 \N area_oman 309500000000 m^2 \N 309500 km^2 \N area_italy 301339000000 m^2 \N 301339 km^2 \N area_philippines 300000000000 m^2 \N 300000 km^2 \N area_ecuador 276841000000 m^2 \N 276841 km^2 \N area_burkinafaso 274222000000 m^2 \N 274222 km^2 \N area_newzealand 270467000000 m^2 \N 270467 km^2 \N area_gabon 267668000000 m^2 \N 267668 km^2 \N area_westernsahara 266000000000 m^2 \N 266000 km^2 \N area_guinea 245857000000 m^2 \N 245857 km^2 \N area_uganda 241550000000 m^2 \N 241550 km^2 \N area_ghana 238533000000 m^2 \N 238533 km^2 \N area_romania 238397000000 m^2 \N 238397 km^2 \N area_laos 236800000000 m^2 \N 236800 km^2 \N area_guyana 214969000000 m^2 \N 214969 km^2 \N area_belarus 207600000000 m^2 \N 207600 km^2 \N area_kyrgyzstan 199951000000 m^2 \N 199951 km^2 \N area_senegal 196722000000 m^2 \N 196722 km^2 \N area_syria 185180000000 m^2 \N 185180 km^2 \N area_golanheights 1150000000 m^2 \N 1150 km^2 \N area_cambodia 181035000000 m^2 \N 181035 km^2 \N area_uruguay 176215000000 m^2 \N 176215 km^2 \N area_somaliland 176120000000 m^2 \N 176120 km^2 \N area_suriname 163820000000 m^2 \N 163820 km^2 \N area_tunisia 163610000000 m^2 \N 163610 km^2 \N area_bangladesh 147570000000 m^2 \N 147570 km^2 \N area_nepal 147181000000 m^2 \N 147181 km^2 \N area_tajikistan 143100000000 m^2 \N 143100 km^2 \N area_greece 131990000000 m^2 \N 131990 km^2 \N area_nicaragua 130373000000 m^2 \N 130373 km^2 \N area_northkorea 120540000000 m^2 \N 120540 km^2 \N area_malawi 118484000000 m^2 \N 118484 km^2 \N area_eritrea 117600000000 m^2 \N 117600 km^2 \N area_benin 114763000000 m^2 \N 114763 km^2 \N area_honduras 112492000000 m^2 \N 112492 km^2 \N area_liberia 111369000000 m^2 \N 111369 km^2 \N area_bulgaria 110879000000 m^2 \N 110879 km^2 \N area_cuba 109884000000 m^2 \N 109884 km^2 \N area_guatemala 108889000000 m^2 \N 108889 km^2 \N area_iceland 103000000000 m^2 \N 103000 km^2 \N area_southkorea 100210000000 m^2 \N 100210 km^2 \N area_hungary 93028000000 m^2 \N 93028 km^2 \N area_portugal 92090000000 m^2 \N 92090 km^2 \N area_jordan 89342000000 m^2 \N 89342 km^2 \N area_serbia 88361000000 m^2 \N 88361 km^2 \N area_azerbaijan 86600000000 m^2 \N 86600 km^2 \N area_austria 83871000000 m^2 \N 83871 km^2 \N area_uae 83600000000 m^2 \N 83600 km^2 \N area_czechia 78865000000 m^2 \N 78865 km^2 \N area_czechrepublic 78865000000 m^2 \N area_czechia \N area_panama 75417000000 m^2 \N 75417 km^2 \N area_sierraleone 71740000000 m^2 \N 71740 km^2 \N area_ireland 70273000000 m^2 \N 70273 km^2 \N area_georgia 69700000000 m^2 \N 69700 km^2 \N area_srilanka 65610000000 m^2 \N 65610 km^2 \N area_lithuania 65300000000 m^2 \N 65300 km^2 \N area_latvia 64559000000 m^2 \N 64559 km^2 \N area_togo 56785000000 m^2 \N 56785 km^2 \N area_croatia 56594000000 m^2 \N 56594 km^2 \N area_bosnia 51209000000 m^2 \N 51209 km^2 \N area_costarica 51100000000 m^2 \N 51100 km^2 \N area_slovakia 49037000000 m^2 \N 49037 km^2 \N area_dominicanrepublic 48671000000 m^2 \N 48671 km^2 \N area_estonia 45227000000 m^2 \N 45227 km^2 \N area_denmark 43094000000 m^2 \N 43094 km^2 \N area_netherlands 41850000000 m^2 \N 41850 km^2 \N area_switzerland 41284000000 m^2 \N 41284 km^2 \N area_bhutan 38394000000 m^2 \N 38394 km^2 \N area_taiwan 36193000000 m^2 \N 36193 km^2 \N area_guineabissau 36125000000 m^2 \N 36125 km^2 \N area_moldova 33846000000 m^2 \N 33846 km^2 \N area_belgium 30528000000 m^2 \N 30528 km^2 \N area_lesotho 30355000000 m^2 \N 30355 km^2 \N area_armenia 29743000000 m^2 \N 29743 km^2 \N area_solomonislands 28896000000 m^2 \N 28896 km^2 \N area_albania 28748000000 m^2 \N 28748 km^2 \N area_equitorialguinea 28051000000 m^2 \N 28051 km^2 \N area_burundi 27834000000 m^2 \N 27834 km^2 \N area_haiti 27750000000 m^2 \N 27750 km^2 \N area_rwanda 26338000000 m^2 \N 26338 km^2 \N area_northmacedonia 25713000000 m^2 \N 25713 km^2 \N area_djibouti 23200000000 m^2 \N 23200 km^2 \N area_belize 22966000000 m^2 \N 22966 km^2 \N area_elsalvador 21041000000 m^2 \N 21041 km^2 \N area_israel 20770000000 m^2 \N 20770 km^2 \N area_slovenia 20273000000 m^2 \N 20273 km^2 \N area_fiji 18272000000 m^2 \N 18272 km^2 \N area_kuwait 17818000000 m^2 \N 17818 km^2 \N area_eswatini 17364000000 m^2 \N 17364 km^2 \N area_easttimor 14919000000 m^2 \N 14919 km^2 \N area_bahamas 13943000000 m^2 \N 13943 km^2 \N area_montenegro 13812000000 m^2 \N 13812 km^2 \N area_vanatu 12189000000 m^2 \N 12189 km^2 \N area_qatar 11586000000 m^2 \N 11586 km^2 \N area_gambia 11295000000 m^2 \N 11295 km^2 \N area_jamaica 10991000000 m^2 \N 10991 km^2 \N area_kosovo 10887000000 m^2 \N 10887 km^2 \N area_lebanon 10452000000 m^2 \N 10452 km^2 \N area_cyprus 9251000000 m^2 \N 9251 km^2 \N area_puertorico 9104000000 m^2 \N 9104 km^2 \N area_westbank 5860000000 m^2 \N 5860 km^2 \N area_hongkong 2755000000 m^2 \N 2755 km^2 \N area_luxembourg 2586000000 m^2 \N 2586 km^2 \N area_singapore 716000000 m^2 \N 716 km^2 \N area_gazastrip 360000000 m^2 \N 360 km^2 \N area_malta 316000000 m^2 \N 316 km^2 \N area_liechtenstein 160000000 m^2 \N 160 km^2 \N area_monaco 2020000 m^2 \N 2.02 km^2 \N area_vaticancity 440000 m^2 \N 0.44 km^2 \N area_europeanunion 4234547000000 m^2 \N area_austria + area_belgium + area_bulgaria + area_croatia + area_cyprus + area_czechia + area_denmark + area_estonia + area_finland + area_france + area_germany + area_greece + area_hungary + area_ireland + area_italy + area_latvia + area_lithuania + area_luxembourg + area_malta + area_netherlands + area_poland + area_portugal + area_romania + area_slovakia + area_slovenia + area_spain + area_sweden \N area_eu 4234547000000 m^2 \N area_europeanunion \N area_alaska 1723336800000 m^2 \N 1723336.8 km^2 \N area_texas 695661600000 m^2 \N 695661.6 km^2 \N area_california 423967400000 m^2 \N 423967.4 km^2 \N area_montana 380831100000 m^2 \N 380831.1 km^2 \N area_newmexico 314917400000 m^2 \N 314917.4 km^2 \N area_arizona 295233500000 m^2 \N 295233.5 km^2 \N area_nevada 286379700000 m^2 \N 286379.7 km^2 \N area_colorado 269601400000.000031 m^2 \N 269601.4 km^2 \N area_oregon 254799200000 m^2 \N 254799.2 km^2 \N area_wyoming 253334500000 m^2 \N 253334.5 km^2 \N area_michigan 250486800000 m^2 \N 250486.8 km^2 \N area_minnesota 225162800000 m^2 \N 225162.8 km^2 \N area_utah 219881900000 m^2 \N 219881.9 km^2 \N area_idaho 216442600000 m^2 \N 216442.6 km^2 \N area_kansas 213100000000 m^2 \N 213100.0 km^2 \N area_nebraska 200329900000 m^2 \N 200329.9 km^2 \N area_southdakota 199728700000 m^2 \N 199728.7 km^2 \N area_washington 184660800000 m^2 \N 184660.8 km^2 \N area_northdakota 183107800000 m^2 \N 183107.8 km^2 \N area_oklahoma 181037200000 m^2 \N 181037.2 km^2 \N area_missouri 180540300000 m^2 \N 180540.3 km^2 \N area_florida 170311700000 m^2 \N 170311.7 km^2 \N area_wisconsin 169634800000 m^2 \N 169634.8 km^2 \N area_georgia_us 153910400000 m^2 \N 153910.4 km^2 \N area_illinois 149995400000 m^2 \N 149995.4 km^2 \N area_iowa 145745900000 m^2 \N 145745.9 km^2 \N area_newyork 141296700000 m^2 \N 141296.7 km^2 \N area_northcarolina 139391000000 m^2 \N 139391.0 km^2 \N area_arkansas 137731800000 m^2 \N 137731.8 km^2 \N area_alabama 135767400000 m^2 \N 135767.4 km^2 \N area_louisiana 135658700000.000015 m^2 \N 135658.7 km^2 \N area_mississippi 125437700000 m^2 \N 125437.7 km^2 \N area_pennsylvania 119280200000 m^2 \N 119280.2 km^2 \N area_ohio 116097700000 m^2 \N 116097.7 km^2 \N area_virginia 110786600000 m^2 \N 110786.6 km^2 \N area_tennessee 109153100000 m^2 \N 109153.1 km^2 \N area_kentucky 104655700000 m^2 \N 104655.7 km^2 \N area_indiana 94326200000 m^2 \N 94326.2 km^2 \N area_maine 91633100000 m^2 \N 91633.1 km^2 \N area_southcarolina 82932700000 m^2 \N 82932.7 km^2 \N area_westvirginia 62755500000 m^2 \N 62755.5 km^2 \N area_maryland 32131200000 m^2 \N 32131.2 km^2 \N area_hawaii 28313000000 m^2 \N 28313.0 km^2 \N area_massachusetts 27335700000 m^2 \N 27335.7 km^2 \N area_vermont 24906300000 m^2 \N 24906.3 km^2 \N area_newhampshire 24214200000 m^2 \N 24214.2 km^2 \N area_newjersey 22591400000 m^2 \N 22591.4 km^2 \N area_connecticut 14357400000 m^2 \N 14357.4 km^2 \N area_delaware 6445800000 m^2 \N 6445.8 km^2 \N area_rhodeisland 4001200000 m^2 \N 4001.2 km^2 \N area_districtofcolumbia 177000000 m^2 \N 177.0 km^2 \N area_unitedstates 9833516900000 m^2 \N area_alabama + area_alaska + area_arizona + area_arkansas + area_california + area_colorado + area_connecticut + area_delaware + area_districtofcolumbia + area_florida + area_georgia_us + area_hawaii + area_idaho + area_illinois + area_indiana + area_iowa + area_kansas + area_kentucky + area_louisiana + area_maine + area_maryland + area_massachusetts + area_michigan + area_minnesota + area_mississippi + area_missouri + area_montana + area_nebraska + area_nevada + area_newhampshire + area_newjersey + area_newmexico + area_newyork + area_northcarolina + area_northdakota + area_ohio + area_oklahoma + area_oregon + area_pennsylvania + area_rhodeisland + area_southcarolina + area_southdakota + area_tennessee + area_texas + area_utah + area_vermont + area_virginia + area_washington + area_westvirginia + area_wisconsin + area_wyoming \N area_ontario 1076395000000 m^2 \N 1076395 km^2 \N area_quebec 1542056000000 m^2 \N 1542056 km^2 \N area_novascotia 55284000000 m^2 \N 55284 km^2 \N area_newbrunswick 72908000000 m^2 \N 72908 km^2 \N area_canada_original 2746643000000 m^2 \N area_ontario + area_quebec + area_novascotia + area_newbrunswick \N area_manitoba 647797000000 m^2 \N 647797 km^2 \N area_britishcolumbia 944735000000 m^2 \N 944735 km^2 \N area_princeedwardisland 5660000000 m^2 \N 5660 km^2 \N area_canada_additional 1598192000000 m^2 \N area_manitoba + area_britishcolumbia + area_princeedwardisland \N area_alberta 661848000000 m^2 \N 661848 km^2 \N area_saskatchewan 651036000000 m^2 \N 651036 km^2 \N area_newfoundlandandlabrador 405212000000 m^2 \N 405212 km^2 \N area_canada_recent 1718096000000 m^2 \N area_alberta + area_saskatchewan + area_newfoundlandandlabrador \N area_canada_provinces 6062931000000 m^2 \N area_canada_original + area_canada_additional + area_canada_recent \N area_northwestterritories 1346106000000 m^2 \N 1346106 km^2 \N area_yukon 482443000000 m^2 \N 482443 km^2 \N area_nunavut 2093190000000 m^2 \N 2093190 km^2 \N area_canada_territories 3921739000000 m^2 \N area_northwestterritories + area_yukon + area_nunavut \N area_canada 9984670000000 m^2 \N area_canada_provinces + area_canada_territories \N area_england 132947760000.000015 m^2 \N 132947.76 km^2 \N area_wales 21224480000 m^2 \N 21224.48 km^2 \N area_englandwales 154172240000 m^2 \N area_england + area_wales \N area_scotland 80226360000 m^2 \N 80226.36 km^2 \N area_greatbritain 234398600000 m^2 \N area_england + area_wales + area_scotland \N area_gb 234398600000 m^2 \N area_greatbritain \N area_northernireland 14133380000 m^2 \N 14133.38 km^2 \N area_unitedkingdom 248531980000 m^2 \N area_greatbritain + area_northernireland \N area_uk 248531980000 m^2 \N area_unitedkingdom \N ouncedal 0.00864093464850000138 m*kg/s^2 \N oz ft / s^2 \N poundal 0.138254954376000022 m*kg/s^2 \N lb ft / s^2 \N tondal 309.691097802240051 m*kg/s^2 \N longton ft / s^2 \N pdl 0.138254954376000022 m*kg/s^2 \N poundal \N osi 430.922330823022492 kg/m*s^2 \N ounce force / inch^2 \N psi 6894.75729316835987 kg/m*s^2 \N pound force / inch^2 \N psia 6894.75729316835987 kg/m*s^2 \N psi \N reyn 6894.75729316835987 kg/m*s \N psi sec \N lbf 4.44822161526049964 m*kg/s^2 \N lb force \N lbm 0.453592370000000022 kg \N lb \N kip 4448.22161526049968 m*kg/s^2 \N 1000 lbf \N ksi 6894757.29316835944 kg/m*s^2 \N kip / in^2 \N mil 2.54000000000000041e-05 m \N 0.001 inch \N thou 2.54000000000000041e-05 m \N 0.001 inch \N tenth 2.54000000000000025e-06 m \N 0.0001 inch \N millionth 2.54000000000000025e-08 m \N 1e-6 inch \N circularinch 0.000506707479097497798 m^2 \N 1|4 pi in^2 \N circleinch 0.000506707479097497798 m^2 \N circularinch \N cylinderinch 1.28703699690764458e-05 m^3 \N circleinch inch \N circularmil 5.06707479097497917e-10 m^2 \N 1|4 pi mil^2 \N cmil 5.06707479097497917e-10 m^2 \N circularmil \N cental 45.3592370000000003 kg \N 100 pound \N centner 45.3592370000000003 kg \N cental \N caliber 0.000254000000000000048 m \N 0.01 inch \N duty 1.35581794833140035 m^2*kg/s^2 \N ft lbf \N celo 0.304800000000000015 m/s^2 \N ft / s^2 \N jerk 0.304800000000000015 m/s^3 \N ft / s^3 \N australiapoint 0.000254000000000000048 m \N 0.01 inch \N sabin 0.0929030400000000062 m^2 \N ft^2 \N standardgauge 1.43510000000000004 m \N 4 ft + 8.5 in \N flag 0.464515200000000017 m^2 \N 5 ft^2 \N rollwallpaper 2.78709120000000032 m^2 \N 30 ft^2 \N fillpower 0.000578036672001339211 m^3/kg \N in^3 / ounce \N pinlength 0.00158750000000000015 m \N 1|16 inch \N buttonline 0.000635000000000000148 m \N 1|40 inch \N beespace 0.00635000000000000061 m \N 1|4 inch \N diamond 0.487680000000000058 m \N 8|5 ft \N retmaunit 0.0444500000000000034 m \N 1.75 in \N U 0.0444500000000000034 m \N retmaunit \N RU 0.0444500000000000034 m \N U \N flightlevel 30.4800000000000004 m \N 100 ft \N FL 30.4800000000000004 m \N flightlevel \N calorie_th 4.18400000000000016 m^2*kg/s^2 \N 4.184 J \N thermcalorie 4.18400000000000016 m^2*kg/s^2 \N calorie_th \N cal_th 4.18400000000000016 m^2*kg/s^2 \N calorie_th \N calorie_IT 4.18679999999999986 m^2*kg/s^2 \N 4.1868 J \N cal_IT 4.18679999999999986 m^2*kg/s^2 \N calorie_IT \N calorie_15 4.18580000000000041 m^2*kg/s^2 \N 4.18580 J \N cal_15 4.18580000000000041 m^2*kg/s^2 \N calorie_15 \N calorie_fifteen 4.18580000000000041 m^2*kg/s^2 \N cal_15 \N calorie_20 4.18189999999999973 m^2*kg/s^2 \N 4.18190 J \N cal_20 4.18189999999999973 m^2*kg/s^2 \N calorie_20 \N calorie_twenty 4.18189999999999973 m^2*kg/s^2 \N calorie_20 \N calorie_4 4.20399999999999974 m^2*kg/s^2 \N 4.204 J \N cal_4 4.20399999999999974 m^2*kg/s^2 \N calorie_4 \N calorie_four 4.20399999999999974 m^2*kg/s^2 \N calorie_4 \N cal_mean 4.19001999999999963 m^2*kg/s^2 \N 4.19002 J \N thermie 4185800.00000000047 m^2*kg/s^2 \N 1e6 cal_15 \N btu_IT 1055.05585262000022 m^2*kg/s^2 \N cal_IT lb (degF) / gram K \N btu_th 1054.35026448888902 m^2*kg/s^2 \N cal_th lb (degF) / gram K \N btu_mean 1055.86727897077799 m^2*kg/s^2 \N cal_mean lb (degF) / gram K \N btu_15 1054.80385685888905 m^2*kg/s^2 \N cal_15 lb (degF) / gram K \N btu_ISO 1055.05999999999995 m^2*kg/s^2 \N 1055.06 J \N ECtherm 105506000 m^2*kg/s^2 \N 1e5 btu_ISO \N UStherm 105480400 m^2*kg/s^2 \N 1.054804e8 J \N therm 105480400 m^2*kg/s^2 \N UStherm \N water_fusion_heat 333610.879822370247 m^2/s^2 \N 6.01 kJ/mol / (18.015 g/mol) \N water_vaporization_heat 2256400 m^2/s^2 \N 2256.4 J/g \N specificheat_aluminum 910 m^2/s^2*K \N 0.91 J/g K \N specificheat_antimony 210 m^2/s^2*K \N 0.21 J/g K \N specificheat_barium 200 m^2/s^2*K \N 0.20 J/g K \N specificheat_beryllium 1830 m^2/s^2*K \N 1.83 J/g K \N specificheat_bismuth 130 m^2/s^2*K \N 0.13 J/g K \N specificheat_cadmium 230 m^2/s^2*K \N 0.23 J/g K \N specificheat_cesium 240 m^2/s^2*K \N 0.24 J/g K \N specificheat_chromium 460 m^2/s^2*K \N 0.46 J/g K \N specificheat_cobalt 420 m^2/s^2*K \N 0.42 J/g K \N specificheat_copper 390 m^2/s^2*K \N 0.39 J/g K \N specificheat_gallium 370 m^2/s^2*K \N 0.37 J/g K \N specificheat_germanium 320 m^2/s^2*K \N 0.32 J/g K \N specificheat_gold 130 m^2/s^2*K \N 0.13 J/g K \N specificheat_hafnium 140 m^2/s^2*K \N 0.14 J/g K \N specificheat_indium 240 m^2/s^2*K \N 0.24 J/g K \N specificheat_iridium 130 m^2/s^2*K \N 0.13 J/g K \N specificheat_iron 450 m^2/s^2*K \N 0.45 J/g K \N specificheat_lanthanum 195 m^2/s^2*K \N 0.195 J/g K \N specificheat_lead 130 m^2/s^2*K \N 0.13 J/g K \N specificheat_lithium 3569.99999999999955 m^2/s^2*K \N 3.57 J/g K \N specificheat_lutetium 150 m^2/s^2*K \N 0.15 J/g K \N specificheat_magnesium 1050 m^2/s^2*K \N 1.05 J/g K \N specificheat_manganese 480 m^2/s^2*K \N 0.48 J/g K \N specificheat_mercury 140 m^2/s^2*K \N 0.14 J/g K \N specificheat_molybdenum 250 m^2/s^2*K \N 0.25 J/g K \N specificheat_nickel 440 m^2/s^2*K \N 0.44 J/g K \N specificheat_osmium 130 m^2/s^2*K \N 0.13 J/g K \N specificheat_palladium 240 m^2/s^2*K \N 0.24 J/g K \N specificheat_platinum 130 m^2/s^2*K \N 0.13 J/g K \N specificheat_plutonum 130 m^2/s^2*K \N 0.13 J/g K \N specificheat_potassium 750 m^2/s^2*K \N 0.75 J/g K \N specificheat_rhenium 140 m^2/s^2*K \N 0.14 J/g K \N specificheat_rhodium 240 m^2/s^2*K \N 0.24 J/g K \N specificheat_rubidium 360 m^2/s^2*K \N 0.36 J/g K \N specificheat_ruthenium 240 m^2/s^2*K \N 0.24 J/g K \N specificheat_scandium 569.999999999999886 m^2/s^2*K \N 0.57 J/g K \N specificheat_selenium 320 m^2/s^2*K \N 0.32 J/g K \N specificheat_silicon 710 m^2/s^2*K \N 0.71 J/g K \N specificheat_silver 230 m^2/s^2*K \N 0.23 J/g K \N specificheat_sodium 1210 m^2/s^2*K \N 1.21 J/g K \N specificheat_strontium 300 m^2/s^2*K \N 0.30 J/g K \N specificheat_tantalum 140 m^2/s^2*K \N 0.14 J/g K \N specificheat_thallium 130 m^2/s^2*K \N 0.13 J/g K \N specificheat_thorium 130 m^2/s^2*K \N 0.13 J/g K \N specificheat_tin 210 m^2/s^2*K \N 0.21 J/g K \N specificheat_titanium 540 m^2/s^2*K \N 0.54 J/g K \N specificheat_tungsten 130 m^2/s^2*K \N 0.13 J/g K \N specificheat_uranium 120 m^2/s^2*K \N 0.12 J/g K \N specificheat_vanadium 390 m^2/s^2*K \N 0.39 J/g K \N specificheat_yttrium 300 m^2/s^2*K \N 0.30 J/g K \N specificheat_zinc 390 m^2/s^2*K \N 0.39 J/g K \N specificheat_zirconium 270 m^2/s^2*K \N 0.27 J/g K \N specificheat_ethanol 2300 m^2/s^2*K \N 2.3 J/g K \N specificheat_ammonia 4600 m^2/s^2*K \N 4.6 J/g K \N specificheat_freon 910 m^2/s^2*K \N 0.91 J/g K \N specificheat_gasoline 2220 m^2/s^2*K \N 2.22 J/g K \N specificheat_iodine 2150 m^2/s^2*K \N 2.15 J/g K \N specificheat_oliveoil 1970 m^2/s^2*K \N 1.97 J/g K \N specificheat_hydrogen 14300 m^2/s^2*K \N 14.3 J/g K \N specificheat_helium 5193.19999999999982 m^2/s^2*K \N 5.1932 J/g K \N specificheat_argon 520.299999999999955 m^2/s^2*K \N 0.5203 J/g K \N specificheat_tissue 3500 m^2/s^2*K \N 3.5 J/g K \N specificheat_diamond 509.099999999999966 m^2/s^2*K \N 0.5091 J/g K \N specificheat_granite 790 m^2/s^2*K \N 0.79 J/g K \N specificheat_graphite 710 m^2/s^2*K \N 0.71 J/g K \N specificheat_ice 2110 m^2/s^2*K \N 2.11 J/g K \N specificheat_asphalt 920 m^2/s^2*K \N 0.92 J/g K \N specificheat_brick 840 m^2/s^2*K \N 0.84 J/g K \N specificheat_concrete 880 m^2/s^2*K \N 0.88 J/g K \N specificheat_glass_silica 840 m^2/s^2*K \N 0.84 J/g K \N specificheat_glass_flint 503 m^2/s^2*K \N 0.503 J/g K \N specificheat_glass_pyrex 753 m^2/s^2*K \N 0.753 J/g K \N specificheat_gypsum 1090 m^2/s^2*K \N 1.09 J/g K \N specificheat_marble 880 m^2/s^2*K \N 0.88 J/g K \N specificheat_sand 835 m^2/s^2*K \N 0.835 J/g K \N specificheat_soil 835 m^2/s^2*K \N 0.835 J/g K \N specificheat_wood 1700 m^2/s^2*K \N 1.7 J/g K \N specificheat_sucrose 1244 m^2/s^2*K \N 1.244 J/g K \N tonoil 41868000000 m^2*kg/s^2 \N 1e10 cal_IT \N toe 41868000000 m^2*kg/s^2 \N tonoil \N toncoal 29307600000 m^2*kg/s^2 \N 7e9 cal_IT \N charcoal 30000000 m^2/s^2 \N 30 GJ/tonne \N woodenergy_dry 20000000 m^2/s^2 \N 20 GJ/tonne \N woodenergy_airdry 15000000 m^2/s^2 \N 15 GJ/tonne \N coal_bituminous 27000000 m^2/s^2 \N 27 GJ / tonne \N coal_lignite 15000000 m^2/s^2 \N 15 GJ / tonne \N heating 37299999999.9999924 kg/m*s^2 \N 37.3 MJ/liter \N fueloil 39699999999.9999924 kg/m*s^2 \N 39.7 MJ/liter \N propane 93300000 kg/m*s^2 \N 93.3 MJ/m^3 \N butane 124000000 kg/m*s^2 \N 124 MJ/m^3 \N uranium_pure 82099828882507.1406 m^2/s^2 \N 200 MeV avogadro / (235.0439299 g/mol) \N uranium_natural 574698802177.549927 m^2/s^2 \N 0.7% uranium_pure \N VA 1 m^2*kg/s^3 \N volt ampere \N kWh 3600000 m^2*kg/s^2 \N kilowatt hour \N horsepower 745.699871582270134 m^2*kg/s^3 \N 550 foot pound force / sec \N mechanicalhorsepower 745.699871582270134 m^2*kg/s^3 \N horsepower \N hp 745.699871582270134 m^2*kg/s^3 \N horsepower \N metrichorsepower 735.498749999999973 m^2*kg/s^3 \N 75 kilogram force meter / sec \N electrichorsepower 746 m^2*kg/s^3 \N 746 W \N boilerhorsepower 9809.5 m^2*kg/s^3 \N 9809.50 W \N waterhorsepower 746.043000000000006 m^2*kg/s^3 \N 746.043 W \N brhorsepower 745.699871582270134 m^2*kg/s^3 \N horsepower \N donkeypower 250 m^2*kg/s^3 \N 250 W \N chevalvapeur 735.498749999999973 m^2*kg/s^3 \N metrichorsepower \N THERMAL_CONDUCTIVITY 1 m*kg/s^3*K \N POWER / AREA (TEMPERATURE_DIFFERENCE/LENGTH) \N THERMAL_RESISTIVITY 1 s^3*K/m*kg \N 1/THERMAL_CONDUCTIVITY \N THERMAL_CONDUCTANCE 1 m^2*kg/s^3*K \N POWER / TEMPERATURE_DIFFERENCE \N THERMAL_RESISTANCE 1 s^3*K/m^2*kg \N 1/THERMAL_CONDUCTANCE \N THERMAL_ADMITTANCE 1 kg/s^3*K \N THERMAL_CONDUCTIVITY / LENGTH \N THERMAL_INSULANCE 1 s^3*K/kg \N THERMAL_RESISTIVITY LENGTH \N THERMAL_INSULATION 1 s^3*K/kg \N THERMAL_RESISTIVITY LENGTH \N europeanUvalue 1 kg/s^3*K \N watt / m^2 K \N RSI 1 s^3*K/kg \N degC m^2 / W \N clo 0.154999999999999999 s^3*K/kg \N 0.155 * degC m^2 / W \N tog 0.100000000000000006 s^3*K/kg \N 0.1 * degC m^2 / W \N silver_thermal_conductivity 406 m*kg/s^3*K \N 406 W / m K \N aluminum_thermal_conductivity 205 m*kg/s^3*K \N 205 W / m K \N copper_thermal_conductivity 385 m*kg/s^3*K \N 385 W / m K \N gold_thermal_conductivity 314 m*kg/s^3*K \N 314 W / m K \N iron_thermal_conductivity 79.5 m*kg/s^3*K \N 79.5 W / m K \N ENTROPY 1 m^2*kg/s^2*K \N ENERGY / TEMPERATURE \N langley 41840 kg/s^2 \N thermcalorie/cm^2 \N poncelet 980.664999999999964 m^2*kg/s^3 \N 100 kg force m / s \N frigorie 4185.80000000000018 m^2*kg/s^2 \N 1000 cal_15 \N airwatt 0.999233430733786898 m^2*kg/s^3 \N 8.5 (ft^3/min) inH2O \N perm_0C 5.72134946709451128e-11 s/m \N grain / hr ft^2 inHg \N perm_zero 5.72134946709451128e-11 s/m \N perm_0C \N perm_0 5.72134946709451128e-11 s/m \N perm_0C \N perm 5.72134946709451128e-11 s/m \N perm_0C \N perm_23C 5.74522610462651931e-11 s/m \N grain / hr ft^2 in Hg23C \N perm_twentythree 5.74522610462651931e-11 s/m \N perm_23C \N pair 2 \N 2 \N brace 2 \N 2 \N nest 3 \N 3 \N hattrick 3 \N 3 \N dicker 10 \N 10 \N dozen 12 \N 12 \N bakersdozen 13 \N 13 \N score 20 \N 20 \N flock 40 \N 40 \N timer 40 \N 40 \N shock 60 \N 60 \N toncount 100 \N 100 \N longhundred 120 \N 120 \N gross 144 \N 144 \N greatgross 1728 \N 12 gross \N tithe 0.100000000000000006 \N 1|10 \N shortquire 24 \N 24 \N quire 25 \N 25 \N shortream 480 \N 480 \N ream 500 \N 500 \N perfectream 516 \N 516 \N bundle 1000 \N 2 reams \N bale 5000 \N 5 bundles \N lettersize 0.0603224600000000152 m^2 \N 8.5 inch 11 inch \N legalsize 0.0767740400000000156 m^2 \N 8.5 inch 14 inch \N ledgersize 0.120644920000000017 m^2 \N 11 inch 17 inch \N executivesize 0.0491128050000000163 m^2 \N 7.25 inch 10.5 inch \N Apaper 0.0603224600000000152 m^2 \N 8.5 inch 11 inch \N Bpaper 0.120644920000000017 m^2 \N 11 inch 17 inch \N Cpaper 0.241289840000000061 m^2 \N 17 inch 22 inch \N Dpaper 0.482579680000000066 m^2 \N 22 inch 34 inch \N Epaper 0.965159360000000244 m^2 \N 34 inch 44 inch \N envelope6_25size 0.0135483600000000023 m^2 \N 3.5 inch 6 inch \N envelope6_75size 0.0152015825000000031 m^2 \N 3.625 inch 6.5 inch \N envelope7size 0.016330612500000001 m^2 \N 3.75 inch 6.75 inch \N envelope7_75size 0.0187499625000000052 m^2 \N 3.875 inch 7.5 inch \N envelope8_625size 0.0201713306250000043 m^2 \N 3.625 inch 8.625 inch \N envelope9size 0.0221874556250000014 m^2 \N 3.875 inch 8.875 inch \N envelope10size 0.0252822075000000042 m^2 \N 4.125 inch 9.5 inch \N envelope11size 0.0301209075000000021 m^2 \N 4.5 inch 10.375 inch \N envelope12size 0.0337096100000000079 m^2 \N 4.75 inch 11 inch \N envelope14size 0.0370967000000000102 m^2 \N 5 inch 11.5 inch \N envelope16size 0.04645152000000001 m^2 \N 6 inch 12 inch \N envelopeA1size 0.0119858631250000028 m^2 \N 3.625 inch 5.125 inch \N envelopeA2size 0.0162298062500000027 m^2 \N 4.375 inch 5.75 inch \N envelopeA6size 0.0199193150000000034 m^2 \N 4.75 inch 6.5 inch \N envelopeA7size 0.0245564025000000047 m^2 \N 5.25 inch 7.25 inch \N envelopeA8size 0.0288305875000000079 m^2 \N 5.5 inch 8.125 inch \N envelopeA9size 0.0324596125000000124 m^2 \N 5.75 inch 8.75 inch \N envelopeA10size 0.0367741200000000074 m^2 \N 6 inch 9.5 inch \N envelope4bar 0.0119858631250000028 m^2 \N 3.625 inch 5.125 inch \N envelope5_5bar 0.0162298062500000027 m^2 \N 4.375 inch 5.75 inch \N envelope6bar 0.0199193150000000034 m^2 \N 4.75 inch 6.5 inch \N envelope1baby 0.00508063500000000088 m^2 \N 2.25 inch 3.5 inch \N envelope00coin 0.00299394562500000056 m^2 \N 1.6875 inch 2.75 inch \N envelope1coin 0.00508063500000000088 m^2 \N 2.25 inch 3.5 inch \N envelope3coin 0.00685482500000000102 m^2 \N 2.5 inch 4.25 inch \N envelope4coin 0.00870966000000000101 m^2 \N 3 inch 4.5 inch \N envelope4_5coin 0.00943546500000000225 m^2 \N 3 inch 4.875 inch \N envelope5coin 0.00973788375000000234 m^2 \N 2.875 inch 5.25 inch \N envelope5_5coin 0.0110886875000000031 m^2 \N 3.125 inch 5.5 inch \N envelope6coin 0.0130644900000000015 m^2 \N 3.375 inch 6 inch \N envelope7coin 0.014677390000000002 m^2 \N 3.5 inch 6.5 inch \N A0paper 0.999949000000000088 m^2 \N 841 mm 1189 mm \N A1paper 0.499553999999999998 m^2 \N 594 mm 841 mm \N A2paper 0.249480000000000007 m^2 \N 420 mm 594 mm \N A3paper 0.124740000000000004 m^2 \N 297 mm 420 mm \N A4paper 0.0623700000000000018 m^2 \N 210 mm 297 mm \N A5paper 0.03108 m^2 \N 148 mm 210 mm \N A6paper 0.01554 m^2 \N 105 mm 148 mm \N A7paper 0.00777 m^2 \N 74 mm 105 mm \N A8paper 0.00384799999999999986 m^2 \N 52 mm 74 mm \N A9paper 0.00192400000000000015 m^2 \N 37 mm 52 mm \N A10paper 0.000961999999999999965 m^2 \N 26 mm 37 mm \N B0paper 1.41399999999999992 m^2 \N 1000 mm 1414 mm \N B1paper 0.706999999999999962 m^2 \N 707 mm 1000 mm \N B2paper 0.353499999999999981 m^2 \N 500 mm 707 mm \N B3paper 0.17649999999999999 m^2 \N 353 mm 500 mm \N B4paper 0.0882499999999999951 m^2 \N 250 mm 353 mm \N B5paper 0.0439999999999999974 m^2 \N 176 mm 250 mm \N B6paper 0.0219999999999999987 m^2 \N 125 mm 176 mm \N B7paper 0.0109999999999999994 m^2 \N 88 mm 125 mm \N B8paper 0.00545599999999999991 m^2 \N 62 mm 88 mm \N B9paper 0.00272799999999999996 m^2 \N 44 mm 62 mm \N B10paper 0.00136399999999999998 m^2 \N 31 mm 44 mm \N C0paper 1.18934899999999999 m^2 \N 917 mm 1297 mm \N C1paper 0.594216000000000077 m^2 \N 648 mm 917 mm \N C2paper 0.296783999999999992 m^2 \N 458 mm 648 mm \N C3paper 0.148391999999999996 m^2 \N 324 mm 458 mm \N C4paper 0.0741959999999999981 m^2 \N 229 mm 324 mm \N C5paper 0.037097999999999999 m^2 \N 162 mm 229 mm \N C6paper 0.0184680000000000018 m^2 \N 114 mm 162 mm \N C7paper 0.00923400000000000089 m^2 \N 81 mm 114 mm \N C8paper 0.00461700000000000044 m^2 \N 57 mm 81 mm \N C9paper 0.00227999999999999991 m^2 \N 40 mm 57 mm \N C10paper 0.00112000000000000012 m^2 \N 28 mm 40 mm \N gsm 0.00100000000000000002 kg/m^2 \N grams / meter^2 \N poundbookpaper 0.0014801464834508617 kg/m^2 \N lb / 25 inch 38 inch ream \N lbbook 0.0014801464834508617 kg/m^2 \N poundbookpaper \N poundtextpaper 0.0014801464834508617 kg/m^2 \N poundbookpaper \N lbtext 0.0014801464834508617 kg/m^2 \N poundtextpaper \N poundoffsetpaper 0.0014801464834508617 kg/m^2 \N poundbookpaper \N lboffset 0.0014801464834508617 kg/m^2 \N poundoffsetpaper \N poundbiblepaper 0.0014801464834508617 kg/m^2 \N poundbookpaper \N lbbible 0.0014801464834508617 kg/m^2 \N poundbiblepaper \N poundtagpaper 0.00162747587879434998 kg/m^2 \N lb / 24 inch 36 inch ream \N lbtag 0.00162747587879434998 kg/m^2 \N poundtagpaper \N poundbagpaper 0.00162747587879434998 kg/m^2 \N poundtagpaper \N lbbag 0.00162747587879434998 kg/m^2 \N poundbagpaper \N poundnewsprintpaper 0.00162747587879434998 kg/m^2 \N poundtagpaper \N lbnewsprint 0.00162747587879434998 kg/m^2 \N poundnewsprintpaper \N poundposterpaper 0.00162747587879434998 kg/m^2 \N poundtagpaper \N lbposter 0.00162747587879434998 kg/m^2 \N poundposterpaper \N poundtissuepaper 0.00162747587879434998 kg/m^2 \N poundtagpaper \N lbtissue 0.00162747587879434998 kg/m^2 \N poundtissuepaper \N poundwrappingpaper 0.00162747587879434998 kg/m^2 \N poundtagpaper \N lbwrapping 0.00162747587879434998 kg/m^2 \N poundwrappingpaper \N poundwaxingpaper 0.00162747587879434998 kg/m^2 \N poundtagpaper \N lbwaxing 0.00162747587879434998 kg/m^2 \N poundwaxingpaper \N poundglassinepaper 0.00162747587879434998 kg/m^2 \N poundtagpaper \N lbglassine 0.00162747587879434998 kg/m^2 \N poundglassinepaper \N poundcoverpaper 0.00270411376784291963 kg/m^2 \N lb / 20 inch 26 inch ream \N lbcover 0.00270411376784291963 kg/m^2 \N poundcoverpaper \N poundindexpaper 0.00180795777470693468 kg/m^2 \N lb / 25.5 inch 30.5 inch ream \N lbindex 0.00180795777470693468 kg/m^2 \N poundindexpaper \N poundindexbristolpaper 0.00180795777470693468 kg/m^2 \N poundindexpaper \N lbindexbristol 0.00180795777470693468 kg/m^2 \N poundindexpaper \N poundbondpaper 0.00375973037240192069 kg/m^2 \N lb / 17 inch 22 inch ream \N lbbond 0.00375973037240192069 kg/m^2 \N poundbondpaper \N poundwritingpaper 0.00375973037240192069 kg/m^2 \N poundbondpaper \N lbwriting 0.00375973037240192069 kg/m^2 \N poundwritingpaper \N poundledgerpaper 0.00375973037240192069 kg/m^2 \N poundbondpaper \N lbledger 0.00375973037240192069 kg/m^2 \N poundledgerpaper \N poundcopypaper 0.00375973037240192069 kg/m^2 \N poundbondpaper \N lbcopy 0.00375973037240192069 kg/m^2 \N poundcopypaper \N poundblottingpaper 0.00308363850718929499 kg/m^2 \N lb / 19 inch 24 inch ream \N lbblotting 0.00308363850718929499 kg/m^2 \N poundblottingpaper \N poundblankspaper 0.00228269344038688031 kg/m^2 \N lb / 22 inch 28 inch ream \N lbblanks 0.00228269344038688031 kg/m^2 \N poundblankspaper \N poundpostcardpaper 0.00219280960511238727 kg/m^2 \N lb / 22.5 inch 28.5 inch ream \N lbpostcard 0.00219280960511238727 kg/m^2 \N poundpostcardpaper \N poundweddingbristol 0.00219280960511238727 kg/m^2 \N poundpostcardpaper \N lbweddingbristol 0.00219280960511238727 kg/m^2 \N poundweddingbristol \N poundbristolpaper 0.00219280960511238727 kg/m^2 \N poundweddingbristol \N lbbristol 0.00219280960511238727 kg/m^2 \N poundbristolpaper \N poundboxboard 0.00488242763638305037 kg/m^2 \N lb / 1000 ft^2 \N lbboxboard 0.00488242763638305037 kg/m^2 \N poundboxboard \N poundpaperboard 0.00488242763638305037 kg/m^2 \N poundboxboard \N lbpaperboard 0.00488242763638305037 kg/m^2 \N poundpaperboard \N paperM 0.000453592370000000043 kg \N lb / 1000 \N pointthickness 2.54000000000000041e-05 m \N 0.001 in \N paperdensity 799.999999999999886 kg/m^3 \N 0.8 g/cm^3 \N papercaliper 20.3200000000000003 kg/m^2 \N in paperdensity \N paperpoint 0.0203200000000000013 kg/m^2 \N pointthickness paperdensity \N fournierpoint 0.000348826666666666692 m \N 0.1648 inch / 12 \N bertholdpoint 0.000375939849624060173 m \N 1|2660 m \N INpoint 0.000400000000000000019 m \N 0.4 mm \N germandidotpoint 0.000376064999999999971 m \N 0.376065 mm \N metricpoint 0.000375000000000000008 m \N 3|8 mm \N oldpoint 0.000351459803514598049 m \N 1|72.27 inch \N printerspoint 0.000351459803514598049 m \N oldpoint \N texpoint 0.000351459803514598049 m \N oldpoint \N texscaledpoint 5.36285100577694777e-09 m \N 1|65536 texpoint \N texsp 5.36285100577694777e-09 m \N texscaledpoint \N computerpoint 0.000352777777777777812 m \N 1|72 inch \N point 0.000352777777777777812 m \N computerpoint \N computerpica 0.00423333333333333374 m \N 12 computerpoint \N postscriptpoint 0.000352777777777777812 m \N computerpoint \N pspoint 0.000352777777777777812 m \N postscriptpoint \N twip 1.76388888888888926e-05 m \N 1|20 point \N Q 0.000250000000000000005 m \N 1|4 mm \N didotpoint 0.000376064999999999971 m \N germandidotpoint \N europeanpoint 0.000376064999999999971 m \N didotpoint \N cicero 0.00451277999999999922 m \N 12 didotpoint \N stick 0.0508000000000000049 m \N 2 inches \N excelsior 0.00105437941054379409 m \N 3 oldpoint \N brilliant 0.00123010931230109325 m \N 3.5 oldpoint \N diamondtype 0.0014058392140583922 m \N 4 oldpoint \N pearl 0.0017572990175729903 m \N 5 oldpoint \N agate 0.00193302891933028924 m \N 5.5 oldpoint \N ruby 0.00193302891933028924 m \N agate \N nonpareil 0.00210875882108758819 m \N 6 oldpoint \N mignonette 0.00228448872284488713 m \N 6.5 oldpoint \N emerald 0.00228448872284488713 m \N mignonette \N minion 0.00246021862460218651 m \N 7 oldpoint \N brevier 0.00281167842811678439 m \N 8 oldpoint \N bourgeois 0.00316313823163138228 m \N 9 oldpoint \N longprimer 0.0035145980351459806 m \N 10 oldpoint \N smallpica 0.00386605783866057848 m \N 11 oldpoint \N pica 0.00421751764217517637 m \N 12 oldpoint \N english 0.00492043724920437301 m \N 14 oldpoint \N columbian 0.00562335685623356878 m \N 16 oldpoint \N greatprimer 0.00632627646326276456 m \N 18 oldpoint \N paragon 0.0070291960702919612 m \N 20 oldpoint \N meridian 0.0154642313546423139 m \N 44 oldpoint \N canon 0.0168700705687007055 m \N 48 oldpoint \N nonplusultra 0.000752129999999999943 m \N 2 didotpoint \N brillant 0.00112819499999999981 m \N 3 didotpoint \N diamant 0.00150425999999999989 m \N 4 didotpoint \N perl 0.00188032499999999997 m \N 5 didotpoint \N nonpareille 0.00225638999999999961 m \N 6 didotpoint \N kolonel 0.00263245499999999969 m \N 7 didotpoint \N petit 0.00300851999999999977 m \N 8 didotpoint \N borgis 0.00338458499999999985 m \N 9 didotpoint \N korpus 0.00376064999999999993 m \N 10 didotpoint \N corpus 0.00376064999999999993 m \N korpus \N garamond 0.00376064999999999993 m \N korpus \N mittel 0.00526490999999999938 m \N 14 didotpoint \N tertia 0.00601703999999999954 m \N 16 didotpoint \N text 0.0067691699999999997 m \N 18 didotpoint \N kleine_kanon 0.0120340799999999991 m \N 32 didotpoint \N kanon 0.0135383399999999994 m \N 36 didotpoint \N grobe_kanon 0.0157947299999999999 m \N 42 didotpoint \N missal 0.0180511199999999969 m \N 48 didotpoint \N kleine_sabon 0.0270766799999999988 m \N 72 didotpoint \N grobe_sabon 0.0315894599999999998 m \N 84 didotpoint \N INFORMATION 0.125 B \N bit \N nat 0.180336880111120423 B \N (1/ln(2)) bits \N hartley 0.415241011860920273 B \N log2(10) bits \N ban 0.415241011860920273 B \N hartley \N dit 0.415241011860920273 B \N hartley \N bps 0.125 B/s \N bit/sec \N octet 1 B \N 8 bits \N nybble 0.5 B \N 4 bits \N nibble 0.5 B \N nybble \N nyp 0.25 B \N 2 bits \N meg 1000000 B \N megabyte \N gig 1000000000 B \N gigabyte \N jiffy 0.0100000000000000002 s \N 0.01 sec \N jiffies 0.0100000000000000002 s \N jiffy \N cdaudiospeed 176400 B/s \N 44.1 kHz 2*16 bits \N cdromspeed 153600 B/s \N 75 2048 bytes / sec \N dvdspeed 1385000 B/s \N 1385 kB/s \N FIT 2.77777777777777795e-13 s^-1 \N / 1e9 hour \N octave 2 \N 2 \N majorthird 1.25 \N 5|4 \N minorthird 1.19999999999999996 \N 6|5 \N musicalfourth 1.33333333333333326 \N 4|3 \N musicalfifth 1.5 \N 3|2 \N majorsixth 1.66666666666666652 \N musicalfourth majorthird \N minorsixth 1.59999999999999987 \N musicalfourth minorthird \N majorseventh 1.875 \N musicalfifth majorthird \N minorseventh 1.79999999999999982 \N musicalfifth minorthird \N pythagoreancomma 1.01364326477050781 \N musicalfifth^12 / octave^7 \N dotted 1.5 \N 3|2 \N doubledotted 1.75 \N 7|4 \N woolyarnrun 3225.45108066963303 m/kg \N 1600 yard/pound \N yarncut 604.772077625556221 m/kg \N 300 yard/pound \N cottonyarncount 1693.36181735155742 m/kg \N 840 yard/pound \N linenyarncount 604.772077625556221 m/kg \N 300 yard/pound \N worstedyarncount 1128.90787823437176 m/kg \N 1680 ft/pound \N metricyarncount 1000 m/kg \N meter/gram \N manchesteryarnnumber 1.93771346818952303e-06 kg/m \N drams/1000 yards \N pli 17.8579673228346465 kg/m \N lb/in \N typp 2015.90692541852059 m/kg \N 1000 yd/lb \N asbestoscut 201.590692541852064 m/kg \N 100 yd/lb \N tex 9.99999999999999955e-07 kg/m \N gram / km \N drex 9.99999999999999955e-08 kg/m \N 0.1 tex \N poumar 4.96054647856517937e-07 kg/m \N lb / 1e6 yard \N skeincotton 109.728000000000009 m \N 80*54 inch \N cottonbolt 36.5760000000000005 m \N 120 ft \N woolbolt 64.0080000000000098 m \N 210 ft \N bolt 36.5760000000000005 m \N cottonbolt \N heer 548.6400000000001 m \N 600 yards \N cut 274.32000000000005 m \N 300 yards \N lea 274.32000000000005 m \N 300 yards \N sailmakersyard 0.723900000000000099 m \N 28.5 in \N sailmakersounce 0.0428283125998513148 kg/m^2 \N oz / sailmakersyard 36 inch \N silkmomme 0.00433446057048713501 kg/m^2 \N momme / 25 yards 1.49 inch \N silkmm 0.00433446057048713501 kg/m^2 \N silkmomme \N mcg 1.00000000000000006e-09 kg \N microgram \N iudiptheria 6.28000000000000065e-08 kg \N 62.8 microgram \N iupenicillin 5.99999999999999996e-10 kg \N 0.6 microgram \N iuinsulin 4.16700000000000019e-08 kg \N 41.67 microgram \N drop 5.0000000000000011e-08 m^3 \N 1|20 ml \N bloodunit 0.000450000000000000096 m^3 \N 450 ml \N frenchcathetersize 0.000333333333333333322 m \N 1|3 mm \N charriere 0.000333333333333333322 m \N frenchcathetersize \N hectare 10000 m^2 \N hectoare \N megohm 1000000 m^2*kg/s^3*A^2 \N megaohm \N kilohm 1000 m^2*kg/s^3*A^2 \N kiloohm \N microhm 9.99999999999999955e-07 m^2*kg/s^3*A^2 \N microohm \N megalerg 0.100000000000000006 m^2*kg/s^2 \N megaerg \N USpennyweight 0.00250000000000000005 kg \N 2.5 grams \N USnickelweight 0.0050000000000000001 kg \N 5 grams \N USdollarweight 0.00809999999999999956 kg \N 8.1 grams \N cord 3.62455636377600054 m^3 \N 4*4*8 ft^3 \N facecord 1.81227818188800027 m^3 \N 1|2 cord \N cordfoot 0.453069545472000068 m^3 \N 1|8 cord \N cordfeet 0.453069545472000068 m^3 \N cordfoot \N housecord 1.20818545459200011 m^3 \N 1|3 cord \N boardfoot 0.00235973721600000021 m^3 \N ft^2 inch \N boardfeet 0.00235973721600000021 m^3 \N boardfoot \N fbm 0.00235973721600000021 m^3 \N boardfoot \N stack 3.05821943193600099 m^3 \N 4 yard^3 \N rick 1.20818545459200033 m^3 \N 4 ft 8 ft 16 inches \N stere 1 m^3 \N m^3 \N timberfoot 0.0283168465920000043 m^3 \N ft^3 \N standard 4.67227968768000146 m^3 \N 120 12 ft 11 in 1.5 in \N hoppusfoot 0.0360541288631335277 m^3 \N (4/pi) ft^3 \N hoppusboardfoot 0.0030045107385944605 m^3 \N 1|12 hoppusfoot \N hoppuston 1.80270644315667639 m^3 \N 50 hoppusfoot \N deal 0.0648927734400000095 m^3 \N 12 ft 11 in 2.5 in \N wholedeal 0.0324463867200000047 m^3 \N 12 ft 11 in 1.25 in \N splitdeal 0.0162231933600000024 m^3 \N 12 ft 11 in 5|8 in \N poundcut 119.826427316896584 kg/m^3 \N pound / gallon \N lbcut 119.826427316896584 kg/m^3 \N poundcut \N FLUID_FLOW 1 m^3/s \N VOLUME / TIME \N cumec 1 m^3/s \N m^3/s \N cusec 0.0283168465920000043 m^3/s \N ft^3/s \N gph 1.05150327333333364e-06 m^3/s \N gal/hr \N gpm 6.30901964000000305e-05 m^3/s \N gal/min \N mgd 0.0438126363888889023 m^3/s \N megagal/day \N brgph 1.26280277777777828e-06 m^3/s \N brgallon/hr \N brgpm 7.57681666666666978e-05 m^3/s \N brgallon/min \N usgph 1.05150327333333364e-06 m^3/s \N usgallon/hr \N usgpm 6.30901964000000305e-05 m^3/s \N usgallon/min \N cfs 0.0283168465920000043 m^3/s \N ft^3/s \N cfh 7.86579072000000036e-06 m^3/s \N ft^3/hour \N cfm 0.000471947443200000096 m^3/s \N ft^3/min \N lpm 1.66666666666666709e-05 m^3/s \N liter/min \N lfm 0.00508000000000000031 m/s \N ft/min \N pru 7999343244.89999676 kg/m^4*s \N mmHg / (ml/min) \N minersinchAZ 0.000707921164800000063 m^3/s \N 1.5 ft^3/min \N minersinchCA 0.000707921164800000063 m^3/s \N 1.5 ft^3/min \N minersinchMT 0.000707921164800000063 m^3/s \N 1.5 ft^3/min \N minersinchNV 0.000707921164800000063 m^3/s \N 1.5 ft^3/min \N minersinchOR 0.000707921164800000063 m^3/s \N 1.5 ft^3/min \N minersinchID 0.000566336931840000094 m^3/s \N 1.2 ft^3/min \N minersinchKS 0.000566336931840000094 m^3/s \N 1.2 ft^3/min \N minersinchNE 0.000566336931840000094 m^3/s \N 1.2 ft^3/min \N minersinchNM 0.000566336931840000094 m^3/s \N 1.2 ft^3/min \N minersinchND 0.000566336931840000094 m^3/s \N 1.2 ft^3/min \N minersinchSD 0.000566336931840000094 m^3/s \N 1.2 ft^3/min \N minersinchUT 0.000566336931840000094 m^3/s \N 1.2 ft^3/min \N minersinchCO 0.000737417880000000147 m^3/s \N 1 ft^3/sec / 38.4 \N minersinchBC 0.000792871704576000088 m^3/s \N 1.68 ft^3/min \N sverdrup 1000000 m^3/s \N 1e6 m^3 / sec \N GAS_FLOW 1 m^2*kg/s^3 \N PRESSURE FLUID_FLOW \N sccm 0.00168875000000000015 m^2*kg/s^3 \N atm cc/min \N sccs 0.101325000000000012 m^2*kg/s^3 \N atm cc/sec \N scfh 0.797001244704000134 m^2*kg/s^3 \N atm ft^3/hour \N scfm 47.820074682240012 m^2*kg/s^3 \N atm ft^3/min \N slpm 1.6887500000000002 m^2*kg/s^3 \N atm liter/min \N slph 0.0281458333333333387 m^2*kg/s^3 \N atm liter/hour \N lusec 0.000133322387414999992 m^2*kg/s^3 \N liter micron Hg / s \N lapserate 0.0064999999999999997 K/m \N 6.5 K/km \N air_1976 28.9644253795909989 \N 78.084 % 28.0134 + 20.9476 % 31.9988 + 9340 ppm 39.948 + 314 ppm 44.00995 + 18.18 ppm 20.183 + 5.24 ppm 4.0026 + 2 ppm 16.04303 + 1.14 ppm 83.80 + 0.55 ppm 2.01594 + 0.087 ppm 131.30 \N R_1976 8.31432000000000038 m^2*kg/s^2*K*mol \N 8.31432e3 N m/(kmol K) \N polyndx_1976 4.25588071865567397 \N air_1976 (kg/kmol) gravity/(R_1976 lapserate) - 1 \N polyndx 4.25588071865567397 \N polyndx_1976 \N polyexpnt 1.23496899140441019 \N (polyndx + 1) / polyndx \N stdatmT0 288.149999999999977 K \N 288.15 K \N stdatmP0 101325 kg/m*s^2 \N atm \N earthradUSAtm 6356766 m \N 6356766 m \N Patm 101325 kg/m*s^2 \N atm \N seawater 10000 kg/m^2*s^2 \N 0.1 bar / meter \N msw 10000 kg/m*s^2 \N meter seawater \N fsw 3048 kg/m*s^2 \N foot seawater \N g00 -1 \N (-1) \N g000 -2 \N (-2) \N g0000 -3 \N (-3) \N g00000 -4 \N (-4) \N g000000 -5 \N (-5) \N g0000000 -6 \N (-6) \N drillA 0.00594360000000000114 m \N 0.234 in \N drillB 0.00604520000000000057 m \N 0.238 in \N drillC 0.00614680000000000001 m \N 0.242 in \N drillD 0.00624840000000000031 m \N 0.246 in \N drillE 0.00635000000000000061 m \N 0.250 in \N drillF 0.00652780000000000114 m \N 0.257 in \N drillG 0.00662940000000000057 m \N 0.261 in \N drillH 0.00675640000000000095 m \N 0.266 in \N drillI 0.0069088000000000014 m \N 0.272 in \N drillJ 0.00703580000000000091 m \N 0.277 in \N drillK 0.00713740000000000121 m \N 0.281 in \N drillL 0.00736600000000000015 m \N 0.290 in \N drillM 0.00749300000000000053 m \N 0.295 in \N drillN 0.00767080000000000019 m \N 0.302 in \N drillO 0.00802640000000000124 m \N 0.316 in \N drillP 0.00820420000000000177 m \N 0.323 in \N drillQ 0.00843280000000000071 m \N 0.332 in \N drillR 0.00861060000000000124 m \N 0.339 in \N drillS 0.00883920000000000018 m \N 0.348 in \N drillT 0.00909320000000000093 m \N 0.358 in \N drillU 0.00934719999999999995 m \N 0.368 in \N drillV 0.00957580000000000063 m \N 0.377 in \N drillW 0.00980440000000000131 m \N 0.386 in \N drillX 0.0100838000000000021 m \N 0.397 in \N drillY 0.0102616000000000009 m \N 0.404 in \N drillZ 0.0104901999999999999 m \N 0.413 in \N dmtxxcoarse 0.000119999999999999989 m \N 120 micron \N dmtsilver 0.000119999999999999989 m \N dmtxxcoarse \N dmtxx 0.000119999999999999989 m \N dmtxxcoarse \N dmtxcoarse 5.99999999999999947e-05 m \N 60 micron \N dmtx 5.99999999999999947e-05 m \N dmtxcoarse \N dmtblack 5.99999999999999947e-05 m \N dmtxcoarse \N dmtcoarse 4.49999999999999961e-05 m \N 45 micron \N dmtc 4.49999999999999961e-05 m \N dmtcoarse \N dmtblue 4.49999999999999961e-05 m \N dmtcoarse \N dmtfine 2.49999999999999978e-05 m \N 25 micron \N dmtred 2.49999999999999978e-05 m \N dmtfine \N dmtf 2.49999999999999978e-05 m \N dmtfine \N dmtefine 9.00000000000000023e-06 m \N 9 micron \N dmte 9.00000000000000023e-06 m \N dmtefine \N dmtgreen 9.00000000000000023e-06 m \N dmtefine \N dmtceramic 6.99999999999999989e-06 m \N 7 micron \N dmtcer 6.99999999999999989e-06 m \N dmtceramic \N dmtwhite 6.99999999999999989e-06 m \N dmtceramic \N dmteefine 3.00000000000000008e-06 m \N 3 micron \N dmttan 3.00000000000000008e-06 m \N dmteefine \N dmtee 3.00000000000000008e-06 m \N dmteefine \N hardtranslucentarkansas 6.00000000000000015e-06 m \N 6 micron \N softarkansas 2.19999999999999994e-05 m \N 22 micron \N extrafineindia 2.19999999999999994e-05 m \N 22 micron \N fineindia 3.49999999999999969e-05 m \N 35 micron \N mediumindia 5.34999999999999994e-05 m \N 53.5 micron \N coarseindia 9.69999999999999996e-05 m \N 97 micron \N finecrystolon 4.49999999999999961e-05 m \N 45 micron \N mediumcrystalon 7.79999999999999986e-05 m \N 78 micron \N coarsecrystalon 0.000126999999999999997 m \N 127 micron \N hardblackarkansas 6.00000000000000015e-06 m \N 6 micron \N hardwhitearkansas 1.09999999999999997e-05 m \N 11 micron \N washita 3.49999999999999969e-05 m \N 35 micron \N sizeAring 0.0374999999999999986 m \N 37.50 mm \N sizeBring 0.0387499999999999997 m \N 38.75 mm \N sizeCring 0.0400000000000000008 m \N 40.00 mm \N sizeDring 0.0412500000000000019 m \N 41.25 mm \N sizeEring 0.0425000000000000031 m \N 42.50 mm \N sizeFring 0.0437500000000000042 m \N 43.75 mm \N sizeGring 0.0449999999999999983 m \N 45.00 mm \N sizeHring 0.0462499999999999994 m \N 46.25 mm \N sizeIring 0.0475000000000000006 m \N 47.50 mm \N sizeJring 0.0487500000000000017 m \N 48.75 mm \N sizeKring 0.0500000000000000028 m \N 50.00 mm \N sizeLring 0.0512500000000000039 m \N 51.25 mm \N sizeMring 0.0524999999999999981 m \N 52.50 mm \N sizeNring 0.0537499999999999992 m \N 53.75 mm \N sizeOring 0.0550000000000000003 m \N 55.00 mm \N sizePring 0.0562500000000000014 m \N 56.25 mm \N sizeQring 0.0575000000000000025 m \N 57.50 mm \N sizeRring 0.0587500000000000036 m \N 58.75 mm \N sizeSring 0.0599999999999999978 m \N 60.00 mm \N sizeTring 0.0612499999999999989 m \N 61.25 mm \N sizeUring 0.0625 m \N 62.50 mm \N sizeVring 0.0637500000000000011 m \N 63.75 mm \N sizeWring 0.0650000000000000022 m \N 65.00 mm \N sizeXring 0.0662500000000000033 m \N 66.25 mm \N sizeYring 0.0675000000000000044 m \N 67.50 mm \N sizeZring 0.0687500000000000056 m \N 68.75 mm \N mph 0.447039999999999993 m/s \N mile/hr \N brmpg 354006.189934647002 m^-2 \N mile/brgallon \N usmpg 425143.707430271839 m^-2 \N mile/usgallon \N mpg 425143.707430271839 m^-2 \N mile/gal \N kph 0.27777777777777779 m/s \N km/hr \N fL 3.42625909963539055 cd/m^2 \N footlambert \N fpm 0.00508000000000000031 m/s \N ft/min \N fps 0.304800000000000015 m/s \N ft/s \N rpm 0.104719755119659766 s^-1 \N rev/min \N rps 6.28318530717958623 s^-1 \N rev/sec \N mi 1609.34400000000005 m \N mile \N smi 1609.34400000000005 m \N mile \N nmi 1852 m \N nauticalmile \N mcm 5.06707479097497915e-07 m^2 \N 1e3 circularmil \N ipy 8.04894621877340687e-10 m/s \N inch/year \N ccf 2.83168465920000045 m^3 \N 100 ft^3 \N Mcf 28.3168465920000045 m^3 \N 1000 ft^3 \N kp 9.80664999999999942 m*kg/s^2 \N kilopond \N kpm 9.80664999999999942 m^2*kg/s^2 \N kp meter \N Wh 3600 m^2*kg/s^2 \N W hour \N hph 2684519.53769617248 m^2*kg/s^2 \N hp hour \N plf 1.48816394356955373 kg/m \N lb / foot \N pa 1 kg/m*s^2 \N Pa \N ev 1.60217663399999989e-19 m^2*kg/s^2 \N eV \N mh 0.00100000000000000002 m^2*kg/s^2*A^2 \N mH \N rd 5.02920000000000034 m \N rod \N pf 9.9999999999999998e-13 s^4*A^2/m^2*kg \N pF \N gr 6.47989100000000081e-05 kg \N grain \N nt 1 m*kg/s^2 \N N \N hz 1 s^-1 \N Hz \N dry 1.16364718614718621 \N drygallon/gallon \N nmile 1852 m \N nauticalmile \N beV 1.60217663399999979e-10 m^2*kg/s^2 \N GeV \N bev 1.60217663399999979e-10 m^2*kg/s^2 \N beV \N coul 1 s*A \N C \N becquerel 1 s^-1 \N /s \N Bq 1 s^-1 \N becquerel \N curie 37000000000 s^-1 \N 3.7e10 Bq \N Ci 37000000000 s^-1 \N curie \N rutherford 1000000 s^-1 \N 1e6 Bq \N gray 1 m^2/s^2 \N J/kg \N Gy 1 m^2/s^2 \N gray \N rad 0.0100000000000000002 m^2/s^2 \N 1e-2 Gy \N rep 0.0083800000000000003 m^2/s^2 \N 8.38 mGy \N sievert 1 m^2/s^2 \N J/kg \N Sv 1 m^2/s^2 \N sievert \N rem 0.0100000000000000002 m^2/s^2 \N 1e-2 Sv \N banana_dose 9.99999999999999955e-08 m^2/s^2 \N 0.1e-6 sievert \N roentgen 0.000257999999999999983 s*A/kg \N 2.58e-4 C / kg \N rontgen 0.000257999999999999983 s*A/kg \N roentgen \N sievertunit 0.00216204000000000006 s*A/kg \N 8.38 rontgen \N eman 3700 m^-3*s^-1 \N 1e-7 Ci/m^3 \N mache 13690 m^-3*s^-1 \N 3.7e-7 Ci/m^3 \N actinium 227.027800000000013 \N 227.0278 \N aluminum 26.9815390000000015 \N 26.981539 \N americium 243.061399999999992 \N 243.0614 \N antimony 121.760000000000005 \N 121.760 \N argon 39.9480000000000004 \N 39.948 \N arsenic 74.9215899999999948 \N 74.92159 \N astatine 209.987099999999998 \N 209.9871 \N barium 137.326999999999998 \N 137.327 \N berkelium 247.070300000000003 \N 247.0703 \N beryllium 9.01218199999999925 \N 9.012182 \N bismuth 208.980369999999994 \N 208.98037 \N boron 10.8109999999999999 \N 10.811 \N bromine 79.9039999999999964 \N 79.904 \N cadmium 112.411000000000001 \N 112.411 \N calcium 40.078000000000003 \N 40.078 \N californium 251.079599999999999 \N 251.0796 \N carbon 12.0109999999999992 \N 12.011 \N cerium 140.115000000000009 \N 140.115 \N cesium 132.905429999999996 \N 132.90543 \N chlorine 35.4527000000000001 \N 35.4527 \N chromium 51.9960999999999984 \N 51.9961 \N cobalt 58.9331999999999994 \N 58.93320 \N copper 63.5459999999999994 \N 63.546 \N curium 247.070300000000003 \N 247.0703 \N deuterium 2.0141017778000001 \N 2.0141017778 \N dysprosium 162.5 \N 162.50 \N einsteinium 252.082999999999998 \N 252.083 \N erbium 167.259999999999991 \N 167.26 \N europium 151.965000000000003 \N 151.965 \N fermium 257.095100000000002 \N 257.0951 \N fluorine 18.9984031999999985 \N 18.9984032 \N francium 223.0197 \N 223.0197 \N gadolinium 157.25 \N 157.25 \N gallium 69.722999999999999 \N 69.723 \N germanium 72.6099999999999994 \N 72.61 \N gold 196.966540000000009 \N 196.96654 \N hafnium 178.490000000000009 \N 178.49 \N helium 4.00260200000000044 \N 4.002602 \N holmium 164.930319999999995 \N 164.93032 \N hydrogen 1.00794000000000006 \N 1.00794 \N indium 114.817999999999998 \N 114.818 \N iodine 126.904470000000003 \N 126.90447 \N iridium 192.217000000000013 \N 192.217 \N iron 55.8449999999999989 \N 55.845 \N krypton 83.7999999999999972 \N 83.80 \N lanthanum 138.905499999999989 \N 138.9055 \N lawrencium 262.110000000000014 \N 262.11 \N lead 207.199999999999989 \N 207.2 \N lithium 6.94099999999999984 \N 6.941 \N lutetium 174.967000000000013 \N 174.967 \N magnesium 24.3049999999999997 \N 24.3050 \N manganese 54.9380499999999969 \N 54.93805 \N mendelevium 258.100000000000023 \N 258.10 \N mercury 200.590000000000003 \N 200.59 \N molybdenum 95.9399999999999977 \N 95.94 \N neodymium 144.240000000000009 \N 144.24 \N neon 20.1797000000000004 \N 20.1797 \N neptunium 237.048200000000008 \N 237.0482 \N nickel 58.6933999999999969 \N 58.6934 \N niobium 92.9063799999999986 \N 92.90638 \N nitrogen 14.0067400000000006 \N 14.00674 \N nobelium 259.100900000000024 \N 259.1009 \N osmium 190.22999999999999 \N 190.23 \N oxygen 15.9993999999999996 \N 15.9994 \N palladium 106.420000000000002 \N 106.42 \N phosphorus 30.9737620000000007 \N 30.973762 \N platinum 195.080000000000013 \N 195.08 \N plutonium 244.0642 \N 244.0642 \N polonium 208.982400000000013 \N 208.9824 \N potassium 39.0983000000000018 \N 39.0983 \N praseodymium 140.90764999999999 \N 140.90765 \N promethium 144.912700000000001 \N 144.9127 \N protactinium 231.035879999999992 \N 231.03588 \N radium 226.025399999999991 \N 226.0254 \N radon 222.017599999999987 \N 222.0176 \N rhenium 186.206999999999994 \N 186.207 \N rhodium 102.905500000000004 \N 102.90550 \N rubidium 85.4677999999999969 \N 85.4678 \N ruthenium 101.069999999999993 \N 101.07 \N samarium 150.360000000000014 \N 150.36 \N scandium 44.9559100000000029 \N 44.955910 \N selenium 78.9599999999999937 \N 78.96 \N silicon 28.0854999999999997 \N 28.0855 \N silver 107.868200000000002 \N 107.8682 \N sodium 22.9897680000000015 \N 22.989768 \N strontium 87.6200000000000045 \N 87.62 \N sulfur 32.0660000000000025 \N 32.066 \N tantalum 180.947900000000004 \N 180.9479 \N technetium 97.9072000000000031 \N 97.9072 \N tellurium 127.599999999999994 \N 127.60 \N terbium 158.925340000000006 \N 158.92534 \N thallium 204.383299999999991 \N 204.3833 \N thorium 232.038099999999986 \N 232.0381 \N thullium 168.934210000000007 \N 168.93421 \N tin 118.709999999999994 \N 118.710 \N titanium 47.8669999999999973 \N 47.867 \N tungsten 183.840000000000003 \N 183.84 \N uranium 238.028899999999993 \N 238.0289 \N vanadium 50.9414999999999978 \N 50.9415 \N xenon 131.289999999999992 \N 131.29 \N ytterbium 173.039999999999992 \N 173.04 \N yttrium 88.9058500000000009 \N 88.90585 \N zinc 65.3900000000000006 \N 65.39 \N zirconium 91.2240000000000038 \N 91.224 \N air 28.9679037780064803 \N 78.08% nitrogen 2 + 20.95% oxygen 2 + 9340 ppm argon + 400 ppm (carbon + oxygen 2) + 18.18 ppm neon + 5.24 ppm helium + 1.7 ppm (carbon + 4 hydrogen) + 1.14 ppm krypton + 0.55 ppm hydrogen 2 \N hydrogendensity 0.0898799999999999738 kg/m^3 \N 0.08988 g/l \N heliumdensity 0.178599999999999953 kg/m^3 \N 0.1786 g/l \N neondensity 0.900199999999999778 kg/m^3 \N 0.9002 g/l \N nitrogendensity 1.25059999999999971 kg/m^3 \N 1.2506 g/l \N oxygendensity 1.42899999999999983 kg/m^3 \N 1.429 g/l \N fluorinedensity 1.69599999999999973 kg/m^3 \N 1.696 g/l \N argondensity 1.78399999999999959 kg/m^3 \N 1.784 g/l \N chlorinedensity 3.19999999999999929 kg/m^3 \N 3.2 g/l \N kryptondensity 3.74899999999999922 kg/m^3 \N 3.749 g/l \N xenondensity 5.89399999999999835 kg/m^3 \N 5.894 g/l \N radondensity 9.72999999999999865 kg/m^3 \N 9.73 g/l \N brominedensity 3102.79999999999927 kg/m^3 \N 3.1028 g/cm^3 \N mercurydensity 13533.9999999999982 kg/m^3 \N 13.534 g/cm^3 \N lithiumdensity 534 kg/m^3 \N 0.534 g/cm^3 \N potassiumdensity 861.999999999999886 kg/m^3 \N 0.862 g/cm^3 \N sodiumdensity 967.999999999999886 kg/m^3 \N 0.968 g/cm^3 \N rubidiumdensity 1532 kg/m^3 \N 1.532 g/cm^3 \N calciumdensity 1550 kg/m^3 \N 1.55 g/cm^3 \N magnesiumdensity 1737.99999999999977 kg/m^3 \N 1.738 g/cm^3 \N phosphorus_white_density 1822.99999999999977 kg/m^3 \N 1.823 g/cm^3 \N berylliumdensity 1849.99999999999977 kg/m^3 \N 1.85 g/cm^3 \N sulfur_gamma_density 1919.99999999999977 kg/m^3 \N 1.92 g/cm^3 \N cesiumdensity 1929.99999999999977 kg/m^3 \N 1.93 g/cm^3 \N carbon_amorphous_density 1949.99999999999955 kg/m^3 \N 1.95 g/cm^3 \N sulfur_betadensity 1959.99999999999955 kg/m^3 \N 1.96 g/cm^3 \N sulfur_alpha_density 2069.99999999999955 kg/m^3 \N 2.07 g/cm^3 \N carbon_graphite_density 2266.99999999999955 kg/m^3 \N 2.267 g/cm^3 \N phosphorus_red_density 2269.99999999999955 kg/m^3 \N 2.27 g/cm^3 \N silicondensity 2329 kg/m^3 \N 2.3290 g/cm^3 \N phosphorus_violet_density 2359.99999999999955 kg/m^3 \N 2.36 g/cm^3 \N borondensity 2369.99999999999955 kg/m^3 \N 2.37 g/cm^3 \N strontiumdensity 2639.99999999999955 kg/m^3 \N 2.64 g/cm^3 \N phosphorus_black_density 2689.99999999999955 kg/m^3 \N 2.69 g/cm^3 \N aluminumdensity 2699.99999999999955 kg/m^3 \N 2.7 g/cm^3 \N bariumdensity 3509.99999999999909 kg/m^3 \N 3.51 g/cm^3 \N carbon_diamond_density 3514.99999999999955 kg/m^3 \N 3.515 g/cm^3 \N scandiumdensity 3984.99999999999909 kg/m^3 \N 3.985 g/cm^3 \N selenium_vitreous_density 4279.99999999999909 kg/m^3 \N 4.28 g/cm^3 \N selenium_alpha_density 4389.99999999999909 kg/m^3 \N 4.39 g/cm^3 \N titaniumdensity 4405.99999999999909 kg/m^3 \N 4.406 g/cm^3 \N yttriumdensity 4471.99999999999909 kg/m^3 \N 4.472 g/cm^3 \N selenium_gray_density 4809.99999999999909 kg/m^3 \N 4.81 g/cm^3 \N iodinedensity 4932.99999999999909 kg/m^3 \N 4.933 g/cm^3 \N europiumdensity 5264 kg/m^3 \N 5.264 g/cm^3 \N germaniumdensity 5323 kg/m^3 \N 5.323 g/cm^3 \N radiumdensity 5499.99999999999909 kg/m^3 \N 5.5 g/cm^3 \N arsenicdensity 5726.99999999999909 kg/m^3 \N 5.727 g/cm^3 \N tin_alpha_density 5768.99999999999909 kg/m^3 \N 5.769 g/cm^3 \N galliumdensity 5909.99999999999909 kg/m^3 \N 5.91 g/cm^3 \N vanadiumdensity 6110 kg/m^3 \N 6.11 g/cm^3 \N lanthanumdensity 6161.99999999999909 kg/m^3 \N 6.162 g/cm^3 \N telluriumdensity 6240 kg/m^3 \N 6.24 g/cm^3 \N zirconiumdensity 6519.99999999999909 kg/m^3 \N 6.52 g/cm^3 \N antimonydensity 6696.99999999999909 kg/m^3 \N 6.697 g/cm^3 \N ceriumdensity 6769.99999999999909 kg/m^3 \N 6.77 g/cm^3 \N praseodymiumdensity 6769.99999999999909 kg/m^3 \N 6.77 g/cm^3 \N ytterbiumdensity 6900 kg/m^3 \N 6.9 g/cm^3 \N neodymiumdensity 7009.99999999999818 kg/m^3 \N 7.01 g/cm^3 \N zincdensity 7139.99999999999818 kg/m^3 \N 7.14 g/cm^3 \N chromiumdensity 7189.99999999999909 kg/m^3 \N 7.19 g/cm^3 \N manganesedensity 7209.99999999999909 kg/m^3 \N 7.21 g/cm^3 \N promethiumdensity 7259.99999999999909 kg/m^3 \N 7.26 g/cm^3 \N tin_beta_density 7264.99999999999818 kg/m^3 \N 7.265 g/cm^3 \N indiumdensity 7309.99999999999818 kg/m^3 \N 7.31 g/cm^3 \N samariumdensity 7519.99999999999818 kg/m^3 \N 7.52 g/cm^3 \N irondensity 7873.99999999999818 kg/m^3 \N 7.874 g/cm^3 \N gadoliniumdensity 7899.99999999999909 kg/m^3 \N 7.9 g/cm^3 \N terbiumdensity 8230 kg/m^3 \N 8.23 g/cm^3 \N dysprosiumdensity 8539.99999999999818 kg/m^3 \N 8.54 g/cm^3 \N niobiumdensity 8570 kg/m^3 \N 8.57 g/cm^3 \N cadmiumdensity 8649.99999999999818 kg/m^3 \N 8.65 g/cm^3 \N holmiumdensity 8789.99999999999818 kg/m^3 \N 8.79 g/cm^3 \N cobaltdensity 8899.99999999999818 kg/m^3 \N 8.9 g/cm^3 \N nickeldensity 8907.99999999999818 kg/m^3 \N 8.908 g/cm^3 \N erbiumdensity 9066 kg/m^3 \N 9.066 g/cm^3 \N polonium_alpha_density 9195.99999999999818 kg/m^3 \N 9.196 g/cm^3 \N thuliumdensity 9319.99999999999818 kg/m^3 \N 9.32 g/cm^3 \N polonium_beta_density 9397.99999999999818 kg/m^3 \N 9.398 g/cm^3 \N bismuthdensity 9779.99999999999636 kg/m^3 \N 9.78 g/cm^3 \N lutetiumdensity 9840.99999999999818 kg/m^3 \N 9.841 g/cm^3 \N actiniumdensity 9999.99999999999818 kg/m^3 \N 10 g/cm^3 \N molybdenumdensity 10279.9999999999982 kg/m^3 \N 10.28 g/cm^3 \N silverdensity 10490 kg/m^3 \N 10.49 g/cm^3 \N technetiumdensity 10999.9999999999982 kg/m^3 \N 11 g/cm^3 \N leaddensity 11339.9999999999982 kg/m^3 \N 11.34 g/cm^3 \N thoriumdensity 11699.9999999999982 kg/m^3 \N 11.7 g/cm^3 \N thalliumdensity 11849.9999999999982 kg/m^3 \N 11.85 g/cm^3 \N americiumdensity 11999.9999999999982 kg/m^3 \N 12 g/cm^3 \N palladiumdensity 12022.9999999999982 kg/m^3 \N 12.023 g/cm^3 \N rhodiumdensity 12409.9999999999982 kg/m^3 \N 12.41 g/cm^3 \N rutheniumdensity 12449.9999999999964 kg/m^3 \N 12.45 g/cm^3 \N berkelium_beta_density 13249.9999999999982 kg/m^3 \N 13.25 g/cm^3 \N hafniumdensity 13309.9999999999982 kg/m^3 \N 13.31 g/cm^3 \N curiumdensity 13509.9999999999964 kg/m^3 \N 13.51 g/cm^3 \N berkelium_alphadensity 14779.9999999999982 kg/m^3 \N 14.78 g/cm^3 \N californiumdensity 15099.9999999999982 kg/m^3 \N 15.1 g/cm^3 \N protactiniumdensity 15369.9999999999982 kg/m^3 \N 15.37 g/cm^3 \N tantalumdensity 16689.9999999999964 kg/m^3 \N 16.69 g/cm^3 \N uraniumdensity 19100 kg/m^3 \N 19.1 g/cm^3 \N tungstendensity 19299.9999999999964 kg/m^3 \N 19.3 g/cm^3 \N golddensity 19299.9999999999964 kg/m^3 \N 19.30 g/cm^3 \N plutoniumdensity 19815.9999999999964 kg/m^3 \N 19.816 g/cm^3 \N neptuniumdensity 20449.9999999999964 kg/m^3 \N 20.45 g/cm^3 \N rheniumdensity 21019.9999999999964 kg/m^3 \N 21.02 g/cm^3 \N platinumdensity 21449.9999999999964 kg/m^3 \N 21.45 g/cm^3 \N iridiumdensity 22559.9999999999964 kg/m^3 \N 22.56 g/cm^3 \N osmiumdensity 22589.9999999999964 kg/m^3 \N 22.59 g/cm^3 \N tin_gray 5768.99999999999909 kg/m^3 \N tin_alpha_density \N tin_white 7264.99999999999818 kg/m^3 \N tin_beta_density \N graphitedensity 2266.99999999999955 kg/m^3 \N carbon_graphite_density \N diamonddensity 3514.99999999999955 kg/m^3 \N carbon_diamond_density \N franciumdensity 2479.99999999999955 kg/m^3 \N 2.48 g/cm^3 \N astatinedensity 6349.99999999999909 kg/m^3 \N 6.35 g/cm^3 \N einsteiniumdensity 8840 kg/m^3 \N 8.84 g/cm^3 \N fermiumdensity 9699.99999999999818 kg/m^3 \N 9.7 g/cm^3 \N nobeliumdensity 9900 kg/m^3 \N 9.9 g/cm^3 \N mendeleviumdensity 10299.9999999999982 kg/m^3 \N 10.3 g/cm^3 \N lawrenciumdensity 15999.9999999999982 kg/m^3 \N 16 g/cm^3 \N rutherfordiumdensity 23199.9999999999927 kg/m^3 \N 23.2 g/cm^3 \N roentgeniumdensity 28699.9999999999964 kg/m^3 \N 28.7 g/cm^3 \N dubniumdensity 29299.9999999999964 kg/m^3 \N 29.3 g/cm^3 \N darmstadtiumdensity 34799.9999999999927 kg/m^3 \N 34.8 g/cm^3 \N seaborgiumdensity 35000 kg/m^3 \N 35 g/cm^3 \N bohriumdensity 37099.9999999999927 kg/m^3 \N 37.1 g/cm^3 \N meitneriumdensity 37400 kg/m^3 \N 37.4 g/cm^3 \N hassiumdensity 40999.9999999999927 kg/m^3 \N 41 g/cm^3 \N people 1 \N 1 \N person 1 \N people \N death 1 \N people \N capita 1 \N people \N Tim 0.173611111111111105 s \N 12^-4 hour \N Grafut 0.295580451871141958 m \N gravity Tim^2 \N Surf 0.08736780352834847 m^2 \N Grafut^2 \N Volm 0.0258242148458983911 m^3 \N Grafut^3 \N Vlos 1.70254340277777771 m/s \N Grafut/Tim \N Maz 25.8234917881283188 kg \N Volm kg / oldliter \N Gf 0.295580451871141958 m \N Grafut \N Sf 0.08736780352834847 m^2 \N Surf \N Vm 0.0258242148458983911 m^3 \N Volm \N Vl 1.70254340277777771 m/s \N Vlos \N Mz 25.8234917881283188 kg \N Maz \N wari_proportion 0.100000000000000006 \N 1|10 \N wari 0.100000000000000006 \N wari_proportion \N bu_proportion 0.0100000000000000002 \N 1|100 \N rin_proportion 0.00100000000000000002 \N 1|1000 \N mou_proportion 0.000100000000000000005 \N 1|10000 \N shaku 0.303030303030303039 m \N 1|3.3 m \N mou 3.03030303030303057e-05 m \N 1|10000 shaku \N rin 0.00030303030303030303 m \N 1|1000 shaku \N bu_distance 0.0030303030303030303 m \N 1|100 shaku \N sun 0.0303030303030303039 m \N 1|10 shaku \N jou_distance 3.03030303030303028 m \N 10 shaku \N jou 3.03030303030303028 m \N jou_distance \N kanejakusun 0.0303030303030303039 m \N sun \N kanejaku 0.303030303030303039 m \N shaku \N kanejakujou 3.03030303030303028 m \N jou \N taichi 0.303030303030303039 m \N shaku \N taicun 0.0303030303030303039 m \N sun \N 台尺 0.303030303030303039 m \N taichi \N 台寸 0.0303030303030303039 m \N taicun \N kujirajaku 0.378787878787878785 m \N 10|8 shaku \N kujirajakusun 0.0378787878787878798 m \N 1|10 kujirajaku \N kujirajakubu 0.00378787878787878798 m \N 1|100 kujirajaku \N kujirajakujou 3.78787878787878807 m \N 10 kujirajaku \N tan_distance 11.3636363636363633 m \N 3 kujirajakujou \N ken 1.81818181818181834 m \N 6 shaku \N chou_distance 109.090909090909093 m \N 60 ken \N chou 109.090909090909093 m \N chou_distance \N ri 3927.27272727272748 m \N 36 chou \N tsubo 3.30578512396694224 m^2 \N 36 shaku^2 \N se 99.1735537190082681 m^2 \N 30 tsubo \N tan_area 991.735537190082709 m^2 \N 10 se \N chou_area 9917.35537190082687 m^2 \N 10 tan_area \N ping 3.30578512396694224 m^2 \N tsubo \N jia 9699.17355371900885 m^2 \N 2934 ping \N fen 969.917355371900953 m^2 \N 1|10 jia \N fen_area 969.917355371900953 m^2 \N 1|10 jia \N 坪 3.30578512396694224 m^2 \N ping \N 甲 9699.17355371900885 m^2 \N jia \N 分 969.917355371900953 m^2 \N fen \N 分地 969.917355371900953 m^2 \N fen_area \N edoma 1.54453627180899922 m^2 \N (5.8*2.9) shaku^2 \N kyouma 1.8223140495867769 m^2 \N (6.3*3.15) shaku^2 \N chuukyouma 1.65289256198347112 m^2 \N (6*3) shaku^2 \N jou_area 1.54453627180899922 m^2 \N edoma \N tatami 1.54453627180899922 m^2 \N jou_area \N shou 0.00180390683696468883 m^3 \N (4.9*4.9*2.7) sun^3 \N to 0.0180390683696468879 m^3 \N 10 shou \N koku 0.180390683696468879 m^3 \N 10 to \N monme 0.00374999999999999986 kg \N momme \N kin 0.599999999999999978 kg \N 160 monme \N kan 3.75 kg \N 1000 monme \N kwan 3.75 kg \N kan \N taijin 0.599999999999999978 kg \N kin \N tailiang 0.0374999999999999986 kg \N 10 monme \N taiqian 0.00374999999999999986 kg \N monme \N 台斤 0.599999999999999978 kg \N taijin \N 台兩 0.0374999999999999986 kg \N tailiang \N 台錢 0.00374999999999999986 kg \N taiqian \N australiasquare 9.29030400000000078 m^2 \N (10 ft)^2 \N zentner 50 kg \N 50 kg \N doppelzentner 100 kg \N 2 zentner \N pfund 0.5 kg \N 500 g \N austriaklafter 1.89648383999999992 m \N 1.89648384 m \N austriafoot 0.316080639999999968 m \N 1|6 austriaklafter \N prussiaklafter 1.87999999999999989 m \N 1.88 m \N prussiafoot 0.313333333333333297 m \N 1|6 prussiaklafter \N bavariaklafter 1.75115500000000002 m \N 1.751155 m \N bavariafoot 0.29185916666666667 m \N 1|6 bavariaklafter \N hesseklafter 2.5 m \N 2.5 m \N hessefoot 0.41666666666666663 m \N 1|6 hesseklafter \N metricklafter 1.80000000000000004 m \N 1.8 m \N austriayoke 5754.64152860983268 m^2 \N 8 austriaklafter * 200 austriaklafter \N liechtensteinsquareklafter 3.59665200000000018 m^2 \N 3.596652 m^2 \N liechtensteinklafter 1.89648411540935413 m \N sqrt(liechtensteinsquareklafter) \N prussiawoodklafter 3.32233599999999951 m^3 \N 0.5 prussiaklafter^3 \N austriawoodklafter 3.41049520750045154 m^3 \N 0.5 austriaklafter^3 \N festmeter 1 m^3 \N m^3 \N raummeter 0.699999999999999956 m^3 \N 0.7 festmeter \N schuettraummeter 0.45499999999999996 m^3 \N 0.65 raummeter \N schüttraummeter 0.45499999999999996 m^3 \N schuettraummeter \N verklinje 0.00206181249999999984 m \N 2.0618125 mm \N verktum 0.0247417499999999999 m \N 12 verklinje \N kvarter 0.148450499999999985 m \N 6 verktum \N fot 0.29690099999999997 m \N 2 kvarter \N aln 0.593801999999999941 m \N 2 fot \N famn 1.78140599999999982 m \N 3 aln \N funt 0.409517179999999981 kg \N 409.51718 grams \N zolotnik 0.00426580395833333313 kg \N 1|96 funt \N pood 16.3806872000000006 kg \N 40 funt \N arshin 0.711200000000000054 m \N (2 + 1|3) feet \N sazhen 2.13360000000000039 m \N 3 arshin \N verst 1066.80000000000018 m \N 500 sazhen \N versta 1066.80000000000018 m \N verst \N borderverst 2133.60000000000036 m \N 1000 sazhen \N russianmile 7467.60000000000127 m \N 7 verst \N frenchfoot 0.324839384970764478 m \N 144|443.296 m \N pied 0.324839384970764478 m \N frenchfoot \N frenchfeet 0.324839384970764478 m \N frenchfoot \N frenchinch 0.0270699487475637053 m \N 1|12 frenchfoot \N frenchthumb 0.0270699487475637053 m \N frenchinch \N pouce 0.0270699487475637053 m \N frenchthumb \N frenchline 0.0022558290622969753 m \N 1|12 frenchinch \N ligne 0.0022558290622969753 m \N frenchline \N frenchpoint 0.000187985755191414608 m \N 1|12 frenchline \N toise 1.94903630982458687 m \N 6 frenchfeet \N arpent 3418.86828331317884 m^2 \N 180^2 pied^2 \N frenchgrain 5.31147837033220597e-05 kg \N 1|18827.15 kg \N frenchpound 0.489505846609816109 kg \N 9216 frenchgrain \N tronpound 0.616885623200000066 kg \N 9520 grain \N tronstone 9.87016997120000106 kg \N 16 tronpound \N towerpound 0.349914114000000054 kg \N 5400 grain \N towerounce 0.0291595095000000033 kg \N 1|12 towerpound \N towerpennyweight 0.0014579754750000003 kg \N 1|20 towerounce \N towergrain 4.55617335937500093e-05 kg \N 1|32 towerpennyweight \N mercpound 0.43739264250000004 kg \N 6750 grain \N mercounce 0.0291595095000000033 kg \N 1|15 mercpound \N mercpennyweight 0.0014579754750000003 kg \N 1|20 mercounce \N leadstone 5.66990462500000003 kg \N 12.5 lb \N fotmal 31.751465900000003 kg \N 70 lb \N leadwey 79.3786647499999987 kg \N 14 leadstone \N fothers 952.543977000000041 kg \N 12 leadwey \N newhaytruss 27.2155422000000016 kg \N 60 lb \N newhayload 979.759519200000113 kg \N 36 newhaytruss \N oldhaytruss 25.4011727200000017 kg \N 56 lb \N oldhayload 914.442217920000076 kg \N 36 oldhaytruss \N woolclove 3.17514659000000021 kg \N 7 lb \N woolstone 6.35029318000000043 kg \N 2 woolclove \N wooltod 12.7005863600000009 kg \N 2 woolstone \N woolwey 82.55381134000001 kg \N 13 woolstone \N woolsack 165.10762268000002 kg \N 2 woolwey \N woolsarpler 330.21524536000004 kg \N 2 woolsack \N woollast 1981.29147216000024 kg \N 6 woolsarpler \N romanfoot 0.295999999999999985 m \N 296 mm \N romanfeet 0.295999999999999985 m \N romanfoot \N pes 0.295999999999999985 m \N romanfoot \N pedes 0.295999999999999985 m \N romanfoot \N romaninch 0.0246666666666666631 m \N 1|12 romanfoot \N romandigit 0.0184999999999999991 m \N 1|16 romanfoot \N romanpalm 0.0739999999999999963 m \N 1|4 romanfoot \N romancubit 0.44399999999999995 m \N 18 romaninch \N romanpace 1.47999999999999998 m \N 5 romanfeet \N passus 1.47999999999999998 m \N romanpace \N romanperch 2.95999999999999996 m \N 10 romanfeet \N stade 185 m \N 125 romanpaces \N stadia 185 m \N stade \N stadium 185 m \N stade \N romanmile 1480 m \N 8 stadia \N romanleague 2220 m \N 1.5 romanmile \N schoenus 5920 m \N 4 romanmile \N earlyromanfoot 0.297300000000000009 m \N 29.73 cm \N pesdrusianus 0.332999999999999963 m \N 33.3 cm \N lateromanfoot 0.294200000000000017 m \N 29.42 cm \N actuslength 35.519999999999996 m \N 120 romanfeet \N actus 42.0556799999999953 m^2 \N 120*4 romanfeet^2 \N squareactus 1261.67039999999974 m^2 \N 120^2 romanfeet^2 \N acnua 1261.67039999999974 m^2 \N squareactus \N iugerum 2523.34079999999949 m^2 \N 2 squareactus \N iugera 2523.34079999999949 m^2 \N iugerum \N jugerum 2523.34079999999949 m^2 \N iugerum \N jugera 2523.34079999999949 m^2 \N iugerum \N heredium 5046.68159999999898 m^2 \N 2 iugera \N heredia 5046.68159999999898 m^2 \N heredium \N centuria 504668.159999999916 m^2 \N 100 heredia \N centurium 504668.159999999916 m^2 \N centuria \N sextarius 0.000580102065600000241 m^3 \N 35.4 in^3 \N sextarii 0.000580102065600000241 m^3 \N sextarius \N cochlearia 1.20854597000000039e-05 m^3 \N 1|48 sextarius \N cyathi 4.83418388000000156e-05 m^3 \N 1|12 sextarius \N acetabula 7.25127582000000302e-05 m^3 \N 1|8 sextarius \N quartaria 0.00014502551640000006 m^3 \N 1|4 sextarius \N quartarius 0.00014502551640000006 m^3 \N quartaria \N heminae 0.000290051032800000121 m^3 \N 1|2 sextarius \N hemina 0.000290051032800000121 m^3 \N heminae \N cheonix 0.000870153098400000416 m^3 \N 1.5 sextarii \N semodius 0.00464081652480000193 m^3 \N 8 sextarius \N semodii 0.00464081652480000193 m^3 \N semodius \N modius 0.00928163304960000386 m^3 \N 16 sextarius \N modii 0.00928163304960000386 m^3 \N modius \N congius 0.00348061239360000167 m^3 \N 12 heminae \N congii 0.00348061239360000167 m^3 \N congius \N amphora 0.0278448991488000133 m^3 \N 8 congii \N amphorae 0.0278448991488000133 m^3 \N amphora \N culleus 0.556897982976000239 m^3 \N 20 amphorae \N quadrantal 0.0278448991488000133 m^3 \N amphora \N libra 0.327364093320000049 kg \N 5052 grain \N librae 0.327364093320000049 kg \N libra \N romanpound 0.327364093320000049 kg \N libra \N uncia 0.0272803411100000018 kg \N 1|12 libra \N unciae 0.0272803411100000018 kg \N uncia \N romanounce 0.0272803411100000018 kg \N uncia \N deunx 0.300083752209999999 kg \N 11 uncia \N dextans 0.272803411100000004 kg \N 10 uncia \N dodrans 0.245523069990000009 kg \N 9 uncia \N bes 0.218242728880000014 kg \N 8 uncia \N seprunx 0.190962387770000019 kg \N 7 uncia \N semis 0.163682046660000025 kg \N 6 uncia \N quincunx 0.136401705550000002 kg \N 5 uncia \N triens 0.109121364440000007 kg \N 4 uncia \N quadrans 0.0818410233300000123 kg \N 3 uncia \N sextans 0.0545606822200000036 kg \N 2 uncia \N sescuncia 0.0409205116650000061 kg \N 1.5 uncia \N semuncia 0.0136401705550000009 kg \N 1|2 uncia \N siscilius 0.00682008527750000045 kg \N 1|4 uncia \N sextula 0.00454672351833333363 kg \N 1|6 uncia \N semisextula 0.00227336175916666682 kg \N 1|12 uncia \N scriptulum 0.00113668087958333341 kg \N 1|24 uncia \N scrupula 0.00113668087958333341 kg \N scriptulum \N romanobol 0.000568340439791666704 kg \N 1|2 scrupula \N romanaspound 0.272803411100000059 kg \N 4210 grain \N egyptianroyalcubit 0.524002000000000079 m \N 20.63 in \N egyptianpalm 0.0748574285714285748 m \N 1|7 egyptianroyalcubit \N egyptiandigit 0.0187143571428571437 m \N 1|4 egyptianpalm \N egyptianshortcubit 0.449144571428571449 m \N 6 egyptianpalm \N doubleremen 0.7406640000000001 m \N 29.16 in \N remendigit 0.0185166000000000046 m \N 1|40 doubleremen \N greekfoot 0.316230000000000011 m \N 12.45 in \N greekfeet 0.316230000000000011 m \N greekfoot \N greekcubit 0.474345000000000017 m \N 1.5 greekfoot \N pous 0.316230000000000011 m \N greekfoot \N podes 0.316230000000000011 m \N greekfoot \N orguia 1.89738000000000007 m \N 6 greekfoot \N greekfathom 1.89738000000000007 m \N orguia \N stadion 189.738 m \N 100 orguia \N akaina 3.16230000000000011 m \N 10 greekfeet \N plethron 31.6230000000000011 m \N 10 akaina \N greekfinger 0.0197643750000000007 m \N 1|16 greekfoot \N homericcubit 0.395287500000000014 m \N 20 greekfingers \N shortgreekcubit 0.355758750000000012 m \N 18 greekfingers \N ionicfoot 0.295999999999999985 m \N 296 mm \N doricfoot 0.326000000000000012 m \N 326 mm \N olympiccubit 0.462915000000000132 m \N 25 remendigit \N olympicfoot 0.308610000000000051 m \N 2|3 olympiccubit \N olympicfinger 0.0192881250000000032 m \N 1|16 olympicfoot \N olympicfeet 0.308610000000000051 m \N olympicfoot \N olympicdakylos 0.0192881250000000032 m \N olympicfinger \N olympicpalm 0.0771525000000000127 m \N 1|4 olympicfoot \N olympicpalestra 0.0771525000000000127 m \N olympicpalm \N olympicspithame 0.228600000000000025 m \N 3|4 foot \N olympicspan 0.228600000000000025 m \N olympicspithame \N olympicbema 0.771525000000000127 m \N 2.5 olympicfeet \N olympicpace 0.771525000000000127 m \N olympicbema \N olympicorguia 1.85166000000000031 m \N 6 olympicfeet \N olympicfathom 1.85166000000000031 m \N olympicorguia \N olympiccord 18.5166000000000039 m \N 60 olympicfeet \N olympicamma 18.5166000000000039 m \N olympiccord \N olympicplethron 30.8610000000000042 m \N 100 olympicfeet \N olympicstadion 185.166000000000025 m \N 600 olympicfeet \N greekkotyle 0.000270000000000000058 m^3 \N 270 ml \N xestes 0.000540000000000000115 m^3 \N 2 greekkotyle \N khous 0.00324000000000000069 m^3 \N 12 greekkotyle \N metretes 0.0388800000000000118 m^3 \N 12 khous \N choinix 0.00108000000000000023 m^3 \N 4 greekkotyle \N hekteos 0.00864000000000000185 m^3 \N 8 choinix \N medimnos 0.0518400000000000111 m^3 \N 6 hekteos \N aeginastater 0.0124413907200000007 kg \N 192 grain \N aeginadrachmae 0.00622069536000000034 kg \N 1|2 aeginastater \N aeginaobol 0.00103678255999999991 kg \N 1|6 aeginadrachmae \N aeginamina 0.622069536000000034 kg \N 50 aeginastaters \N aeginatalent 37.3241721600000034 kg \N 60 aeginamina \N atticstater 0.00874785285000000135 kg \N 135 grain \N atticdrachmae 0.00437392642500000067 kg \N 1|2 atticstater \N atticobol 0.00072898773750000004 kg \N 1|6 atticdrachmae \N atticmina 0.437392642500000095 kg \N 50 atticstaters \N attictalent 26.2435585500000066 kg \N 60 atticmina \N northerncubit 0.675640000000000129 m \N 26.6 in \N northernfoot 0.337820000000000065 m \N 1|2 northerncubit \N sumeriancubit 0.494999999999999996 m \N 495 mm \N kus 0.494999999999999996 m \N sumeriancubit \N sumerianfoot 0.32999999999999996 m \N 2|3 sumeriancubit \N assyriancubit 0.548640000000000128 m \N 21.6 in \N assyrianfoot 0.274320000000000064 m \N 1|2 assyriancubit \N assyrianpalm 0.0914400000000000213 m \N 1|3 assyrianfoot \N assyriansusi 0.00457200000000000141 m \N 1|20 assyrianpalm \N susi 0.00457200000000000141 m \N assyriansusi \N persianroyalcubit 0.640080000000000204 m \N 7 assyrianpalm \N hashimicubit 0.649224000000000023 m \N 25.56 in \N blackcubit 0.540512000000000103 m \N 21.28 in \N arabicfeet 0.270256000000000052 m \N 1|2 blackcubit \N arabicfoot 0.270256000000000052 m \N arabicfeet \N arabicinch 0.0225213333333333376 m \N 1|12 arabicfoot \N arabicmile 2162.04800000000023 m \N 4000 blackcubit \N silverdirhem 0.00291595095000000016 kg \N 45 grain \N tradedirhem 0.00311034768000000017 kg \N 48 grain \N silverkirat 0.00018224693437500001 kg \N 1|16 silverdirhem \N silverwukiyeh 0.0291595094999999999 kg \N 10 silverdirhem \N silverrotl 0.349914113999999998 kg \N 12 silverwukiyeh \N arabicsilverpound 0.349914113999999998 kg \N silverrotl \N tradekirat 0.000194396730000000011 kg \N 1|16 tradedirhem \N tradewukiyeh 0.0311034768000000017 kg \N 10 tradedirhem \N traderotl 0.37324172160000002 kg \N 12 tradewukiyeh \N arabictradepound 0.37324172160000002 kg \N traderotl \N parasang 5632.70399999999972 m \N 3.5 mile \N biblicalcubit 0.553720000000000101 m \N 21.8 in \N hebrewcubit 0.446531999999999984 m \N 17.58 in \N li 578.900719424460476 m \N 10|27.8 mile \N liang 0.103948251458333335 kg \N 11|3 oz \N timepoint 720 s \N 1|5 hour \N timeminute 360 s \N 1|10 hour \N timeostent 60 s \N 1|60 hour \N timeounce 7.5 s \N 1|8 timeostent \N timeatom 0.159574468085106391 s \N 1|47 timeounce \N mite 3.2399455000000004e-06 kg \N 1|20 grain \N droit 1.34997729166666675e-07 kg \N 1|24 mite \N periot 6.74988645833333373e-09 kg \N 1|20 droit \N blanc 2.81245269097222222e-10 kg \N 1|24 periot \N hundredweight 45.3592370000000003 kg \N ushundredweight \N scruple 0.0012959782 kg \N apscruple \N fluidounce 2.95735295625000113e-05 m^3 \N usfluidounce \N bushel 0.0352390701668800141 m^3 \N usbushel \N cup 0.000236588236500000091 m^3 \N uscup \N tablespoon 1.47867647812500057e-05 m^3 \N ustablespoon \N teaspoon 4.92892159375000132e-06 m^3 \N usteaspoon \N pony 2.95735295625000113e-05 m^3 \N ponyvolume \N firkin 0.0340687060560000143 m^3 \N usfirkin \N hogshead 0.2384809423920001 m^3 \N ushogshead \N ℯ 2.71828182845904509 \N exp(1) \N ångström 1.00000000000000004e-10 m \N angstrom \N Å 1.00000000000000004e-10 m \N angstrom \N Å 1.00000000000000004e-10 m \N angstrom \N röntgen 0.000257999999999999983 s*A/kg \N roentgen \N °C 1 K 273.15 degC \N °F 0.55555555555555558 K 255.37222222222223 degF \N °K 1 K \N K \N °R 0.55555555555555558 K \N degR \N ° 0.0174532925199432955 \N degree \N ℃ 1 K 273.15 degC \N ℉ 0.55555555555555558 K 255.37222222222223 degF \N K 1 K \N K \N ℓ 0.00100000000000000024 m^3 \N liter \N Ω 1 m^2*kg/s^3*A^2 \N ohm \N Ω 1 m^2*kg/s^3*A^2 \N ohm \N ℧ 1 s^3*A^2/m^2*kg \N mho \N ʒ 0.00177184519531250009 kg \N dram \N ℈ 0.0012959782 kg \N scruple \N ℥ 0.0283495231250000014 kg \N ounce \N ℔ 0.453592370000000022 kg \N lb \N ℎ 6.62607014999999983e-34 m^2*kg/s \N h \N ℏ 1.05457181764615647e-34 m^2*kg/s \N hbar \N τ 6.28318530717958623 \N tau \N 𝜋 3.14159265358979312 \N pi \N α 0.00729735256930000038 \N alpha \N σ 5.67037441918442942e-08 kg/s^3*K^4 \N sigma \N ‰ 0.00100000000000000002 \N 1|1000 \N ‱ 0.000100000000000000005 \N 1|10000 \N ′ 0.00029088820866572158 \N ' \N ″ 4.84813681109535984e-06 \N " \N ㍱ 100 kg/m*s^2 \N hPa \N ㍲ 86400 s \N da \N ㍳ 149597870700 m \N au \N ㍴ 100000 kg/m*s^2 \N bar \N ㍶ 30856775814671916 m \N pc \N ㎀ 9.9999999999999998e-13 A \N pA \N ㎁ 1.00000000000000006e-09 A \N nA \N ㎂ 9.99999999999999955e-07 A \N µA \N ㎃ 0.00100000000000000002 A \N mA \N ㎄ 1000 A \N kA \N ㎅ 1000 B \N kB \N ㎆ 1000000 B \N MB \N ㎇ 1000000000 B \N GB \N ㎊ 9.9999999999999998e-13 s^4*A^2/m^2*kg \N pF \N ㎋ 1.00000000000000006e-09 s^4*A^2/m^2*kg \N nF \N ㎌ 9.99999999999999955e-07 s^4*A^2/m^2*kg \N µF \N ㎍ 1.00000000000000006e-09 kg \N µg \N ㎎ 9.99999999999999955e-07 kg \N mg \N ㎏ 1 kg \N kg \N ㎐ 1 s^-1 \N Hz \N ㎑ 1000 s^-1 \N kHz \N ㎒ 1000000 s^-1 \N MHz \N ㎓ 1000000000 s^-1 \N GHz \N ㎔ 1000000000000 s^-1 \N THz \N ㎕ 1.00000000000000027e-09 m^3 \N µL \N ㎖ 1.00000000000000017e-06 m^3 \N mL \N ㎗ 0.000100000000000000032 m^3 \N dL \N ㎘ 1.00000000000000022 m^3 \N kL \N ㎙ 1.00000000000000008e-15 m \N fm \N ㎚ 1.00000000000000006e-09 m \N nm \N ㎛ 9.99999999999999955e-07 m \N µm \N ㎜ 0.00100000000000000002 m \N mm \N ㎝ 0.0100000000000000002 m \N cm \N ㎞ 1000 m \N km \N ㎟ 9.99999999999999955e-07 m^2 \N mm^2 \N ㎠ 0.000100000000000000005 m^2 \N cm^2 \N ㎡ 1 m^2 \N m^2 \N ㎢ 1000000 m^2 \N km^2 \N ㎣ 1.00000000000000006e-09 m^3 \N mm^3 \N ㎤ 1.00000000000000017e-06 m^3 \N cm^3 \N ㎥ 1 m^3 \N m^3 \N ㎦ 1000000000 m^3 \N km^3 \N ㎧ 1 m/s \N m/s \N ㎨ 1 m/s^2 \N m/s^2 \N ㎩ 1 kg/m*s^2 \N Pa \N ㎪ 1000 kg/m*s^2 \N kPa \N ㎫ 1000000 kg/m*s^2 \N MPa \N ㎬ 1000000000 kg/m*s^2 \N GPa \N ㎭ 0.0100000000000000002 m^2/s^2 \N rad \N ㎮ 0.0100000000000000002 m^2/s^3 \N rad/s \N ㎯ 0.0100000000000000002 m^2/s^4 \N rad/s^2 \N ㎰ 9.9999999999999998e-13 s \N ps \N ㎱ 1.00000000000000006e-09 s \N ns \N ㎲ 9.99999999999999955e-07 s \N µs \N ㎳ 0.00100000000000000002 s \N ms \N ㎴ 9.9999999999999998e-13 m^2*kg/s^3*A \N pV \N ㎵ 1.00000000000000006e-09 m^2*kg/s^3*A \N nV \N ㎶ 9.99999999999999955e-07 m^2*kg/s^3*A \N µV \N ㎷ 0.00100000000000000002 m^2*kg/s^3*A \N mV \N ㎸ 1000 m^2*kg/s^3*A \N kV \N ㎹ 1000000 m^2*kg/s^3*A \N MV \N ㎺ 9.9999999999999998e-13 m^2*kg/s^3 \N pW \N ㎻ 1.00000000000000006e-09 m^2*kg/s^3 \N nW \N ㎼ 9.99999999999999955e-07 m^2*kg/s^3 \N µW \N ㎽ 0.00100000000000000002 m^2*kg/s^3 \N mW \N ㎾ 1000 m^2*kg/s^3 \N kW \N ㎿ 1000000 m^2*kg/s^3 \N MW \N ㏀ 1000 m^2*kg/s^3*A^2 \N kΩ \N ㏁ 1000000 m^2*kg/s^3*A^2 \N MΩ \N ㏃ 1 s^-1 \N Bq \N ㏄ 1.00000000000000017e-06 m^3 \N cc \N ㏅ 1 cd \N cd \N ㏆ 1 s*A/kg \N C/kg \N ㏉ 1 m^2/s^2 \N Gy \N ㏊ 10000 m^2 \N ha \N ㏌ 0.0254000000000000024 m \N in \N ㏏ 1000000 kg \N kt \N ㏐ 1 cd \N lm \N ㏓ 1 cd/m^2 \N lx \N ㏔ 100 kg/m*s^2 \N mb \N ㏕ 2.54000000000000041e-05 m \N mil \N ㏖ 1 mol \N mol \N ㏙ 9.99999999999999955e-07 \N ppm \N ㏛ 1 \N sr \N ㏜ 1 m^2/s^2 \N Sv \N ㏝ 1 m^2*kg/s^2*A \N Wb \N twoscore 40 \N two score \N threescore 60 \N three score \N fourscore 80 \N four score \N fivescore 100 \N five score \N sixscore 120 \N six score \N sevenscore 140 \N seven score \N eightscore 160 \N eight score \N ninescore 180 \N nine score \N tenscore 200 \N ten score \N twelvescore 240 \N twelve score \N VELOCITY 1 m/s \N LENGTH / TIME \N ACCELERATION 1 m/s^2 \N VELOCITY / TIME \N MOMENTUM 1 m*kg/s \N MASS VELOCITY \N IMPULSE 1 m*kg/s \N FORCE TIME \N VISCOSITY 1 kg/m*s \N FORCE TIME / AREA \N KINEMATIC_VISCOSITY 1 m^2/s \N VISCOSITY / DENSITY \N E_FIELD 1 m*kg/s^3*A \N ELECTRIC_POTENTIAL / LENGTH \N E_FLUX 1 m^3*kg/s^3*A \N E_FIELD AREA \N Ah 3600 s*A \N amp hour \N xunit 1.00207697000000001e-13 m \N xunit_cu \N siegbahn 1.00207697000000001e-13 m \N xunit \N shake 1.00000000000000002e-08 s \N 1e-8 sec \N pyron 697.799999999999955 kg/s^3 \N cal_IT / cm^2 min \N katal 1 mol/s \N mol/sec \N kat 1 mol/s \N katal \N solarirradiance 1361.16369462234866 kg/s^3 \N solarluminosity / (4 pi sundist^2) \N solarconstant 1361.16369462234866 kg/s^3 \N solarirradiance \N TSI 1361.16369462234866 kg/s^3 \N solarirradiance \N cron 31556925974678.4023 s \N 1e6 years \N mu0_SI 1.25663706212383764e-06 \N 2 alpha h_SI / e_SI^2 c_SI \N mu0 1.25663706212383764e-06 m*kg/s^2*A^2 \N 2 alpha h / e^2 c \N epsilon0_SI 8.85418781277334503e-12 \N 1/mu0_SI c_SI^2 \N epsilon0 8.85418781277334503e-12 s^4*A^2/m^3*kg \N 1/mu0 c^2 \N Z0 376.730313668003987 m^2*kg/s^3*A^2 \N mu0 c \N coulombconst 8987551792.28822899 m^3*kg/s^4*A^2 \N 1/4 pi epsilon0 \N k_C 8987551792.28822899 m^3*kg/s^4*A^2 \N coulombconst \N molarvolume 0.0224139695450141369 m^3 \N mol R stdtemp / atm \N loschmidt 2.68678011179844392e+25 m^-3 \N avogadro mol / molarvolume \N R_H 10967758.3402801529 m^-1 \N Rinfinity m_p / (m_e + m_p) \N prout 2.97203765606999975e-14 m^2*kg/s^2 \N 185.5 keV \N electronradius 2.81794032620008515e-15 m \N coulombconst e^2 / electronmass c^2 \N electronmass_SI 9.10938370154308021e-31 \N electronmass_u atomicmassunit_SI \N fermicoupling 454379566261215.938 s^4/m^4*kg^2 \N 1.1663787e-5 / GeV^2 \N lightyear 9460730472580800 m \N c julianyear \N ly 9460730472580800 m \N lightyear \N amagatvolume 0.0224139695450141369 m^3 \N molarvolume \N amagat 44.6150334054703137 mol/m^3 \N mol/amagatvolume \N kcal_mol 6.94769545705537413e-21 m^2*kg/s^2 \N kcal_th / mol N_A \N abfarad 1000000000 s^4*A^2/m^2*kg \N abampere sec / abvolt \N abF 1000000000 s^4*A^2/m^2*kg \N abfarad \N abhenry 1.00000000000000006e-09 m^2*kg/s^2*A^2 \N abvolt sec / abamp \N abH 1.00000000000000006e-09 m^2*kg/s^2*A^2 \N abhenry \N oersted 79.5774715023845971 A/m \N gauss / mu0 \N Oe 79.5774715023845971 A/m \N oersted \N gilbert 0.795774715023846002 A \N gauss cm / mu0 \N Gb 0.795774715023846002 A \N gilbert \N Gi 0.795774715023846002 A \N gilbert \N planckcharge 5.29081768988981784e-19 s*A \N sqrt(epsilon0 hbar c) \N planckcurrent 9.81371885075815513e+24 A \N planckcharge / plancktime \N planckvolt 3.69712538089572431e+27 m^2*kg/s^3*A \N planckenergy / planckcharge \N planckEfield 2.2874641223243699e+62 m*kg/s^3*A \N planckvolt / plancklength \N planckBfield 7.63015900261363448e+53 kg/s^2*A \N planckEfield / c \N planckcharge_red 5.29081768988981784e-19 s*A \N sqrt(epsilon0 hbar c) \N planckcurrent_red 1.95755368876999299e+24 A \N planckcharge_red / plancktime_red \N planckvolt_red 7.37469815192277718e+26 m^2*kg/s^3*A \N planckenergy_red / planckcharge_red \N planckEfield_red 9.10153055533218475e+60 m*kg/s^3*A \N planckvolt_red / plancklength_red \N planckBfield_red 3.03594380460771469e+52 kg/s^2*A \N planckEfield_red /c \N ouncecopper 3.43252786584860234e-05 m \N oz / ft^2 copperdensity \N ozcu 3.43252786584860234e-05 m \N ouncecopper \N LUMINOUS_FLUX 1 cd \N lumen \N LUMINOUS_ENERGY 1 s*cd \N talbot \N ILLUMINANCE 1 cd/m^2 \N lux \N EXITANCE 1 cd/m^2 \N lux \N skot 0.000318309886183790701 cd/m^2 \N 1e-3 apostilb \N LUMINANCE 1 cd/m^2 \N nit \N saros 568971744.399999976 s \N 223 synodicmonth \N mercuryday 5067360 s \N mercuryday_sidereal \N venusday 20997360 s \N venusday_sidereal \N earthday 86164.0905400000047 s \N earthday_sidereal \N marsday 88642.4400000000023 s \N marsday_sidereal \N jupiterday 35730 s \N jupiterday_sidereal \N saturnday 38361.5999999999985 s \N saturnday_sidereal \N uranusday 62063.9999999999927 s \N uranusday_sidereal \N neptuneday 57996 s \N neptuneday_sidereal \N plutoday 551854.079999999958 s \N plutoday_sidereal \N earthsundist_min 147095000000 m \N sundist_min \N earthsundist_max 152100000000 m \N sundist_max \N earthflattening 0.00335281969789619303 \N IERS_earthflattening \N earthradius_equatorial 6378136.59999999963 m \N IERS_earthradius_equatorial \N earthradius_polar 6356751.85797164682 m \N (1-earthflattening) earthradius_equatorial \N lunarparallax 0.0165932083670966672 \N asin(earthradius_equatorial / moondist) \N moonhp 0.0165932083670966672 \N lunarparallax \N intacrefoot 1233.48183754752017 m^3 \N acre foot \N acrefoot 1233.48183754752017 m^3 \N intacrefoot \N geographicalmile 1853.1840000000002 m \N brnauticalmile \N cwt 45.3592370000000003 kg \N hundredweight \N uston 907.184740000000033 kg \N shortton \N quarterweight 226.796185000000008 kg \N 1|4 uston \N usassayton 0.0291666666666666637 kg \N mg uston / troyounce \N brassayton 0.0326666666666666702 kg \N mg brton / troyounce \N fluiddram 3.69669119531250141e-06 m^3 \N 1|8 usfloz \N minimvolume 6.16115199218750165e-08 m^3 \N 1|60 fluiddram \N floz 2.95735295625000113e-05 m^3 \N fluidounce \N fldr 3.69669119531250141e-06 m^3 \N fluiddram \N usbeerbarrel 0.11734776530400004 m^3 \N 2 beerkegs \N bu 0.0352390701668800141 m^3 \N bushel \N peck 0.00880976754172000352 m^3 \N 1|4 bushel \N brpeck 0.00909218000000000352 m^3 \N 1|4 brbushel \N pk 0.00880976754172000352 m^3 \N peck \N reputedquart 0.000757681666666666924 m^3 \N 1|6 brgallon \N reputedpint 0.000378840833333333462 m^3 \N 1|2 reputedquart \N brwinebottle 0.000757681666666666924 m^3 \N reputedquart \N alcoholunitus 1.77372355251488662e-05 m^3 \N 14 g / ethanoldensity \N alcoholunitca 1.72304573672874716e-05 m^3 \N 13.6 g / ethanoldensity \N alcoholunituk 1.01355631572279248e-05 m^3 \N 8 g / ethanoldensity \N alcoholunitau 1.26694539465349047e-05 m^3 \N 10 g / ethanoldensity \N clarkdegree 0.0142537675233002387 kg/m^3 \N grains/brgallon \N footballfield 91.4400000000000119 m \N usfootballfield \N UK 0.999998261154855572 \N UKlength_SJJ \N brquarterweight 12.7005863600000009 kg \N 1|4 brhundredweight \N brquart 0.00113652250000000044 m^3 \N 1|4 brgallon \N kilderkin 0.0818296200000000334 m^3 \N 2 brfirkin \N imperialquart 0.00113652250000000044 m^3 \N brquart \N barleycorn 0.00846665194444444491 m \N 1|3 UKinch \N nail 0.0571499006249999997 m \N 1|16 UKyard \N pole 5.02919125500000064 m \N 16.5 UKft \N rope 6.09598940000000056 m \N 20 UKft \N englishell 1.1429980125000001 m \N 45 UKinch \N flemishell 0.685798807499999996 m \N 27 UKinch \N ell 1.1429980125000001 m \N englishell \N span 0.228599602499999999 m \N 9 UKinch \N goad 1.37159761499999999 m \N 4.5 UKft \N aluminium 26.9815390000000015 \N aluminum \N sulphur 32.0660000000000025 \N sulfur \N palmwidth 0.10160000000000001 m \N hand \N tbl 1.47867647812500057e-05 m^3 \N tablespoon \N tbsp 1.47867647812500057e-05 m^3 \N tablespoon \N tblsp 1.47867647812500057e-05 m^3 \N tablespoon \N Tb 1.47867647812500057e-05 m^3 \N tablespoon \N tsp 4.92892159375000132e-06 m^3 \N teaspoon \N saltspoon 1.23223039843750033e-06 m^3 \N 1|4 tsp \N wood_mod_beech 11858982544.2495785 kg/m*s^2 \N 1.720e6 lbf/in^2 \N wood_mod_birchyellow 13858462159.2684021 kg/m*s^2 \N 2.010e6 lbf/in^2 \N wood_mod_birch 13858462159.2684021 kg/m*s^2 \N wood_mod_birchyellow \N wood_mod_cherry 10273188366.8208561 kg/m*s^2 \N 1.490e6 lbf/in^2 \N wood_mod_hardmaple 12617405846.4980984 kg/m*s^2 \N 1.830e6 lbf/in^2 \N wood_mod_bigleafmaple 9997398075.09412193 kg/m*s^2 \N 1.450e6 lbf/in^2 \N wood_mod_boxeldermaple 7239495157.82677841 kg/m*s^2 \N 1.050e6 lbf/in^2 \N wood_mod_redmaple 11307401960.7961102 kg/m*s^2 \N 1.640e6 lbf/in^2 \N wood_mod_silvermaple 7860023314.21193027 kg/m*s^2 \N 1.140e6 lbf/in^2 \N wood_mod_softmaple 9101079626.98223495 kg/m*s^2 \N (wood_mod_bigleafmaple + wood_mod_boxeldermaple + wood_mod_redmaple + wood_mod_silvermaple) / 4 \N wood_mod_redoak 12141667593.2694817 kg/m*s^2 \N 1.761e6 lbf/in^2 \N wood_mod_whiteoak 12148562350.5626507 kg/m*s^2 \N 1.762e6 lbf/in^2 \N wood_mod_poplar 10893716523.206007 kg/m*s^2 \N 1.580e6 lbf/in^2 \N wood_mod_blackwalnut 11583192252.5228443 kg/m*s^2 \N 1.680e6 lbf/in^2 \N wood_mod_walnut 11583192252.5228443 kg/m*s^2 \N wood_mod_blackwalnut \N wood_mod_jeffreypine 8549499043.52876663 kg/m*s^2 \N 1.240e6 lbf/in^2 \N wood_mod_ocotepine 15230518860.6089077 kg/m*s^2 \N 2.209e6 lbf/in^2 \N wood_mod_ponderosapine 8894236908.18718338 kg/m*s^2 \N 1.290e6 lbf/in^2 \N wood_mod_loblollypine 12341615554.7713642 kg/m*s^2 \N 1.790e6 lbf/in^2 \N wood_mod_longleafpine 13651619440.4733524 kg/m*s^2 \N 1.980e6 lbf/in^2 \N wood_mod_shortleafpine 12065825263.0446281 kg/m*s^2 \N 1.750e6 lbf/in^2 \N wood_mod_slashpine 13651619440.4733524 kg/m*s^2 \N 1.980e6 lbf/in^2 \N wood_mod_yellowpine 12927669924.6906738 kg/m*s^2 \N (wood_mod_loblollypine + wood_mod_longleafpine + wood_mod_shortleafpine + wood_mod_slashpine) / 4 \N wood_mod_redpine 11238454387.8644257 kg/m*s^2 \N 1.630e6 lbf/in^2 \N wood_mod_easternwhitepine 8549499043.52876663 kg/m*s^2 \N 1.240e6 lbf/in^2 \N wood_mod_westernwhitepine 10066345648.0258045 kg/m*s^2 \N 1.460e6 lbf/in^2 \N wood_mod_whitepine 9307922345.77728653 kg/m*s^2 \N (wood_mod_easternwhitepine + wood_mod_westernwhitepine) / 2 \N wood_mod_douglasfir 12169246622.4421558 kg/m*s^2 \N 1.765e6 lbf/in^2 \N wood_mod_blackspruce 10500715357.4954109 kg/m*s^2 \N 1.523e6 lbf/in^2 \N wood_mod_englemannspruce 9438922734.34748459 kg/m*s^2 \N 1.369e6 lbf/in^2 \N wood_mod_redspruce 10755821377.3426418 kg/m*s^2 \N 1.560e6 lbf/in^2 \N wood_mod_sitkaspruce 11031611669.069376 kg/m*s^2 \N 1.600e6 lbf/in^2 \N wood_mod_whitespruce 9066605840.51639366 kg/m*s^2 \N 1.315e6 lbf/in^2 \N wood_mod_spruce 10158735395.754261 kg/m*s^2 \N (wood_mod_blackspruce + wood_mod_englemannspruce + wood_mod_redspruce + wood_mod_sitkaspruce + wood_mod_whitespruce) / 5 \N wood_mod_balsa 3709379423.7245779 kg/m*s^2 \N 0.538e6 lbf/in^2 \N wood_mod_basswood 10066345648.0258045 kg/m*s^2 \N 1.460e6 lbf/in^2 \N wood_mod_blackwood 17947053234.1172409 kg/m*s^2 \N 2.603e6 lbf/in^2 \N wood_mod_bubinga 18409001972.7595215 kg/m*s^2 \N 2.670e6 lbf/in^2 \N wood_mod_cocobolo 18698581779.0725937 kg/m*s^2 \N 2.712e6 lbf/in^2 \N wood_mod_ebony_gaboon 16885260610.9693127 kg/m*s^2 \N 2.449e6 lbf/in^2 \N wood_mod_ebony_macassar 17340314592.3184242 kg/m*s^2 \N 2.515e6 lbf/in^2 \N wood_mod_blackironwood 20449850131.5373535 kg/m*s^2 \N 2.966e6 lbf/in^2 \N wood_mod_koa 10362820211.6320457 kg/m*s^2 \N 1.503e6 lbf/in^2 \N wood_mod_lignumvitae 14085989149.9429588 kg/m*s^2 \N 2.043e6 lbf/in^2 \N wood_mod_mahogany 10052556133.4394684 kg/m*s^2 \N 1.458e6 lbf/in^2 \N wood_mod_rosewood_brazilian 13927409732.2000847 kg/m*s^2 \N 2.020e6 lbf/in^2 \N wood_mod_rosewood_honduran 21994275765.2070694 kg/m*s^2 \N 3.190e6 lbf/in^2 \N wood_mod_rosewood_indian 11500455165.0048256 kg/m*s^2 \N 1.668e6 lbf/in^2 \N wood_mod_snakewood 23193963534.2183609 kg/m*s^2 \N 3.364e6 lbf/in^2 \N wood_mod_teak 12279562739.1328487 kg/m*s^2 \N 1.781e6 lbf/in^2 \N wood_mod_zebrawood 16368153813.9816875 kg/m*s^2 \N 2.374e6 lbf/in^2 \N area_us 9833516900000 m^2 \N area_unitedstates \N slug 14.5939029372063622 kg \N lbf s^2 / ft \N slugf 143.117298239154763 m*kg/s^2 \N slug force \N slinch 175.126835246476361 kg \N lbf s^2 / inch \N slinchf 1717.40757886985739 m*kg/s^2 \N slinch force \N geepound 14.5939029372063622 kg \N slug \N calorie 4.18400000000000016 m^2*kg/s^2 \N cal_th \N cal 4.18400000000000016 m^2*kg/s^2 \N calorie \N Calorie 4184 m^2*kg/s^2 \N kilocalorie \N btu 1055.05585262000022 m^2*kg/s^2 \N btu_IT \N britishthermalunit 1055.05585262000022 m^2*kg/s^2 \N btu \N quad 1.05505585262000026e+18 m^2*kg/s^2 \N quadrillion btu \N specificheat_water 4184 m^2/s^2*K \N calorie / g K \N water_specificheat 4184 m^2/s^2*K \N specificheat_water \N barreloil 6119323945.19600105 m^2*kg/s^2 \N 5.8 Mbtu \N naturalgas_HHV 38264937.344642736 kg/m*s^2 \N 1027 btu/ft3 \N naturalgas_LHV 34650819.6012830958 kg/m*s^2 \N 930 btu/ft3 \N naturalgas 38264937.344642736 kg/m*s^2 \N naturalgas_HHV \N coal_US 24250848.8403365314 m^2/s^2 \N 22 GJ / uston \N ethanol_HHV 23412166674.8845291 kg/m*s^2 \N 84000 btu/usgallon \N ethanol_LHV 21098821634.3899841 kg/m*s^2 \N 75700 btu/usgallon \N diesel 36372473227.052742 kg/m*s^2 \N 130500 btu/usgallon \N gasoline_LHV 32052371042.9966736 kg/m*s^2 \N 115000 btu/usgallon \N gasoline_HHV 34839533742.3876877 kg/m*s^2 \N 125000 btu/usgallon \N gasoline 34839533742.3876877 kg/m*s^2 \N gasoline_HHV \N celsiusheatunit 1897.83047608000015 m^2*kg/s^2 \N cal lb (degC) / gram K \N chu 1897.83047608000015 m^2*kg/s^2 \N celsiusheatunit \N Rvalue 0.176110183682305826 s^3*K/kg \N degF ft^2 hr / btu \N Uvalue 5.67826334111348796 kg/s^3*K \N 1/Rvalue \N clausius 4184 m^2*kg/s^2*K \N 1e3 cal/K \N tonrefrigeration 3516.85284206666756 m^2*kg/s^3 \N uston 144 btu / lb day \N tonref 3516.85284206666756 m^2*kg/s^3 \N tonrefrigeration \N olddidotpoint 0.000375971510382829216 m \N 1|72 frenchinch \N frenchprinterspoint 0.000375971510382829216 m \N olddidotpoint \N majorsecond 1.125 \N musicalfifth^2 / octave \N pythagoreanthird 1.265625 \N majorsecond musicalfifth^2 / octave \N syntoniccomma 1.01249999999999996 \N pythagoreanthird / majorthird \N denier 1.11111111111111096e-07 kg/m \N 1|9 tex \N mbh 293.071070172222278 m^2*kg/s^3 \N 1e3 btu/hour \N oe 79.5774715023845971 A/m \N Oe \N hd 0.2384809423920001 m^3 \N hogshead \N RADIATION_DOSE 1 m^2/s^2 \N gray \N Denz 999.972000783977819 kg/m^3 \N Maz/Volm \N Mag 253.241945744048564 m*kg/s^2 \N Maz gravity \N Dz 999.972000783977819 kg/m^3 \N Denz \N gou_area 0.330578512396694224 m^2 \N 1|10 tsubo \N gou_volume 0.000180390683696468905 m^3 \N 1|10 shou \N gou 0.000180390683696468905 m^3 \N gou_volume \N bu_weight 0.000375000000000000008 kg \N 1|10 monme \N fun 0.000375000000000000008 kg \N 1|10 monme \N switzerlandklafter 1.80000000000000004 m \N metricklafter \N switzerlandfoot 0.299999999999999989 m \N 1|6 switzerlandklafter \N swissklafter 1.80000000000000004 m \N switzerlandklafter \N swissfoot 0.299999999999999989 m \N 1|6 swissklafter \N dessiatine 10925.3975040000041 m^2 \N 2400 sazhen^2 \N dessjatine 10925.3975040000041 m^2 \N dessiatine \N scotsinch 0.025537129310809481 m \N 1.00540054 UKinch \N scotsfoot 0.306445551729713772 m \N 12 scotsinch \N scotsfeet 0.306445551729713772 m \N scotsfoot \N scotsell 0.944873784499950853 m \N 37 scotsinch \N scotsfall 5.66924270699970556 m \N 6 scotsell \N scotschain 22.6769708279988222 m \N 4 scotsfall \N scotsfurlong 226.769708279988208 m \N 10 scotschain \N scotsmile 1814.15766623990567 m \N 8 scotsfurlong \N scotsrood 1285.61251483477417 m^2 \N 40 scotsfall^2 \N scotsacre 5142.4500593390967 m^2 \N 4 scotsrood \N irishinch 0.0253999558333333347 m \N UKinch \N irishpalm 0.0761998675000000042 m \N 3 irishinch \N irishspan 0.228599602499999999 m \N 3 irishpalm \N irishfoot 0.304799470000000017 m \N 12 irishinch \N irishfeet 0.304799470000000017 m \N irishfoot \N irishcubit 0.457199204999999997 m \N 18 irishinch \N irishyard 0.914398409999999995 m \N 3 irishfeet \N irishpace 1.52399735000000014 m \N 5 irishfeet \N irishfathom 1.82879681999999999 m \N 6 irishfeet \N irishpole 6.40078886999999952 m \N 7 irishyard \N irishperch 6.40078886999999952 m \N irishpole \N irishchain 25.6031554799999981 m \N 4 irishperch \N irishlink 0.256031554800000005 m \N 1|100 irishchain \N irishfurlong 256.031554799999981 m \N 10 irishchain \N irishmile 2048.25243839999985 m \N 8 irishfurlong \N irishrood 1638.80392633263477 m^2 \N 40 irishpole^2 \N irishacre 6555.21570533053909 m^2 \N 4 irishrood \N winegallon 0.00378539203729963717 m^3 \N 231 UKinch^3 \N winerundlet 0.06813705667139347 m^3 \N 18 winegallon \N winebarrel 0.119239849174938572 m^3 \N 31.5 winegallon \N winetierce 0.158986465566584773 m^3 \N 42 winegallon \N winehogshead 0.238479698349877145 m^3 \N 2 winebarrel \N winepuncheon 0.317972931133169545 m^3 \N 2 winetierce \N winebutt 0.47695939669975429 m^3 \N 2 winehogshead \N winepipe 0.47695939669975429 m^3 \N winebutt \N winetun 0.95391879339950858 m^3 \N 2 winebutt \N beergallon 0.00462112794163851807 m^3 \N 282 UKinch^3 \N beerbarrel 0.166360605898986658 m^3 \N 36 beergallon \N beerhogshead 0.249540908848479986 m^3 \N 1.5 beerbarrel \N alegallon 0.00462112794163851807 m^3 \N beergallon \N alebarrel 0.157118350015709618 m^3 \N 34 alegallon \N alehogshead 0.235677525023564427 m^3 \N 1.5 alebarrel \N scotsgallon 0.0135558330121188456 m^3 \N 827.232 UKinch^3 \N scotsbarrel 0.108446664096950765 m^3 \N 8 scotsgallon \N scotswheatlippy 0.00225047292059944205 m^3 \N 137.333 UKinch^3 \N scotswheatlippies 0.00225047292059944205 m^3 \N scotswheatlippy \N scotswheatpeck 0.00900189168239776821 m^3 \N 4 scotswheatlippy \N scotswheatfirlot 0.0360075667295910729 m^3 \N 4 scotswheatpeck \N scotswheatboll 0.144030266918364291 m^3 \N 4 scotswheatfirlot \N scotswheatchalder 2.30448427069382866 m^3 \N 16 scotswheatboll \N scotsoatlippy 0.00328304921087790424 m^3 \N 200.345 UKinch^3 \N scotsoatlippies 0.00328304921087790424 m^3 \N scotsoatlippy \N scotsoatpeck 0.013132196843511617 m^3 \N 4 scotsoatlippy \N scotsoatfirlot 0.0525287873740464678 m^3 \N 4 scotsoatpeck \N scotsoatboll 0.210115149496185871 m^3 \N 4 scotsoatfirlot \N scotsoatchalder 3.36184239193897394 m^3 \N 16 scotsoatboll \N tronounce 0.030844281160000004 kg \N 1|20 tronpound \N irishgallon 0.00356580652517922555 m^3 \N 217.6 UKinch^3 \N irishrundlet 0.0641845174532260643 m^3 \N 18 irishgallon \N irishbarrel 0.112322905543145599 m^3 \N 31.5 irishgallon \N irishtierce 0.149763874057527474 m^3 \N 42 irishgallon \N irishhogshead 0.224645811086291197 m^3 \N 2 irishbarrel \N irishpuncheon 0.299527748115054948 m^3 \N 2 irishtierce \N irishpipe 0.449291622172582394 m^3 \N 2 irishhogshead \N irishtun 0.898583244345164789 m^3 \N 2 irishpipe \N irishpeck 0.0071316130503584511 m^3 \N 2 irishgallon \N irishbushel 0.0285264522014338044 m^3 \N 4 irishpeck \N irishstrike 0.0570529044028676088 m^3 \N 2 irishbushel \N irishdrybarrel 0.114105808805735218 m^3 \N 2 irishstrike \N irishquarter 0.224645811086291197 m^3 \N 2 irishbarrel \N ton 907.184740000000033 kg \N uston \N quarter 226.796185000000008 kg \N quarterweight \N minim 6.16115199218750165e-08 m^3 \N minimvolume \N ㎈ 4.18400000000000016 m^2*kg/s^2 \N cal \N ㎉ 4184 m^2*kg/s^2 \N kcal \N D_FIELD 1 s*A/m^2 \N E_FIELD epsilon0 / epsilon0_SI \N H_FIELD 1 A/m \N B_FIELD / (mu0/mu0_SI) \N D_FLUX 1 s*A \N D_FIELD AREA \N H_FLUX 1 m*A \N H_FIELD AREA \N assayton 0.0291666666666666637 kg \N mg ton / troyounce \N brpint 0.00056826125000000022 m^3 \N 1|2 brquart \N imperialpint 0.00056826125000000022 m^3 \N brpint \N brcup 0.00028413062500000011 m^3 \N 1|2 brpint \N brteacup 0.000189420416666666731 m^3 \N 1|3 brpint \N tsi 13789514.5863367189 kg/m*s^2 \N ton force / inch^2 \N tonf 8896.44323052099935 m*kg/s^2 \N ton force \N refrigeration 3.87666666666666737 m^2/s^3 \N tonref / ton \N tnt 4612070.52490763925 m^2/s^2 \N 1e9 cal_th / ton \N davycrocket 41840000000.0000076 m^2*kg/s^2 \N 10 ton tnt \N hiroshima 64852000000000 m^2*kg/s^2 \N 15.5 kiloton tnt \N nagasaki 87864000000000 m^2*kg/s^2 \N 21 kiloton tnt \N fatman 87864000000000 m^2*kg/s^2 \N nagasaki \N littleboy 64852000000000 m^2*kg/s^2 \N hiroshima \N ivyking 2092000000000000 m^2*kg/s^2 \N 500 kiloton tnt \N castlebravo 62760000000000000 m^2*kg/s^2 \N 15 megaton tnt \N tsarbomba 209200000000000000 m^2*kg/s^2 \N 50 megaton tnt \N b53bomb 37656000000000000 m^2*kg/s^2 \N 9 megaton tnt \N trinity 75312000000000 m^2*kg/s^2 \N 18 kiloton tnt \N gadget 75312000000000 m^2*kg/s^2 \N trinity \N shaku_volume 1.80390683696468898e-05 m^3 \N 1|10 gou_volume \N rin_weight 3.75000000000000035e-05 kg \N 1|10 bu_weight \N scotslink 0.226769708279988214 m \N 1|100 scotschain \N winequart 0.000946348009324909293 m^3 \N 1|4 winegallon \N beerquart 0.00115528198540962952 m^3 \N 1|4 beergallon \N alequart 0.00115528198540962952 m^3 \N 1|4 alegallon \N scotsquart 0.00338895825302971141 m^3 \N 1|4 scotsgallon \N trondrop 0.00192776757250000025 kg \N 1|16 tronounce \N irishpottle 0.00178290326258961278 m^3 \N 1|2 irishgallon \N brfluidounce 2.84130625000000117e-05 m^3 \N 1|20 brpint \N brfloz 2.84130625000000117e-05 m^3 \N brfluidounce \N brgill 0.000142065312500000055 m^3 \N 1|4 brpint \N noggin 0.000142065312500000055 m^3 \N brgill \N imperialfluidounce 2.84130625000000117e-05 m^3 \N brfluidounce \N imperialfloz 2.84130625000000117e-05 m^3 \N brfloz \N imperialgill 0.000142065312500000055 m^3 \N brgill \N winepint 0.000473174004662454647 m^3 \N 1|2 winequart \N beerpint 0.000577640992704814759 m^3 \N 1|2 beerquart \N alepint 0.000577640992704814759 m^3 \N 1|2 alequart \N scotspint 0.0016944791265148557 m^3 \N 1|2 scotsquart \N jug 0.0016944791265148557 m^3 \N scotspint \N irishquart 0.000891451631294806388 m^3 \N 1|2 irishpottle \N brdram 3.55163281250000146e-06 m^3 \N 1|8 brfloz \N imperialdram 3.55163281250000146e-06 m^3 \N brdram \N choppin 0.000847239563257427852 m^3 \N 1|2 scotspint \N irishpint 0.000445725815647403194 m^3 \N 1|2 irishquart \N brminim 5.91938802083333537e-08 m^3 \N 1|60 brdram \N brscruple 1.18387760416666715e-06 m^3 \N 1|3 brdram \N fluidscruple 1.18387760416666715e-06 m^3 \N brscruple \N imperialminim 5.91938802083333537e-08 m^3 \N brminim \N imperialscruple 1.18387760416666715e-06 m^3 \N brscruple \N mutchkin 0.000423619781628713926 m^3 \N 1|2 choppin \N irishnoggin 0.000111431453911850799 m^3 \N 1|4 irishpint \N scotsgill 0.000105904945407178481 m^3 \N 1|4 mutchkin \N postgresql-unit-7.8/unitparse.l000066400000000000000000000252031450213077700167470ustar00rootroot00000000000000/* Copyright (C) 2016-2018 Christoph Berg This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ %{ #include "unit.h" #include "unitparse.tab.h" #include #include /* CStringGetTextDatum */ #include /* TEXTOID */ #include /* INFINITY, NAN */ #define when(x) if (!strcmp(yytext, x)) %} %option prefix="yyunit" %option noyywrap %option nounput %option noinput /* UTF-8 support, see http://stackoverflow.com/questions/9611682/flexlexer-support-for-unicode */ U [\x80-\xbf] /* 2-byte UTF-8: \xc2-\xdf excluding SUPER_2, SUPER_3 and SUPER_1 */ U2_1 \xc2[\x80-\xb1] U2_2 \xc2[\xb4-\xb8] U2_3 \xc2[\xba-\xbf] U2_4 [\xc3-\xdf]{U} /* 3-byte UTF-8: \xe0-\xef excluding SUPER_0 .. SUPER_MINUS */ U3_1 [\xe0-\xe1]{U}{U} U3_2 \xe2\x80{U} U3_3 \xe2\x81[\x80-\xaf] U3_4 \xe2\x81[\xbc-\xbf] U3_5 \xe2[\x82-\xbf]{U} U3_6 [\xe3-\xef]{U}{U} /* 4-byte UTF-8: \xf0-\xf4 */ U4 [\xf0-\xf4]{U}{U}{U} UTF8 {U2_1}|{U2_2}|{U2_3}|{U2_4}|{U3_1}|{U3_2}|{U3_3}|{U3_4}|{U3_5}|{U3_6}|{U4} ALPHA [a-zA-Z$%'"_]|{UTF8} ALNUM [a-zA-Z$%'"_0-9]|{UTF8} DOUBLE_R [0-9]*\.?[0-9]+([eE][\-+]?[0-9]+)? TIME_R [0-9]+:[0-9]+:[0-9]+(\.[0-9]+)? UNIT_R {ALPHA}{ALNUM}* EXP_R \^[\-+]?[0-9]+ SUPER_PLUS \xe2\x81\xba SUPER_MINUS \xe2\x81\xbb SUPER_0 \xe2\x81\xb0 SUPER_1 \xc2\xb9 SUPER_2 \xc2\xb2 SUPER_3 \xc2\xb3 SUPER_4 \xe2\x81\xb4 SUPER_5 \xe2\x81\xb5 SUPER_6 \xe2\x81\xb6 SUPER_7 \xe2\x81\xb7 SUPER_8 \xe2\x81\xb8 SUPER_9 \xe2\x81\xb9 %% {DOUBLE_R} { yyunitlval.DOUBLE = atof(yytext); return DOUBLE; } [Ii][Nn][Ff]([Ii][Nn][Ii][Tt][Yy])? { yyunitlval.DOUBLE = INFINITY; return DOUBLE; } [Nn][Aa][Nn] { yyunitlval.DOUBLE = NAN; return DOUBLE; } sqrt { yyunitlval.FUNCTION = FUNCTION_SQRT; return FUNCTION; } exp { yyunitlval.FUNCTION = FUNCTION_EXP; return FUNCTION; } ln { yyunitlval.FUNCTION = FUNCTION_LN; return FUNCTION; } log2 { yyunitlval.FUNCTION = FUNCTION_LOG2; return FUNCTION; } asin { yyunitlval.FUNCTION = FUNCTION_ASIN; return FUNCTION; } tan { yyunitlval.FUNCTION = FUNCTION_TAN; return FUNCTION; } {TIME_R} { /* hh:mm:ss[.sss] */ char *colon; yyunitlval.DOUBLE = TIME_HOUR * atoi(yytext); /* hh */ colon = strchr(yytext, ':'); yyunitlval.DOUBLE += TIME_MINUTE * atoi(colon + 1); /* mm */ colon = strchr(colon + 1, ':'); yyunitlval.DOUBLE += atof(colon + 1); /* ss[.sss] */ return DOUBLE; } {UNIT_R} { unit_names_t *name; int ret; Oid argtypes[1]; Datum values[1]; size_t yytext_len; /* Check if it's a predefined or previously seen unit */ name = hash_search(unit_names, yytext, HASH_FIND, NULL); if (name) { elog(DEBUG1, "unit %s found in unit_names hash table", name->name); yyunitlval.UNIT_SHIFT = name->unit_shift; return UNIT_SHIFT; } SPI_connect(); argtypes[0] = TEXTOID; values[0] = CStringGetTextDatum(yytext); /* look up unit definition without prefix first */ ret = SPI_execute_with_args("SELECT unit, shift " "FROM unit_units WHERE " "name = $1", 1, /* nargs */ argtypes, values, NULL, /* nulls */ true, /* read only */ 0); /* limit */ if (ret != SPI_OK_SELECT) elog(ERROR, "internal error determining definition of unit \"%s\"", yytext); if (SPI_processed == 1) /* found definition */ { Unit *unitp; Datum shift; bool is_null; unitp = (Unit *) DatumGetPointer(SPI_getbinval(SPI_tuptable->vals[0], SPI_tuptable->tupdesc, 1, &is_null)); if (is_null) elog(ERROR, "unit \"%s\" definition is NULL", yytext); yyunitlval.UNIT_SHIFT.unit = *unitp; shift = SPI_getbinval(SPI_tuptable->vals[0], SPI_tuptable->tupdesc, 2, &is_null); yyunitlval.UNIT_SHIFT.shift = is_null ? 0.0 : DatumGetFloat8(shift); elog(DEBUG1, "unit %s (value %g)", SPI_getvalue(SPI_tuptable->vals[0], SPI_tuptable->tupdesc, 1), unitp->value); goto found; } /* look up definition with prefix */ ret = SPI_execute_with_args("SELECT prefix, factor, name, unit, shift " "FROM unit_prefixes CROSS JOIN unit_units WHERE " "prefix||name = $1 AND " "$1 LIKE prefix||'%' AND " "$1 LIKE '%'||name " "ORDER BY prefix", 1, /* nargs */ argtypes, values, NULL, /* nulls */ true, /* read only */ 0); /* limit */ if (ret != SPI_OK_SELECT) elog(ERROR, "internal error determining definition of unit \"%s\"", yytext); if (SPI_processed > 2) { long processed = SPI_processed; /* SPI_processed was uint32 before 9.6 */ ereport(ERROR, (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("unit \"%s\" is ambiguous, %lu prefix/name combinations found", yytext, processed))); } if (SPI_processed == 2) ereport(ERROR, (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("unit \"%s\" is ambiguous, \"%s-%s\" vs. \"%s-%s\"", yytext, SPI_getvalue(SPI_tuptable->vals[0], SPI_tuptable->tupdesc, 1), SPI_getvalue(SPI_tuptable->vals[0], SPI_tuptable->tupdesc, 3), SPI_getvalue(SPI_tuptable->vals[1], SPI_tuptable->tupdesc, 1), SPI_getvalue(SPI_tuptable->vals[1], SPI_tuptable->tupdesc, 3)))); if (SPI_processed == 1) /* found definition */ { double factor; Unit *unitp; Datum shift; bool is_null; factor = DatumGetFloat8(SPI_getbinval(SPI_tuptable->vals[0], SPI_tuptable->tupdesc, 2, &is_null)); /* we discard is_null here */ unitp = (Unit *) DatumGetPointer(SPI_getbinval(SPI_tuptable->vals[0], SPI_tuptable->tupdesc, 4, &is_null)); if (is_null) elog(ERROR, "unit \"%s\" definition is NULL", yytext); yyunitlval.UNIT_SHIFT.unit = *unitp; yyunitlval.UNIT_SHIFT.unit.value *= factor; shift = SPI_getbinval(SPI_tuptable->vals[0], SPI_tuptable->tupdesc, 5, &is_null); yyunitlval.UNIT_SHIFT.shift = is_null ? 0.0 : DatumGetFloat8(shift); goto found; } /* if unit is long enough, look up unit definition with plural 's' removed */ yytext_len = strlen(yytext); if (yytext_len >= MIN_PLURAL_LENGTH && yytext[yytext_len - 1] == 's') { ret = SPI_execute_with_args("SELECT unit, shift " "FROM unit_units WHERE " "name = substring($1 for length($1) - 1)", 1, /* nargs */ argtypes, values, NULL, /* nulls */ true, /* read only */ 0); /* limit */ if (ret != SPI_OK_SELECT) elog(ERROR, "internal error determining definition of unit \"%s\"", yytext); if (SPI_processed == 1) /* found definition */ { Unit *unitp; Datum shift; bool is_null; unitp = (Unit *) DatumGetPointer(SPI_getbinval(SPI_tuptable->vals[0], SPI_tuptable->tupdesc, 1, &is_null)); if (is_null) elog(ERROR, "unit \"%s\" definition is NULL", yytext); yyunitlval.UNIT_SHIFT.unit = *unitp; shift = SPI_getbinval(SPI_tuptable->vals[0], SPI_tuptable->tupdesc, 2, &is_null); yyunitlval.UNIT_SHIFT.shift = is_null ? 0.0 : DatumGetFloat8(shift); elog(DEBUG1, "unit %s (value %g)", SPI_getvalue(SPI_tuptable->vals[0], SPI_tuptable->tupdesc, 1), unitp->value); goto found; } /* look up definition with prefix */ ret = SPI_execute_with_args("SELECT prefix, factor, name, unit, shift " "FROM unit_prefixes CROSS JOIN unit_units WHERE " "prefix||name = substring($1 for length($1) - 1) AND " "substring($1 for length($1) - 1) LIKE prefix||'%' AND " "substring($1 for length($1) - 1) LIKE '%'||name " "ORDER BY prefix", 1, /* nargs */ argtypes, values, NULL, /* nulls */ true, /* read only */ 0); /* limit */ if (ret != SPI_OK_SELECT) elog(ERROR, "internal error determining definition of unit \"%s\"", yytext); if (SPI_processed > 2) { long processed = SPI_processed; /* SPI_processed was uint32 before 9.6 */ ereport(ERROR, (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("unit \"%s\" is ambiguous, %lu prefix/name combinations found", yytext, processed))); } if (SPI_processed == 2) ereport(ERROR, (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("unit \"%s\" is ambiguous, \"%s-%s\" vs. \"%s-%s\"", yytext, SPI_getvalue(SPI_tuptable->vals[0], SPI_tuptable->tupdesc, 1), SPI_getvalue(SPI_tuptable->vals[0], SPI_tuptable->tupdesc, 3), SPI_getvalue(SPI_tuptable->vals[1], SPI_tuptable->tupdesc, 1), SPI_getvalue(SPI_tuptable->vals[1], SPI_tuptable->tupdesc, 3)))); if (SPI_processed == 1) /* found definition */ { double factor; Unit *unitp; Datum shift; bool is_null; factor = DatumGetFloat8(SPI_getbinval(SPI_tuptable->vals[0], SPI_tuptable->tupdesc, 2, &is_null)); /* we discard is_null here */ unitp = (Unit *) DatumGetPointer(SPI_getbinval(SPI_tuptable->vals[0], SPI_tuptable->tupdesc, 4, &is_null)); if (is_null) elog(ERROR, "unit \"%s\" definition is NULL", yytext); yyunitlval.UNIT_SHIFT.unit = *unitp; yyunitlval.UNIT_SHIFT.unit.value *= factor; shift = SPI_getbinval(SPI_tuptable->vals[0], SPI_tuptable->tupdesc, 5, &is_null); yyunitlval.UNIT_SHIFT.shift = is_null ? 0.0 : DatumGetFloat8(shift); goto found; } } /* nothing found, error out */ ereport(ERROR, (errcode(ERRCODE_INVALID_TEXT_REPRESENTATION), errmsg("unit \"%s\" is not known", yytext))); found: SPI_finish(); /* store computed unit in hash table */ name = hash_search(unit_names, yytext, HASH_ENTER, NULL); strlcpy(name->name, yytext, UNIT_NAME_LENGTH); name->unit_shift = yyunitlval.UNIT_SHIFT; return UNIT_SHIFT; } {EXP_R} { yyunitlval.EXPONENT = atoi(yytext+1); return EXPONENT; } {SUPER_PLUS} { yyunitlval.SUPER_SIGN = 1; return SUPER_SIGN; } {SUPER_MINUS} { yyunitlval.SUPER_SIGN = -1; return SUPER_SIGN; } {SUPER_0} { yyunitlval.SUPER = 0; return SUPER; } {SUPER_1} { yyunitlval.SUPER = 1; return SUPER; } {SUPER_2} { yyunitlval.SUPER = 2; return SUPER; } {SUPER_3} { yyunitlval.SUPER = 3; return SUPER; } {SUPER_4} { yyunitlval.SUPER = 4; return SUPER; } {SUPER_5} { yyunitlval.SUPER = 5; return SUPER; } {SUPER_6} { yyunitlval.SUPER = 6; return SUPER; } {SUPER_7} { yyunitlval.SUPER = 7; return SUPER; } {SUPER_8} { yyunitlval.SUPER = 8; return SUPER; } {SUPER_9} { yyunitlval.SUPER = 9; return SUPER; } \+ return '+'; - return '-'; \/ return '/'; \* return '*'; \| return '|'; \( return '('; \) return ')'; [ \t\n]* /* eat whitespace */ . return ERR; postgresql-unit-7.8/unitparse.tab.c000066400000000000000000001612151450213077700175070ustar00rootroot00000000000000/* A Bison parser, made by GNU Bison 3.8.2. */ /* Bison implementation for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* C LALR(1) parser skeleton written by Richard Stallman, by simplifying the original so-called "semantic" parser. */ /* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, especially those whose name start with YY_ or yy_. They are private implementation details that can be changed or removed. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local variables, as they might otherwise be expanded by user macros. There are some unavoidable exceptions within include files to define necessary library symbols; they are noted "INFRINGES ON USER NAME SPACE" below. */ /* Identify Bison output, and Bison version. */ #define YYBISON 30802 /* Bison version string. */ #define YYBISON_VERSION "3.8.2" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" /* Pure parsers. */ #define YYPURE 0 /* Push parsers. */ #define YYPUSH 0 /* Pull parsers. */ #define YYPULL 1 /* Substitute the type names. */ #define YYSTYPE YYUNITSTYPE /* Substitute the variable and function names. */ #define yyparse yyunitparse #define yylex yyunitlex #define yyerror yyuniterror #define yydebug yyunitdebug #define yynerrs yyunitnerrs #define yylval yyunitlval #define yychar yyunitchar /* First part of user prologue. */ #line 15 "unitparse.y" #include /* bzero */ #include /* pow */ #include "unit.h" /* flex/bison prototypes */ int yylex (void); struct yyunit_buffer_state *yyunit_scan_string(char *str); void yyunit_delete_buffer(struct yyunit_buffer_state *buffer); void yyerror (char const *s); static UnitShift *unit_parse_result; /* parsing result gets stored here */ #line 93 "unitparse.tab.c" # ifndef YY_CAST # ifdef __cplusplus # define YY_CAST(Type, Val) static_cast (Val) # define YY_REINTERPRET_CAST(Type, Val) reinterpret_cast (Val) # else # define YY_CAST(Type, Val) ((Type) (Val)) # define YY_REINTERPRET_CAST(Type, Val) ((Type) (Val)) # endif # endif # ifndef YY_NULLPTR # if defined __cplusplus # if 201103L <= __cplusplus # define YY_NULLPTR nullptr # else # define YY_NULLPTR 0 # endif # else # define YY_NULLPTR ((void*)0) # endif # endif #include "unitparse.tab.h" /* Symbol kind. */ enum yysymbol_kind_t { YYSYMBOL_YYEMPTY = -2, YYSYMBOL_YYEOF = 0, /* "end of file" */ YYSYMBOL_YYerror = 1, /* error */ YYSYMBOL_YYUNDEF = 2, /* "invalid token" */ YYSYMBOL_DOUBLE = 3, /* DOUBLE */ YYSYMBOL_UNIT_SHIFT = 4, /* UNIT_SHIFT */ YYSYMBOL_EXPONENT = 5, /* EXPONENT */ YYSYMBOL_SUPER_SIGN = 6, /* SUPER_SIGN */ YYSYMBOL_SUPER = 7, /* SUPER */ YYSYMBOL_FUNCTION = 8, /* FUNCTION */ YYSYMBOL_ERR = 9, /* ERR */ YYSYMBOL_10_ = 10, /* '+' */ YYSYMBOL_11_ = 11, /* '-' */ YYSYMBOL_12_ = 12, /* '/' */ YYSYMBOL_13_ = 13, /* '*' */ YYSYMBOL_UMINUS = 14, /* UMINUS */ YYSYMBOL_15_ = 15, /* '(' */ YYSYMBOL_16_ = 16, /* ')' */ YYSYMBOL_17_ = 17, /* '|' */ YYSYMBOL_YYACCEPT = 18, /* $accept */ YYSYMBOL_input = 19, /* input */ YYSYMBOL_expr = 20, /* expr */ YYSYMBOL_simple_expr = 21, /* simple_expr */ YYSYMBOL_number = 22, /* number */ YYSYMBOL_exponent = 23, /* exponent */ YYSYMBOL_super = 24 /* super */ }; typedef enum yysymbol_kind_t yysymbol_kind_t; #ifdef short # undef short #endif /* On compilers that do not define __PTRDIFF_MAX__ etc., make sure and (if available) are included so that the code can choose integer types of a good width. */ #ifndef __PTRDIFF_MAX__ # include /* INFRINGES ON USER NAME SPACE */ # if defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ # include /* INFRINGES ON USER NAME SPACE */ # define YY_STDINT_H # endif #endif /* Narrow types that promote to a signed type and that can represent a signed or unsigned integer of at least N bits. In tables they can save space and decrease cache pressure. Promoting to a signed type helps avoid bugs in integer arithmetic. */ #ifdef __INT_LEAST8_MAX__ typedef __INT_LEAST8_TYPE__ yytype_int8; #elif defined YY_STDINT_H typedef int_least8_t yytype_int8; #else typedef signed char yytype_int8; #endif #ifdef __INT_LEAST16_MAX__ typedef __INT_LEAST16_TYPE__ yytype_int16; #elif defined YY_STDINT_H typedef int_least16_t yytype_int16; #else typedef short yytype_int16; #endif /* Work around bug in HP-UX 11.23, which defines these macros incorrectly for preprocessor constants. This workaround can likely be removed in 2023, as HPE has promised support for HP-UX 11.23 (aka HP-UX 11i v2) only through the end of 2022; see Table 2 of . */ #ifdef __hpux # undef UINT_LEAST8_MAX # undef UINT_LEAST16_MAX # define UINT_LEAST8_MAX 255 # define UINT_LEAST16_MAX 65535 #endif #if defined __UINT_LEAST8_MAX__ && __UINT_LEAST8_MAX__ <= __INT_MAX__ typedef __UINT_LEAST8_TYPE__ yytype_uint8; #elif (!defined __UINT_LEAST8_MAX__ && defined YY_STDINT_H \ && UINT_LEAST8_MAX <= INT_MAX) typedef uint_least8_t yytype_uint8; #elif !defined __UINT_LEAST8_MAX__ && UCHAR_MAX <= INT_MAX typedef unsigned char yytype_uint8; #else typedef short yytype_uint8; #endif #if defined __UINT_LEAST16_MAX__ && __UINT_LEAST16_MAX__ <= __INT_MAX__ typedef __UINT_LEAST16_TYPE__ yytype_uint16; #elif (!defined __UINT_LEAST16_MAX__ && defined YY_STDINT_H \ && UINT_LEAST16_MAX <= INT_MAX) typedef uint_least16_t yytype_uint16; #elif !defined __UINT_LEAST16_MAX__ && USHRT_MAX <= INT_MAX typedef unsigned short yytype_uint16; #else typedef int yytype_uint16; #endif #ifndef YYPTRDIFF_T # if defined __PTRDIFF_TYPE__ && defined __PTRDIFF_MAX__ # define YYPTRDIFF_T __PTRDIFF_TYPE__ # define YYPTRDIFF_MAXIMUM __PTRDIFF_MAX__ # elif defined PTRDIFF_MAX # ifndef ptrdiff_t # include /* INFRINGES ON USER NAME SPACE */ # endif # define YYPTRDIFF_T ptrdiff_t # define YYPTRDIFF_MAXIMUM PTRDIFF_MAX # else # define YYPTRDIFF_T long # define YYPTRDIFF_MAXIMUM LONG_MAX # endif #endif #ifndef YYSIZE_T # ifdef __SIZE_TYPE__ # define YYSIZE_T __SIZE_TYPE__ # elif defined size_t # define YYSIZE_T size_t # elif defined __STDC_VERSION__ && 199901 <= __STDC_VERSION__ # include /* INFRINGES ON USER NAME SPACE */ # define YYSIZE_T size_t # else # define YYSIZE_T unsigned # endif #endif #define YYSIZE_MAXIMUM \ YY_CAST (YYPTRDIFF_T, \ (YYPTRDIFF_MAXIMUM < YY_CAST (YYSIZE_T, -1) \ ? YYPTRDIFF_MAXIMUM \ : YY_CAST (YYSIZE_T, -1))) #define YYSIZEOF(X) YY_CAST (YYPTRDIFF_T, sizeof (X)) /* Stored state numbers (used for stacks). */ typedef yytype_int8 yy_state_t; /* State numbers in computations. */ typedef int yy_state_fast_t; #ifndef YY_ # if defined YYENABLE_NLS && YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ # define YY_(Msgid) dgettext ("bison-runtime", Msgid) # endif # endif # ifndef YY_ # define YY_(Msgid) Msgid # endif #endif #ifndef YY_ATTRIBUTE_PURE # if defined __GNUC__ && 2 < __GNUC__ + (96 <= __GNUC_MINOR__) # define YY_ATTRIBUTE_PURE __attribute__ ((__pure__)) # else # define YY_ATTRIBUTE_PURE # endif #endif #ifndef YY_ATTRIBUTE_UNUSED # if defined __GNUC__ && 2 < __GNUC__ + (7 <= __GNUC_MINOR__) # define YY_ATTRIBUTE_UNUSED __attribute__ ((__unused__)) # else # define YY_ATTRIBUTE_UNUSED # endif #endif /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ # define YY_USE(E) ((void) (E)) #else # define YY_USE(E) /* empty */ #endif /* Suppress an incorrect diagnostic about yylval being uninitialized. */ #if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__ # if __GNUC__ * 100 + __GNUC_MINOR__ < 407 # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") # else # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"") \ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"") # endif # define YY_IGNORE_MAYBE_UNINITIALIZED_END \ _Pragma ("GCC diagnostic pop") #else # define YY_INITIAL_VALUE(Value) Value #endif #ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN # define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN # define YY_IGNORE_MAYBE_UNINITIALIZED_END #endif #ifndef YY_INITIAL_VALUE # define YY_INITIAL_VALUE(Value) /* Nothing. */ #endif #if defined __cplusplus && defined __GNUC__ && ! defined __ICC && 6 <= __GNUC__ # define YY_IGNORE_USELESS_CAST_BEGIN \ _Pragma ("GCC diagnostic push") \ _Pragma ("GCC diagnostic ignored \"-Wuseless-cast\"") # define YY_IGNORE_USELESS_CAST_END \ _Pragma ("GCC diagnostic pop") #endif #ifndef YY_IGNORE_USELESS_CAST_BEGIN # define YY_IGNORE_USELESS_CAST_BEGIN # define YY_IGNORE_USELESS_CAST_END #endif #define YY_ASSERT(E) ((void) (0 && (E))) #if 1 /* The parser invokes alloca or malloc; define the necessary symbols. */ # ifdef YYSTACK_USE_ALLOCA # if YYSTACK_USE_ALLOCA # ifdef __GNUC__ # define YYSTACK_ALLOC __builtin_alloca # elif defined __BUILTIN_VA_ARG_INCR # include /* INFRINGES ON USER NAME SPACE */ # elif defined _AIX # define YYSTACK_ALLOC __alloca # elif defined _MSC_VER # include /* INFRINGES ON USER NAME SPACE */ # define alloca _alloca # else # define YYSTACK_ALLOC alloca # if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS # include /* INFRINGES ON USER NAME SPACE */ /* Use EXIT_SUCCESS as a witness for stdlib.h. */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif # endif # endif # endif # endif # ifdef YYSTACK_ALLOC /* Pacify GCC's 'empty if-body' warning. */ # define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) # ifndef YYSTACK_ALLOC_MAXIMUM /* The OS might guarantee only one guard page at the bottom of the stack, and a page size can be as small as 4096 bytes. So we cannot safely invoke alloca (N) if N exceeds 4096. Use a slightly smaller number to allow for a few compiler-allocated temporary stack slots. */ # define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ # endif # else # define YYSTACK_ALLOC YYMALLOC # define YYSTACK_FREE YYFREE # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif # if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ # ifndef EXIT_SUCCESS # define EXIT_SUCCESS 0 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc # if ! defined malloc && ! defined EXIT_SUCCESS void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif # endif # ifndef YYFREE # define YYFREE free # if ! defined free && ! defined EXIT_SUCCESS void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif # endif # endif #endif /* 1 */ #if (! defined yyoverflow \ && (! defined __cplusplus \ || (defined YYUNITSTYPE_IS_TRIVIAL && YYUNITSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { yy_state_t yyss_alloc; YYSTYPE yyvs_alloc; }; /* The size of the maximum gap between one aligned stack and the next. */ # define YYSTACK_GAP_MAXIMUM (YYSIZEOF (union yyalloc) - 1) /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ ((N) * (YYSIZEOF (yy_state_t) + YYSIZEOF (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) # define YYCOPY_NEEDED 1 /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of elements in the stack, and YYPTR gives the new location of the stack. Advance YYPTR to a properly aligned location for the next stack. */ # define YYSTACK_RELOCATE(Stack_alloc, Stack) \ do \ { \ YYPTRDIFF_T yynewbytes; \ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \ Stack = &yyptr->Stack_alloc; \ yynewbytes = yystacksize * YYSIZEOF (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / YYSIZEOF (*yyptr); \ } \ while (0) #endif #if defined YYCOPY_NEEDED && YYCOPY_NEEDED /* Copy COUNT objects from SRC to DST. The source and destination do not overlap. */ # ifndef YYCOPY # if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(Dst, Src, Count) \ __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src))) # else # define YYCOPY(Dst, Src, Count) \ do \ { \ YYPTRDIFF_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (Dst)[yyi] = (Src)[yyi]; \ } \ while (0) # endif # endif #endif /* !YYCOPY_NEEDED */ /* YYFINAL -- State number of the termination state. */ #define YYFINAL 18 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 111 /* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 18 /* YYNNTS -- Number of nonterminals. */ #define YYNNTS 7 /* YYNRULES -- Number of rules. */ #define YYNRULES 23 /* YYNSTATES -- Number of states. */ #define YYNSTATES 41 /* YYMAXUTOK -- Last valid token kind. */ #define YYMAXUTOK 265 /* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM as returned by yylex, with out-of-bounds checking. */ #define YYTRANSLATE(YYX) \ (0 <= (YYX) && (YYX) <= YYMAXUTOK \ ? YY_CAST (yysymbol_kind_t, yytranslate[YYX]) \ : YYSYMBOL_YYUNDEF) /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM as returned by yylex. */ static const yytype_int8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 15, 16, 13, 10, 2, 11, 2, 12, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 17, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 14 }; #if YYUNITDEBUG /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */ static const yytype_uint8 yyrline[] = { 0, 50, 50, 56, 59, 63, 68, 79, 83, 87, 93, 97, 101, 109, 114, 115, 137, 143, 144, 149, 150, 151, 155, 156 }; #endif /** Accessing symbol of state STATE. */ #define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State]) #if 1 /* The user-facing name of the symbol whose (internal) number is YYSYMBOL. No bounds checking. */ static const char *yysymbol_name (yysymbol_kind_t yysymbol) YY_ATTRIBUTE_UNUSED; /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "\"end of file\"", "error", "\"invalid token\"", "DOUBLE", "UNIT_SHIFT", "EXPONENT", "SUPER_SIGN", "SUPER", "FUNCTION", "ERR", "'+'", "'-'", "'/'", "'*'", "UMINUS", "'('", "')'", "'|'", "$accept", "input", "expr", "simple_expr", "number", "exponent", "super", YY_NULLPTR }; static const char * yysymbol_name (yysymbol_kind_t yysymbol) { return yytname[yysymbol]; } #endif #define YYPACT_NINF (-18) #define yypact_value_is_default(Yyn) \ ((Yyn) == YYPACT_NINF) #define YYTABLE_NINF (-1) #define yytable_value_is_error(Yyn) \ 0 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ static const yytype_int8 yypact[] = { 6, -12, -18, -7, 96, 96, 6, 6, 11, 51, -18, -18, 9, 6, -18, -18, 77, 23, -18, -18, 8, 8, 6, 6, 6, 6, 90, -18, -18, -18, 37, -18, -18, -18, 64, -18, 64, -18, 77, 90, -18 }; /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM. Performed when YYTABLE does not specify something else to do. Zero means the default is an error. */ static const yytype_int8 yydefact[] = { 0, 17, 14, 0, 0, 0, 0, 0, 0, 2, 3, 13, 0, 0, 4, 5, 12, 0, 1, 19, 0, 22, 0, 0, 0, 0, 9, 6, 21, 18, 0, 16, 20, 23, 7, 3, 8, 3, 11, 10, 15 }; /* YYPGOTO[NTERM-NUM]. */ static const yytype_int8 yypgoto[] = { -18, -18, 0, -3, -18, -18, -17 }; /* YYDEFGOTO[NTERM-NUM]. */ static const yytype_int8 yydefgoto[] = { 0, 8, 26, 10, 11, 27, 28 }; /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule whose number is the opposite. If YYTABLE_NINF, syntax error. */ static const yytype_int8 yytable[] = { 9, 14, 15, 32, 33, 12, 16, 17, 13, 1, 2, 18, 29, 30, 3, 21, 4, 5, 6, 35, 37, 7, 34, 36, 38, 39, 1, 2, 19, 20, 21, 3, 0, 22, 23, 24, 25, 0, 7, 31, 1, 2, 19, 20, 21, 3, 0, 22, 23, 24, 25, 0, 7, 40, 1, 2, 19, 20, 21, 3, 0, 22, 23, 24, 25, 0, 7, 1, 2, 19, 20, 21, 3, 0, 0, 0, 24, 25, 0, 7, 1, 2, 19, 20, 21, 3, 0, 0, 0, 0, 25, 0, 7, 1, 2, 19, 20, 21, 3, 1, 2, 0, 0, 0, 3, 7, 0, 0, 0, 0, 0, 7 }; static const yytype_int8 yycheck[] = { 0, 4, 5, 20, 21, 17, 6, 7, 15, 3, 4, 0, 3, 13, 8, 7, 10, 11, 12, 22, 23, 15, 22, 23, 24, 25, 3, 4, 5, 6, 7, 8, -1, 10, 11, 12, 13, -1, 15, 16, 3, 4, 5, 6, 7, 8, -1, 10, 11, 12, 13, -1, 15, 16, 3, 4, 5, 6, 7, 8, -1, 10, 11, 12, 13, -1, 15, 3, 4, 5, 6, 7, 8, -1, -1, -1, 12, 13, -1, 15, 3, 4, 5, 6, 7, 8, -1, -1, -1, -1, 13, -1, 15, 3, 4, 5, 6, 7, 8, 3, 4, -1, -1, -1, 8, 15, -1, -1, -1, -1, -1, 15 }; /* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of state STATE-NUM. */ static const yytype_int8 yystos[] = { 0, 3, 4, 8, 10, 11, 12, 15, 19, 20, 21, 22, 17, 15, 21, 21, 20, 20, 0, 5, 6, 7, 10, 11, 12, 13, 20, 23, 24, 3, 20, 16, 24, 24, 20, 21, 20, 21, 20, 20, 16 }; /* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM. */ static const yytype_int8 yyr1[] = { 0, 18, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 23, 23, 23, 24, 24 }; /* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM. */ static const yytype_int8 yyr2[] = { 0, 2, 1, 1, 2, 2, 2, 3, 3, 2, 3, 3, 2, 1, 1, 4, 3, 1, 3, 1, 2, 1, 1, 2 }; enum { YYENOMEM = -2 }; #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYUNITEMPTY) #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab #define YYERROR goto yyerrorlab #define YYNOMEM goto yyexhaustedlab #define YYRECOVERING() (!!yyerrstatus) #define YYBACKUP(Token, Value) \ do \ if (yychar == YYUNITEMPTY) \ { \ yychar = (Token); \ yylval = (Value); \ YYPOPSTACK (yylen); \ yystate = *yyssp; \ goto yybackup; \ } \ else \ { \ yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (0) /* Backward compatibility with an undocumented macro. Use YYUNITerror or YYUNITUNDEF. */ #define YYERRCODE YYUNITUNDEF /* Enable debugging if requested. */ #if YYUNITDEBUG # ifndef YYFPRINTF # include /* INFRINGES ON USER NAME SPACE */ # define YYFPRINTF fprintf # endif # define YYDPRINTF(Args) \ do { \ if (yydebug) \ YYFPRINTF Args; \ } while (0) # define YY_SYMBOL_PRINT(Title, Kind, Value, Location) \ do { \ if (yydebug) \ { \ YYFPRINTF (stderr, "%s ", Title); \ yy_symbol_print (stderr, \ Kind, Value); \ YYFPRINTF (stderr, "\n"); \ } \ } while (0) /*-----------------------------------. | Print this symbol's value on YYO. | `-----------------------------------*/ static void yy_symbol_value_print (FILE *yyo, yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep) { FILE *yyoutput = yyo; YY_USE (yyoutput); if (!yyvaluep) return; YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN YY_USE (yykind); YY_IGNORE_MAYBE_UNINITIALIZED_END } /*---------------------------. | Print this symbol on YYO. | `---------------------------*/ static void yy_symbol_print (FILE *yyo, yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep) { YYFPRINTF (yyo, "%s %s (", yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind)); yy_symbol_value_print (yyo, yykind, yyvaluep); YYFPRINTF (yyo, ")"); } /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | | TOP (included). | `------------------------------------------------------------------*/ static void yy_stack_print (yy_state_t *yybottom, yy_state_t *yytop) { YYFPRINTF (stderr, "Stack now"); for (; yybottom <= yytop; yybottom++) { int yybot = *yybottom; YYFPRINTF (stderr, " %d", yybot); } YYFPRINTF (stderr, "\n"); } # define YY_STACK_PRINT(Bottom, Top) \ do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ } while (0) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ static void yy_reduce_print (yy_state_t *yyssp, YYSTYPE *yyvsp, int yyrule) { int yylno = yyrline[yyrule]; int yynrhs = yyr2[yyrule]; int yyi; YYFPRINTF (stderr, "Reducing stack by rule %d (line %d):\n", yyrule - 1, yylno); /* The symbols being reduced. */ for (yyi = 0; yyi < yynrhs; yyi++) { YYFPRINTF (stderr, " $%d = ", yyi + 1); yy_symbol_print (stderr, YY_ACCESSING_SYMBOL (+yyssp[yyi + 1 - yynrhs]), &yyvsp[(yyi + 1) - (yynrhs)]); YYFPRINTF (stderr, "\n"); } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ yy_reduce_print (yyssp, yyvsp, Rule); \ } while (0) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYUNITDEBUG */ # define YYDPRINTF(Args) ((void) 0) # define YY_SYMBOL_PRINT(Title, Kind, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYUNITDEBUG */ /* YYINITDEPTH -- initial size of the parser's stacks. */ #ifndef YYINITDEPTH # define YYINITDEPTH 200 #endif /* YYMAXDEPTH -- maximum size the stacks can grow to (effective only if the built-in stack extension method is used). Do not make this value too large; the results are undefined if YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif /* Context of a parse error. */ typedef struct { yy_state_t *yyssp; yysymbol_kind_t yytoken; } yypcontext_t; /* Put in YYARG at most YYARGN of the expected tokens given the current YYCTX, and return the number of tokens stored in YYARG. If YYARG is null, return the number of expected tokens (guaranteed to be less than YYNTOKENS). Return YYENOMEM on memory exhaustion. Return 0 if there are more than YYARGN expected tokens, yet fill YYARG up to YYARGN. */ static int yypcontext_expected_tokens (const yypcontext_t *yyctx, yysymbol_kind_t yyarg[], int yyargn) { /* Actual size of YYARG. */ int yycount = 0; int yyn = yypact[+*yyctx->yyssp]; if (!yypact_value_is_default (yyn)) { /* Start YYX at -YYN if negative to avoid negative indexes in YYCHECK. In other words, skip the first -YYN actions for this state because they are default actions. */ int yyxbegin = yyn < 0 ? -yyn : 0; /* Stay within bounds of both yycheck and yytname. */ int yychecklim = YYLAST - yyn + 1; int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; int yyx; for (yyx = yyxbegin; yyx < yyxend; ++yyx) if (yycheck[yyx + yyn] == yyx && yyx != YYSYMBOL_YYerror && !yytable_value_is_error (yytable[yyx + yyn])) { if (!yyarg) ++yycount; else if (yycount == yyargn) return 0; else yyarg[yycount++] = YY_CAST (yysymbol_kind_t, yyx); } } if (yyarg && yycount == 0 && 0 < yyargn) yyarg[0] = YYSYMBOL_YYEMPTY; return yycount; } #ifndef yystrlen # if defined __GLIBC__ && defined _STRING_H # define yystrlen(S) (YY_CAST (YYPTRDIFF_T, strlen (S))) # else /* Return the length of YYSTR. */ static YYPTRDIFF_T yystrlen (const char *yystr) { YYPTRDIFF_T yylen; for (yylen = 0; yystr[yylen]; yylen++) continue; return yylen; } # endif #endif #ifndef yystpcpy # if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ static char * yystpcpy (char *yydest, const char *yysrc) { char *yyd = yydest; const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; return yyd - 1; } # endif #endif #ifndef yytnamerr /* Copy to YYRES the contents of YYSTR after stripping away unnecessary quotes and backslashes, so that it's suitable for yyerror. The heuristic is that double-quoting is unnecessary unless the string contains an apostrophe, a comma, or backslash (other than backslash-backslash). YYSTR is taken from yytname. If YYRES is null, do not copy; instead, return the length of what the result would have been. */ static YYPTRDIFF_T yytnamerr (char *yyres, const char *yystr) { if (*yystr == '"') { YYPTRDIFF_T yyn = 0; char const *yyp = yystr; for (;;) switch (*++yyp) { case '\'': case ',': goto do_not_strip_quotes; case '\\': if (*++yyp != '\\') goto do_not_strip_quotes; else goto append; append: default: if (yyres) yyres[yyn] = *yyp; yyn++; break; case '"': if (yyres) yyres[yyn] = '\0'; return yyn; } do_not_strip_quotes: ; } if (yyres) return yystpcpy (yyres, yystr) - yyres; else return yystrlen (yystr); } #endif static int yy_syntax_error_arguments (const yypcontext_t *yyctx, yysymbol_kind_t yyarg[], int yyargn) { /* Actual size of YYARG. */ int yycount = 0; /* There are many possibilities here to consider: - If this state is a consistent state with a default action, then the only way this function was invoked is if the default action is an error action. In that case, don't check for expected tokens because there are none. - The only way there can be no lookahead present (in yychar) is if this state is a consistent state with a default action. Thus, detecting the absence of a lookahead is sufficient to determine that there is no unexpected or expected token to report. In that case, just report a simple "syntax error". - Don't assume there isn't a lookahead just because this state is a consistent state with a default action. There might have been a previous inconsistent state, consistent state with a non-default action, or user semantic action that manipulated yychar. - Of course, the expected token list depends on states to have correct lookahead information, and it depends on the parser not to perform extra reductions after fetching a lookahead from the scanner and before detecting a syntax error. Thus, state merging (from LALR or IELR) and default reductions corrupt the expected token list. However, the list is correct for canonical LR with one exception: it will still contain any token that will not be accepted due to an error action in a later state. */ if (yyctx->yytoken != YYSYMBOL_YYEMPTY) { int yyn; if (yyarg) yyarg[yycount] = yyctx->yytoken; ++yycount; yyn = yypcontext_expected_tokens (yyctx, yyarg ? yyarg + 1 : yyarg, yyargn - 1); if (yyn == YYENOMEM) return YYENOMEM; else yycount += yyn; } return yycount; } /* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message about the unexpected token YYTOKEN for the state stack whose top is YYSSP. Return 0 if *YYMSG was successfully written. Return -1 if *YYMSG is not large enough to hold the message. In that case, also set *YYMSG_ALLOC to the required number of bytes. Return YYENOMEM if the required number of bytes is too large to store. */ static int yysyntax_error (YYPTRDIFF_T *yymsg_alloc, char **yymsg, const yypcontext_t *yyctx) { enum { YYARGS_MAX = 5 }; /* Internationalized format string. */ const char *yyformat = YY_NULLPTR; /* Arguments of yyformat: reported tokens (one for the "unexpected", one per "expected"). */ yysymbol_kind_t yyarg[YYARGS_MAX]; /* Cumulated lengths of YYARG. */ YYPTRDIFF_T yysize = 0; /* Actual size of YYARG. */ int yycount = yy_syntax_error_arguments (yyctx, yyarg, YYARGS_MAX); if (yycount == YYENOMEM) return YYENOMEM; switch (yycount) { #define YYCASE_(N, S) \ case N: \ yyformat = S; \ break default: /* Avoid compiler warnings. */ YYCASE_(0, YY_("syntax error")); YYCASE_(1, YY_("syntax error, unexpected %s")); YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); #undef YYCASE_ } /* Compute error message size. Don't count the "%s"s, but reserve room for the terminator. */ yysize = yystrlen (yyformat) - 2 * yycount + 1; { int yyi; for (yyi = 0; yyi < yycount; ++yyi) { YYPTRDIFF_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyarg[yyi]]); if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM) yysize = yysize1; else return YYENOMEM; } } if (*yymsg_alloc < yysize) { *yymsg_alloc = 2 * yysize; if (! (yysize <= *yymsg_alloc && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; return -1; } /* Avoid sprintf, as that infringes on the user's name space. Don't have undefined behavior even if the translation produced a string with the wrong number of "%s"s. */ { char *yyp = *yymsg; int yyi = 0; while ((*yyp = *yyformat) != '\0') if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) { yyp += yytnamerr (yyp, yytname[yyarg[yyi++]]); yyformat += 2; } else { ++yyp; ++yyformat; } } return 0; } /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ static void yydestruct (const char *yymsg, yysymbol_kind_t yykind, YYSTYPE *yyvaluep) { YY_USE (yyvaluep); if (!yymsg) yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yykind, yyvaluep, yylocationp); YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN YY_USE (yykind); YY_IGNORE_MAYBE_UNINITIALIZED_END } /* Lookahead token kind. */ int yychar; /* The semantic value of the lookahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ int yynerrs; /*----------. | yyparse. | `----------*/ int yyparse (void) { yy_state_fast_t yystate = 0; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus = 0; /* Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* Their size. */ YYPTRDIFF_T yystacksize = YYINITDEPTH; /* The state stack: array, bottom, top. */ yy_state_t yyssa[YYINITDEPTH]; yy_state_t *yyss = yyssa; yy_state_t *yyssp = yyss; /* The semantic value stack: array, bottom, top. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs = yyvsa; YYSTYPE *yyvsp = yyvs; int yyn; /* The return value of yyparse. */ int yyresult; /* Lookahead symbol kind. */ yysymbol_kind_t yytoken = YYSYMBOL_YYEMPTY; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; /* Buffer for error messages, and its allocated size. */ char yymsgbuf[128]; char *yymsg = yymsgbuf; YYPTRDIFF_T yymsg_alloc = sizeof yymsgbuf; #define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) /* The number of symbols on the RHS of the reduced rule. Keep to zero when no symbol should be popped. */ int yylen = 0; YYDPRINTF ((stderr, "Starting parse\n")); yychar = YYUNITEMPTY; /* Cause a token to be read. */ goto yysetstate; /*------------------------------------------------------------. | yynewstate -- push a new state, which is found in yystate. | `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks have just been pushed. So pushing a state here evens the stacks. */ yyssp++; /*--------------------------------------------------------------------. | yysetstate -- set current state (the top of the stack) to yystate. | `--------------------------------------------------------------------*/ yysetstate: YYDPRINTF ((stderr, "Entering state %d\n", yystate)); YY_ASSERT (0 <= yystate && yystate < YYNSTATES); YY_IGNORE_USELESS_CAST_BEGIN *yyssp = YY_CAST (yy_state_t, yystate); YY_IGNORE_USELESS_CAST_END YY_STACK_PRINT (yyss, yyssp); if (yyss + yystacksize - 1 <= yyssp) #if !defined yyoverflow && !defined YYSTACK_RELOCATE YYNOMEM; #else { /* Get the current used size of the three stacks, in elements. */ YYPTRDIFF_T yysize = yyssp - yyss + 1; # if defined yyoverflow { /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ yy_state_t *yyss1 = yyss; YYSTYPE *yyvs1 = yyvs; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ yyoverflow (YY_("memory exhausted"), &yyss1, yysize * YYSIZEOF (*yyssp), &yyvs1, yysize * YYSIZEOF (*yyvsp), &yystacksize); yyss = yyss1; yyvs = yyvs1; } # else /* defined YYSTACK_RELOCATE */ /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) YYNOMEM; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { yy_state_t *yyss1 = yyss; union yyalloc *yyptr = YY_CAST (union yyalloc *, YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize)))); if (! yyptr) YYNOMEM; YYSTACK_RELOCATE (yyss_alloc, yyss); YYSTACK_RELOCATE (yyvs_alloc, yyvs); # undef YYSTACK_RELOCATE if (yyss1 != yyssa) YYSTACK_FREE (yyss1); } # endif yyssp = yyss + yysize - 1; yyvsp = yyvs + yysize - 1; YY_IGNORE_USELESS_CAST_BEGIN YYDPRINTF ((stderr, "Stack size increased to %ld\n", YY_CAST (long, yystacksize))); YY_IGNORE_USELESS_CAST_END if (yyss + yystacksize - 1 <= yyssp) YYABORT; } #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */ if (yystate == YYFINAL) YYACCEPT; goto yybackup; /*-----------. | yybackup. | `-----------*/ yybackup: /* Do appropriate processing given the current state. Read a lookahead token if we need one and don't already have one. */ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; if (yypact_value_is_default (yyn)) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ /* YYCHAR is either empty, or end-of-input, or a valid lookahead. */ if (yychar == YYUNITEMPTY) { YYDPRINTF ((stderr, "Reading a token\n")); yychar = yylex (); } if (yychar <= YYUNITEOF) { yychar = YYUNITEOF; yytoken = YYSYMBOL_YYEOF; YYDPRINTF ((stderr, "Now at end of input.\n")); } else if (yychar == YYUNITerror) { /* The scanner already issued an error message, process directly to error recovery. But do not keep the error token as lookahead, it is too special and may lead us to an endless loop in error recovery. */ yychar = YYUNITUNDEF; yytoken = YYSYMBOL_YYerror; goto yyerrlab1; } else { yytoken = YYTRANSLATE (yychar); YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to detect an error, take that action. */ yyn += yytoken; if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken) goto yydefault; yyn = yytable[yyn]; if (yyn <= 0) { if (yytable_value_is_error (yyn)) goto yyerrlab; yyn = -yyn; goto yyreduce; } /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; /* Shift the lookahead token. */ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); yystate = yyn; YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END /* Discard the shifted token. */ yychar = YYUNITEMPTY; goto yynewstate; /*-----------------------------------------------------------. | yydefault -- do the default action for the current state. | `-----------------------------------------------------------*/ yydefault: yyn = yydefact[yystate]; if (yyn == 0) goto yyerrlab; goto yyreduce; /*-----------------------------. | yyreduce -- do a reduction. | `-----------------------------*/ yyreduce: /* yyn is the number of a rule to reduce with. */ yylen = yyr2[yyn]; /* If YYLEN is nonzero, implement the default value of the action: '$$ = $1'. Otherwise, the following line sets YYVAL to garbage. This behavior is undocumented and Bison users should not rely upon it. Assigning to YYVAL unconditionally makes the parser a bit smaller, and it avoids a GCC warning that YYVAL may be used uninitialized. */ yyval = yyvsp[1-yylen]; YY_REDUCE_PRINT (yyn); switch (yyn) { case 2: /* input: expr */ #line 50 "unitparse.y" { *unit_parse_result = (yyvsp[0].expr); } #line 1405 "unitparse.tab.c" break; case 4: /* expr: '+' simple_expr */ #line 59 "unitparse.y" { (yyval.expr) = (yyvsp[0].simple_expr); (yyval.expr).shift = 0.0; } #line 1414 "unitparse.tab.c" break; case 5: /* expr: '-' simple_expr */ #line 63 "unitparse.y" { (yyval.expr) = (yyvsp[0].simple_expr); (yyval.expr).unit.value = -(yyval.expr).unit.value; (yyval.expr).shift = 0.0; } #line 1424 "unitparse.tab.c" break; case 6: /* expr: expr exponent */ #line 68 "unitparse.y" { int i; if ((yyvsp[0].exponent) != 1) { (yyval.expr).unit.value = pow((yyvsp[-1].expr).unit.value, (yyvsp[0].exponent)); for (i = 0; i < N_UNITS; i++) (yyval.expr).unit.units[i] = (yyvsp[-1].expr).unit.units[i] * (yyvsp[0].exponent); } else { (yyval.expr) = (yyvsp[-1].expr); } (yyval.expr).shift = 0.0; } #line 1440 "unitparse.tab.c" break; case 7: /* expr: expr '+' expr */ #line 79 "unitparse.y" { unit_add_internal(&(yyvsp[-2].expr).unit, &(yyvsp[0].expr).unit, &(yyval.expr).unit); (yyval.expr).shift = 0.0; } #line 1449 "unitparse.tab.c" break; case 8: /* expr: expr '-' expr */ #line 83 "unitparse.y" { unit_sub_internal(&(yyvsp[-2].expr).unit, &(yyvsp[0].expr).unit, &(yyval.expr).unit); (yyval.expr).shift = 0.0; } #line 1458 "unitparse.tab.c" break; case 9: /* expr: expr expr */ #line 87 "unitparse.y" { unit_mult_internal(&(yyvsp[-1].expr).unit, &(yyvsp[0].expr).unit, &(yyval.expr).unit); if ((yyvsp[0].expr).shift != 0.0) /* avoid shift to not destroy -0 */ (yyval.expr).unit.value += (yyvsp[0].expr).shift; /* shift is evaluated exactly here */ (yyval.expr).shift = 0.0; } #line 1469 "unitparse.tab.c" break; case 10: /* expr: expr '*' expr */ #line 93 "unitparse.y" { unit_mult_internal(&(yyvsp[-2].expr).unit, &(yyvsp[0].expr).unit, &(yyval.expr).unit); (yyval.expr).shift = 0.0; } #line 1478 "unitparse.tab.c" break; case 11: /* expr: expr '/' expr */ #line 97 "unitparse.y" { unit_div_internal(&(yyvsp[-2].expr).unit, &(yyvsp[0].expr).unit, &(yyval.expr).unit); (yyval.expr).shift = 0.0; } #line 1487 "unitparse.tab.c" break; case 12: /* expr: '/' expr */ #line 101 "unitparse.y" { Unit nominator = { 1.0, {0} }; unit_div_internal(&nominator, &(yyvsp[0].expr).unit, &(yyval.expr).unit); (yyval.expr).shift = 0.0; } #line 1497 "unitparse.tab.c" break; case 13: /* simple_expr: number */ #line 109 "unitparse.y" { (yyval.simple_expr).unit.value = (yyvsp[0].number); memset(&(yyval.simple_expr).unit.units, 0, N_UNITS); (yyval.simple_expr).shift = 0.0; } #line 1507 "unitparse.tab.c" break; case 15: /* simple_expr: FUNCTION '(' expr ')' */ #line 115 "unitparse.y" { switch ((yyvsp[-3].FUNCTION)) { case FUNCTION_SQRT: unit_sqrt_internal(&(yyvsp[-1].expr).unit, &(yyval.simple_expr).unit); break; case FUNCTION_EXP: unit_exp_internal(&(yyvsp[-1].expr).unit, &(yyval.simple_expr).unit); break; case FUNCTION_LN: unit_ln_internal(&(yyvsp[-1].expr).unit, &(yyval.simple_expr).unit); break; case FUNCTION_LOG2: unit_log2_internal(&(yyvsp[-1].expr).unit, &(yyval.simple_expr).unit); break; case FUNCTION_ASIN: unit_asin_internal(&(yyvsp[-1].expr).unit, &(yyval.simple_expr).unit); break; case FUNCTION_TAN: unit_tan_internal(&(yyvsp[-1].expr).unit, &(yyval.simple_expr).unit); break; } } #line 1534 "unitparse.tab.c" break; case 16: /* simple_expr: '(' expr ')' */ #line 137 "unitparse.y" { (yyval.simple_expr) = (yyvsp[-1].expr); (yyval.simple_expr).shift = 0.0; } #line 1543 "unitparse.tab.c" break; case 18: /* number: DOUBLE '|' DOUBLE */ #line 144 "unitparse.y" { (yyval.number) = (yyvsp[-2].DOUBLE) / (yyvsp[0].DOUBLE); } #line 1551 "unitparse.tab.c" break; case 20: /* exponent: SUPER_SIGN super */ #line 150 "unitparse.y" { (yyval.exponent) = (yyvsp[-1].SUPER_SIGN) * (yyvsp[0].super); } #line 1557 "unitparse.tab.c" break; case 23: /* super: SUPER super */ #line 156 "unitparse.y" { (yyval.super) = 10 * (yyvsp[-1].SUPER) + (yyvsp[0].super); } #line 1563 "unitparse.tab.c" break; #line 1567 "unitparse.tab.c" default: break; } /* User semantic actions sometimes alter yychar, and that requires that yytoken be updated with the new translation. We take the approach of translating immediately before every use of yytoken. One alternative is translating here after every semantic action, but that translation would be missed if the semantic action invokes YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an incorrect destructor might then be invoked immediately. In the case of YYERROR or YYBACKUP, subsequent parser actions might lead to an incorrect destructor call or verbose syntax error message before the lookahead is translated. */ YY_SYMBOL_PRINT ("-> $$ =", YY_CAST (yysymbol_kind_t, yyr1[yyn]), &yyval, &yyloc); YYPOPSTACK (yylen); yylen = 0; *++yyvsp = yyval; /* Now 'shift' the result of the reduction. Determine what state that goes to, based on the state we popped back to and the rule number reduced by. */ { const int yylhs = yyr1[yyn] - YYNTOKENS; const int yyi = yypgoto[yylhs] + *yyssp; yystate = (0 <= yyi && yyi <= YYLAST && yycheck[yyi] == *yyssp ? yytable[yyi] : yydefgoto[yylhs]); } goto yynewstate; /*--------------------------------------. | yyerrlab -- here on detecting error. | `--------------------------------------*/ yyerrlab: /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ yytoken = yychar == YYUNITEMPTY ? YYSYMBOL_YYEMPTY : YYTRANSLATE (yychar); /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { ++yynerrs; { yypcontext_t yyctx = {yyssp, yytoken}; char const *yymsgp = YY_("syntax error"); int yysyntax_error_status; yysyntax_error_status = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx); if (yysyntax_error_status == 0) yymsgp = yymsg; else if (yysyntax_error_status == -1) { if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); yymsg = YY_CAST (char *, YYSTACK_ALLOC (YY_CAST (YYSIZE_T, yymsg_alloc))); if (yymsg) { yysyntax_error_status = yysyntax_error (&yymsg_alloc, &yymsg, &yyctx); yymsgp = yymsg; } else { yymsg = yymsgbuf; yymsg_alloc = sizeof yymsgbuf; yysyntax_error_status = YYENOMEM; } } yyerror (yymsgp); if (yysyntax_error_status == YYENOMEM) YYNOMEM; } } if (yyerrstatus == 3) { /* If just tried and failed to reuse lookahead token after an error, discard it. */ if (yychar <= YYUNITEOF) { /* Return failure if at end of input. */ if (yychar == YYUNITEOF) YYABORT; } else { yydestruct ("Error: discarding", yytoken, &yylval); yychar = YYUNITEMPTY; } } /* Else will try to reuse lookahead token after shifting the error token. */ goto yyerrlab1; /*---------------------------------------------------. | yyerrorlab -- error raised explicitly by YYERROR. | `---------------------------------------------------*/ yyerrorlab: /* Pacify compilers when the user code never invokes YYERROR and the label yyerrorlab therefore never appears in user code. */ if (0) YYERROR; ++yynerrs; /* Do not reclaim the symbols of the rule whose action triggered this YYERROR. */ YYPOPSTACK (yylen); yylen = 0; YY_STACK_PRINT (yyss, yyssp); yystate = *yyssp; goto yyerrlab1; /*-------------------------------------------------------------. | yyerrlab1 -- common code for both syntax error and YYERROR. | `-------------------------------------------------------------*/ yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ /* Pop stack until we find a state that shifts the error token. */ for (;;) { yyn = yypact[yystate]; if (!yypact_value_is_default (yyn)) { yyn += YYSYMBOL_YYerror; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYSYMBOL_YYerror) { yyn = yytable[yyn]; if (0 < yyn) break; } } /* Pop the current state because it cannot handle the error token. */ if (yyssp == yyss) YYABORT; yydestruct ("Error: popping", YY_ACCESSING_SYMBOL (yystate), yyvsp); YYPOPSTACK (1); yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; YY_IGNORE_MAYBE_UNINITIALIZED_END /* Shift the error token. */ YY_SYMBOL_PRINT ("Shifting", YY_ACCESSING_SYMBOL (yyn), yyvsp, yylsp); yystate = yyn; goto yynewstate; /*-------------------------------------. | yyacceptlab -- YYACCEPT comes here. | `-------------------------------------*/ yyacceptlab: yyresult = 0; goto yyreturnlab; /*-----------------------------------. | yyabortlab -- YYABORT comes here. | `-----------------------------------*/ yyabortlab: yyresult = 1; goto yyreturnlab; /*-----------------------------------------------------------. | yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here. | `-----------------------------------------------------------*/ yyexhaustedlab: yyerror (YY_("memory exhausted")); yyresult = 2; goto yyreturnlab; /*----------------------------------------------------------. | yyreturnlab -- parsing is finished, clean up and return. | `----------------------------------------------------------*/ yyreturnlab: if (yychar != YYUNITEMPTY) { /* Make sure we have latest lookahead translation. See comments at user semantic actions for why this is necessary. */ yytoken = YYTRANSLATE (yychar); yydestruct ("Cleanup: discarding lookahead", yytoken, &yylval); } /* Do not reclaim the symbols of the rule whose action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); YY_STACK_PRINT (yyss, yyssp); while (yyssp != yyss) { yydestruct ("Cleanup: popping", YY_ACCESSING_SYMBOL (+*yyssp), yyvsp); YYPOPSTACK (1); } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); return yyresult; } #line 159 "unitparse.y" /* parse a given string and return the result via the second argument */ int unit_parse (char *s, UnitShift *unit_shift) { struct yyunit_buffer_state *buf; int ret; unit_parse_result = unit_shift; buf = yyunit_scan_string(s); ret = yyunitparse(); yyunit_delete_buffer(buf); return ret; } postgresql-unit-7.8/unitparse.tab.h000066400000000000000000000075331450213077700175160ustar00rootroot00000000000000/* A Bison parser, made by GNU Bison 3.8.2. */ /* Bison interface for Yacc-like parsers in C Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ /* As a special exception, you may create a larger work that contains part or all of the Bison parser skeleton and distribute that work under terms of your choice, so long as that work isn't itself a parser generator using the skeleton or a modified version thereof as a parser skeleton. Alternatively, if you modify or redistribute the parser skeleton itself, you may (at your option) remove this special exception, which will cause the skeleton and the resulting Bison output files to be licensed under the GNU General Public License without this special exception. This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ /* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual, especially those whose name start with YY_ or yy_. They are private implementation details that can be changed or removed. */ #ifndef YY_YYUNIT_UNITPARSE_TAB_H_INCLUDED # define YY_YYUNIT_UNITPARSE_TAB_H_INCLUDED /* Debug traces. */ #ifndef YYUNITDEBUG # if defined YYDEBUG #if YYDEBUG # define YYUNITDEBUG 1 # else # define YYUNITDEBUG 0 # endif # else /* ! defined YYDEBUG */ # define YYUNITDEBUG 0 # endif /* ! defined YYDEBUG */ #endif /* ! defined YYUNITDEBUG */ #if YYUNITDEBUG extern int yyunitdebug; #endif /* Token kinds. */ #ifndef YYUNITTOKENTYPE # define YYUNITTOKENTYPE enum yyunittokentype { YYUNITEMPTY = -2, YYUNITEOF = 0, /* "end of file" */ YYUNITerror = 256, /* error */ YYUNITUNDEF = 257, /* "invalid token" */ DOUBLE = 258, /* DOUBLE */ UNIT_SHIFT = 259, /* UNIT_SHIFT */ EXPONENT = 260, /* EXPONENT */ SUPER_SIGN = 261, /* SUPER_SIGN */ SUPER = 262, /* SUPER */ FUNCTION = 263, /* FUNCTION */ ERR = 264, /* ERR */ UMINUS = 265 /* UMINUS */ }; typedef enum yyunittokentype yyunittoken_kind_t; #endif /* Value type. */ #if ! defined YYUNITSTYPE && ! defined YYUNITSTYPE_IS_DECLARED union YYUNITSTYPE { UnitShift UNIT_SHIFT; /* UNIT_SHIFT */ UnitShift input; /* input */ UnitShift expr; /* expr */ UnitShift simple_expr; /* simple_expr */ double DOUBLE; /* DOUBLE */ double number; /* number */ enum parser_function FUNCTION; /* FUNCTION */ int EXPONENT; /* EXPONENT */ int SUPER_SIGN; /* SUPER_SIGN */ int SUPER; /* SUPER */ int exponent; /* exponent */ int super; /* super */ #line 95 "unitparse.tab.h" }; typedef union YYUNITSTYPE YYUNITSTYPE; # define YYUNITSTYPE_IS_TRIVIAL 1 # define YYUNITSTYPE_IS_DECLARED 1 #endif extern YYUNITSTYPE yyunitlval; int yyunitparse (void); #endif /* !YY_YYUNIT_UNITPARSE_TAB_H_INCLUDED */ postgresql-unit-7.8/unitparse.y000066400000000000000000000072051450213077700167660ustar00rootroot00000000000000/* Copyright (C) 2016-2018 Christoph Berg This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ %{ #include /* bzero */ #include /* pow */ #include "unit.h" /* flex/bison prototypes */ int yylex (void); struct yyunit_buffer_state *yyunit_scan_string(char *str); void yyunit_delete_buffer(struct yyunit_buffer_state *buffer); void yyerror (char const *s); static UnitShift *unit_parse_result; /* parsing result gets stored here */ %} %define parse.error verbose %define api.prefix {yyunit} %define api.value.type union %token DOUBLE %token UNIT_SHIFT %token EXPONENT SUPER_SIGN SUPER %token FUNCTION %token ERR %type input expr simple_expr %type number %type exponent super %left '+' '-' %left '/' %left '*' /* * binds stronger than / */ %left UMINUS /* unary minus */ %% input: expr { *unit_parse_result = $1; } ; expr: simple_expr /* accept only simple expressions after unary sign to disambiguate * (-N)N from -(NN): (-273.15)°C is not the same as -(273.15°C) */ | '+' simple_expr %prec UMINUS { $$ = $2; $$.shift = 0.0; } | '-' simple_expr %prec UMINUS { $$ = $2; $$.unit.value = -$$.unit.value; $$.shift = 0.0; } | expr exponent { int i; if ($2 != 1) { $$.unit.value = pow($1.unit.value, $2); for (i = 0; i < N_UNITS; i++) $$.unit.units[i] = $1.unit.units[i] * $2; } else { $$ = $1; } $$.shift = 0.0; } | expr '+' expr { unit_add_internal(&$1.unit, &$3.unit, &$$.unit); $$.shift = 0.0; } | expr '-' expr { unit_sub_internal(&$1.unit, &$3.unit, &$$.unit); $$.shift = 0.0; } | expr expr %prec '*' { unit_mult_internal(&$1.unit, &$2.unit, &$$.unit); if ($2.shift != 0.0) /* avoid shift to not destroy -0 */ $$.unit.value += $2.shift; /* shift is evaluated exactly here */ $$.shift = 0.0; } | expr '*' expr { unit_mult_internal(&$1.unit, &$3.unit, &$$.unit); $$.shift = 0.0; } | expr '/' expr { unit_div_internal(&$1.unit, &$3.unit, &$$.unit); $$.shift = 0.0; } | '/' expr { Unit nominator = { 1.0, {0} }; unit_div_internal(&nominator, &$2.unit, &$$.unit); $$.shift = 0.0; } ; simple_expr: number { $$.unit.value = $1; memset(&$$.unit.units, 0, N_UNITS); $$.shift = 0.0; } | UNIT_SHIFT | FUNCTION '(' expr ')' { switch ($1) { case FUNCTION_SQRT: unit_sqrt_internal(&$3.unit, &$$.unit); break; case FUNCTION_EXP: unit_exp_internal(&$3.unit, &$$.unit); break; case FUNCTION_LN: unit_ln_internal(&$3.unit, &$$.unit); break; case FUNCTION_LOG2: unit_log2_internal(&$3.unit, &$$.unit); break; case FUNCTION_ASIN: unit_asin_internal(&$3.unit, &$$.unit); break; case FUNCTION_TAN: unit_tan_internal(&$3.unit, &$$.unit); break; } } | '(' expr ')' { $$ = $2; $$.shift = 0.0; } number: DOUBLE | DOUBLE '|' DOUBLE { $$ = $1 / $3; } exponent: EXPONENT | SUPER_SIGN super { $$ = $1 * $2; } | super ; super: SUPER | SUPER super { $$ = 10 * $1 + $2; } ; %% /* parse a given string and return the result via the second argument */ int unit_parse (char *s, UnitShift *unit_shift) { struct yyunit_buffer_state *buf; int ret; unit_parse_result = unit_shift; buf = yyunit_scan_string(s); ret = yyunitparse(); yyunit_delete_buffer(buf); return ret; }