diff options
| author | Jay Belanger | 2007-08-15 15:42:58 +0000 |
|---|---|---|
| committer | Jay Belanger | 2007-08-15 15:42:58 +0000 |
| commit | a21f3259fd6496941758b303448eb580f7edae07 (patch) | |
| tree | 2789be6c7a1a1414197b582733772bf5a6020298 | |
| parent | 57407fb4192534e496d8b8b551e4db1c75c6fdac (diff) | |
| download | emacs-a21f3259fd6496941758b303448eb580f7edae07.tar.gz emacs-a21f3259fd6496941758b303448eb580f7edae07.zip | |
(math-standard-units): Update values. Put in exact values when
possible.
(math-unit-prefixes): Replace floats with powers of ten.
(math-standard-units-systems): Replace floats with integers.
(math-make-unit-string): Remove extra spaces in output.
| -rw-r--r-- | lisp/calc/calc-units.el | 201 |
1 files changed, 103 insertions, 98 deletions
diff --git a/lisp/calc/calc-units.el b/lisp/calc/calc-units.el index e225d2d0b09..ae94fc43ae1 100644 --- a/lisp/calc/calc-units.el +++ b/lisp/calc/calc-units.el | |||
| @@ -40,45 +40,47 @@ | |||
| 40 | ;;; with some additions by Przemek Klosowski (przemek@rrdstrad.nist.gov) | 40 | ;;; with some additions by Przemek Klosowski (przemek@rrdstrad.nist.gov) |
| 41 | ;;; Updated April 2002 by Jochen Küpper | 41 | ;;; Updated April 2002 by Jochen Küpper |
| 42 | 42 | ||
| 43 | ;;; for CODATA 1998 see one of | 43 | ;;; Updated August 2007, using |
| 44 | ;;; - Journal of Physical and Chemical Reference Data, 28(6), 1713-1852, 1999. | 44 | ;;; CODATA (http://physics.nist.gov/cuu/Constants/index.html) |
| 45 | ;;; - Reviews of Modern Physics, 72(2), 351-495, 2000. | 45 | ;;; NIST (http://physics.nist.gov/Pubs/SP811/appenB9.html) |
| 46 | ;;; for CODATA 2005 see | 46 | ;;; ESUWM (Encyclopaedia of Scientific Units, Weights and |
| 47 | ;;; - http://physics.nist.gov/cuu/Constants/index.html | 47 | ;;; Measures, by François Cardarelli) |
| 48 | ;;; All conversions are exact unless otherwise noted. | ||
| 48 | 49 | ||
| 49 | (defvar math-standard-units | 50 | (defvar math-standard-units |
| 50 | '( ;; Length | 51 | '( ;; Length |
| 51 | ( m nil "*Meter" ) | 52 | ( m nil "*Meter" ) |
| 52 | ( in "2.54 cm" "Inch" ) | 53 | ( in "254*10^(-2) cm" "Inch" ) |
| 53 | ( ft "12 in" "Foot" ) | 54 | ( ft "12 in" "Foot" ) |
| 54 | ( yd "3 ft" "Yard" ) | 55 | ( yd "3 ft" "Yard" ) |
| 55 | ( mi "5280 ft" "Mile" ) | 56 | ( mi "5280 ft" "Mile" ) |
| 56 | ( au "149597870691 m" "Astronomical Unit" ) ;; NASA JPL (http://neo.jpl.nasa.gov/glossary/au.html) | 57 | ( au "149597870691. m" "Astronomical Unit" ) |
| 57 | ( lyr "9460536207068016 m" "Light Year" ) | 58 | ;; (approx) NASA JPL (http://neo.jpl.nasa.gov/glossary/au.html) |
| 58 | ( pc "206264.80625 au" "Parsec" ) | 59 | ( lyr "c yr" "Light Year" ) |
| 60 | ( pc "3.0856775854e16 m" "Parsec" ) ;; (approx) ESUWM | ||
| 59 | ( nmi "1852 m" "Nautical Mile" ) | 61 | ( nmi "1852 m" "Nautical Mile" ) |
| 60 | ( fath "6 ft" "Fathom" ) | 62 | ( fath "6 ft" "Fathom" ) |
| 61 | ( mu "1 um" "Micron" ) | 63 | ( mu "1 um" "Micron" ) |
| 62 | ( mil "in/1000" "Mil" ) | 64 | ( mil "in/1000" "Mil" ) |
| 63 | ( point "in/72" "Point (1/72 inch)" ) | 65 | ( point "in/72" "Point (1/72 inch)" ) |
| 64 | ( Ang "1e-10 m" "Angstrom" ) | 66 | ( Ang "10^(-10) m" "Angstrom" ) |
| 65 | ( mfi "mi+ft+in" "Miles + feet + inches" ) | 67 | ( mfi "mi+ft+in" "Miles + feet + inches" ) |
| 66 | ;; TeX lengths | 68 | ;; TeX lengths |
| 67 | ( texpt "in/72.27" "Point (TeX conventions)" ) | 69 | ( texpt "(100/7227) in" "Point (TeX conventions)" ) |
| 68 | ( texpc "12 texpt" "Pica" ) | 70 | ( texpc "12 texpt" "Pica" ) |
| 69 | ( texbp "point" "Big point (TeX conventions)" ) | 71 | ( texbp "point" "Big point (TeX conventions)" ) |
| 70 | ( texdd "1238/1157 texpt" "Didot point" ) | 72 | ( texdd "(1238/1157) texpt" "Didot point" ) |
| 71 | ( texcc "12 texdd" "Cicero" ) | 73 | ( texcc "12 texdd" "Cicero" ) |
| 72 | ( texsp "1/66536 texpt" "Scaled TeX point" ) | 74 | ( texsp "(1/65536) texpt" "Scaled TeX point" ) |
| 73 | 75 | ||
| 74 | ;; Area | 76 | ;; Area |
| 75 | ( hect "10000 m^2" "*Hectare" ) | 77 | ( hect "10000 m^2" "*Hectare" ) |
| 76 | ( a "100 m^2" "Are") | 78 | ( a "100 m^2" "Are") |
| 77 | ( acre "mi^2 / 640" "Acre" ) | 79 | ( acre "mi^2 / 640" "Acre" ) |
| 78 | ( b "1e-28 m^2" "Barn" ) | 80 | ( b "10^(-28) m^2" "Barn" ) |
| 79 | 81 | ||
| 80 | ;; Volume | 82 | ;; Volume |
| 81 | ( L "1e-3 m^3" "*Liter" ) | 83 | ( L "10^(-3) m^3" "*Liter" ) |
| 82 | ( l "L" "Liter" ) | 84 | ( l "L" "Liter" ) |
| 83 | ( gal "4 qt" "US Gallon" ) | 85 | ( gal "4 qt" "US Gallon" ) |
| 84 | ( qt "2 pt" "Quart" ) | 86 | ( qt "2 pt" "Quart" ) |
| @@ -87,10 +89,10 @@ | |||
| 87 | ( ozfl "2 tbsp" "Fluid Ounce" ) | 89 | ( ozfl "2 tbsp" "Fluid Ounce" ) |
| 88 | ( floz "2 tbsp" "Fluid Ounce" ) | 90 | ( floz "2 tbsp" "Fluid Ounce" ) |
| 89 | ( tbsp "3 tsp" "Tablespoon" ) | 91 | ( tbsp "3 tsp" "Tablespoon" ) |
| 90 | ( tsp "4.92892159375 ml" "Teaspoon" ) | 92 | ( tsp "4.92892159373 ml" "Teaspoon" ) ;; (approx) ESUWM |
| 91 | ( vol "tsp+tbsp+ozfl+cup+pt+qt+gal" "Gallons + ... + teaspoons" ) | 93 | ( vol "tsp+tbsp+ozfl+cup+pt+qt+gal" "Gallons + ... + teaspoons" ) |
| 92 | ( galC "4.54609 L" "Canadian Gallon" ) | 94 | ( galC "galUK" "Canadian Gallon" ) |
| 93 | ( galUK "4.546092 L" "UK Gallon" ) | 95 | ( galUK "454609*10^(-5) L" "UK Gallon" ) ;; NIST |
| 94 | 96 | ||
| 95 | ;; Time | 97 | ;; Time |
| 96 | ( s nil "*Second" ) | 98 | ( s nil "*Second" ) |
| @@ -100,44 +102,44 @@ | |||
| 100 | ( day "24 hr" "Day" ) | 102 | ( day "24 hr" "Day" ) |
| 101 | ( wk "7 day" "Week" ) | 103 | ( wk "7 day" "Week" ) |
| 102 | ( hms "wk+day+hr+min+s" "Hours, minutes, seconds" ) | 104 | ( hms "wk+day+hr+min+s" "Hours, minutes, seconds" ) |
| 103 | ( yr "365.25 day" "Year" ) | 105 | ( yr "365.25 day" "Year" ) ;; (approx, but keep) |
| 104 | ( Hz "1/s" "Hertz" ) | 106 | ( Hz "1/s" "Hertz" ) |
| 105 | 107 | ||
| 106 | ;; Speed | 108 | ;; Speed |
| 107 | ( mph "mi/hr" "*Miles per hour" ) | 109 | ( mph "mi/hr" "*Miles per hour" ) |
| 108 | ( kph "km/hr" "Kilometers per hour" ) | 110 | ( kph "km/hr" "Kilometers per hour" ) |
| 109 | ( knot "nmi/hr" "Knot" ) | 111 | ( knot "nmi/hr" "Knot" ) |
| 110 | ( c "299792458 m/s" "Speed of light" ) ;;; CODATA 2005 | 112 | ( c "299792458 m/s" "Speed of light" ) ;;; CODATA |
| 111 | 113 | ||
| 112 | ;; Acceleration | 114 | ;; Acceleration |
| 113 | ( ga "9.80665 m/s^2" "*\"g\" acceleration" ) ;; CODATA 2005 | 115 | ( ga "980665*10^(-5) m/s^2" "*\"g\" acceleration" ) ;; CODATA |
| 114 | 116 | ||
| 115 | ;; Mass | 117 | ;; Mass |
| 116 | ( g nil "*Gram" ) | 118 | ( g nil "*Gram" ) |
| 117 | ( lb "16 oz" "Pound (mass)" ) | 119 | ( lb "16 oz" "Pound (mass)" ) |
| 118 | ( oz "28.349523125 g" "Ounce (mass)" ) | 120 | ( oz "28349523125*10^(-9) g" "Ounce (mass)" ) ;; ESUWM |
| 119 | ( ton "2000 lb" "Ton" ) | 121 | ( ton "2000 lb" "Ton" ) |
| 120 | ( tpo "ton+lb+oz" "Tons + pounds + ounces (mass)" ) | 122 | ( tpo "ton+lb+oz" "Tons + pounds + ounces (mass)" ) |
| 121 | ( t "1000 kg" "Metric ton" ) | 123 | ( t "1000 kg" "Metric ton" ) |
| 122 | ( tonUK "1016.0469088 kg" "UK ton" ) | 124 | ( tonUK "10160469088*10^(-7) kg" "UK ton" ) ;; ESUWM |
| 123 | ( lbt "12 ozt" "Troy pound" ) | 125 | ( lbt "12 ozt" "Troy pound" ) |
| 124 | ( ozt "31.103475 g" "Troy ounce" ) | 126 | ( ozt "31.10347680 g" "Troy ounce" ) ;; (approx) ESUWM |
| 125 | ( ct ".2 g" "Carat" ) | 127 | ( ct "(2/10) g" "Carat" ) ;; ESUWM |
| 126 | ( u "1.66053886e-27 kg" "Unified atomic mass" ) ;; CODATA 2005 | 128 | ( u "1.660538782e-27 kg" "Unified atomic mass" );;(approx) CODATA |
| 127 | 129 | ||
| 128 | ;; Force | 130 | ;; Force |
| 129 | ( N "m kg/s^2" "*Newton" ) | 131 | ( N "m kg/s^2" "*Newton" ) |
| 130 | ( dyn "1e-5 N" "Dyne" ) | 132 | ( dyn "10^(-5) N" "Dyne" ) |
| 131 | ( gf "ga g" "Gram (force)" ) | 133 | ( gf "ga g" "Gram (force)" ) |
| 132 | ( lbf "4.44822161526 N" "Pound (force)" ) | 134 | ( lbf "ga lb" "Pound (force)" ) |
| 133 | ( kip "1000 lbf" "Kilopound (force)" ) | 135 | ( kip "1000 lbf" "Kilopound (force)" ) |
| 134 | ( pdl "0.138255 N" "Poundal" ) | 136 | ( pdl "138254954376*10^(-12) N" "Poundal" ) ;; ESUWM |
| 135 | 137 | ||
| 136 | ;; Energy | 138 | ;; Energy |
| 137 | ( J "N m" "*Joule" ) | 139 | ( J "N m" "*Joule" ) |
| 138 | ( erg "1e-7 J" "Erg" ) | 140 | ( erg "10^(-7) J" "Erg" ) |
| 139 | ( cal "4.1868 J" "International Table Calorie" ) | 141 | ( cal "4.18674 J" "International Table Calorie" );;(approx) ESUWM |
| 140 | ( Btu "1055.05585262 J" "International Table Btu" ) | 142 | ( Btu "105505585262*10^(-8) J" "International Table Btu" ) ;; ESUWM |
| 141 | ( eV "ech V" "Electron volt" ) | 143 | ( eV "ech V" "Electron volt" ) |
| 142 | ( ev "eV" "Electron volt" ) | 144 | ( ev "eV" "Electron volt" ) |
| 143 | ( therm "105506000 J" "EEC therm" ) | 145 | ( therm "105506000 J" "EEC therm" ) |
| @@ -151,7 +153,7 @@ | |||
| 151 | 153 | ||
| 152 | ;; Power | 154 | ;; Power |
| 153 | ( W "J/s" "*Watt" ) | 155 | ( W "J/s" "*Watt" ) |
| 154 | ( hp "745.7 W" "Horsepower" ) | 156 | ( hp "745.699871581 W" "Horsepower" ) ;;(approx) ESUWM |
| 155 | 157 | ||
| 156 | ;; Temperature | 158 | ;; Temperature |
| 157 | ( K nil "*Degree Kelvin" K ) | 159 | ( K nil "*Degree Kelvin" K ) |
| @@ -164,24 +166,24 @@ | |||
| 164 | 166 | ||
| 165 | ;; Pressure | 167 | ;; Pressure |
| 166 | ( Pa "N/m^2" "*Pascal" ) | 168 | ( Pa "N/m^2" "*Pascal" ) |
| 167 | ( bar "1e5 Pa" "Bar" ) | 169 | ( bar "10^5 Pa" "Bar" ) |
| 168 | ( atm "101325 Pa" "Standard atmosphere" ) ;; CODATA 2005 | 170 | ( atm "101325 Pa" "Standard atmosphere" ) ;; CODATA |
| 169 | ( Torr " 1.333224e2 Pa" "Torr" ) ;; NIST (http://physics.nist.gov/Pubs/SP811/appenB9.html) | 171 | ( Torr "1.333224e2 Pa" "Torr" ) ;;(approx) NIST |
| 170 | ( mHg "1000 Torr" "Meter of mercury" ) | 172 | ( mHg "1000 Torr" "Meter of mercury" ) |
| 171 | ( inHg "25.4 mmHg" "Inch of mercury" ) | 173 | ( inHg "254*10^(-1) mmHg" "Inch of mercury" ) |
| 172 | ( inH2O "2.490889e2 Pa" "Inch of water" ) ;; NIST (http://physics.nist.gov/Pubs/SP811/appenB9.html) | 174 | ( inH2O "2.490889e2 Pa" "Inch of water" ) ;;(approx) NIST |
| 173 | ( psi "6894.75729317 Pa" "Pound per square inch" ) | 175 | ( psi "lbf/in^2" "Pounds per square inch" ) |
| 174 | 176 | ||
| 175 | ;; Viscosity | 177 | ;; Viscosity |
| 176 | ( P "0.1 Pa s" "*Poise" ) | 178 | ( P "(1/10) Pa s" "*Poise" ) |
| 177 | ( St "1e-4 m^2/s" "Stokes" ) | 179 | ( St "10^(-4) m^2/s" "Stokes" ) |
| 178 | 180 | ||
| 179 | ;; Electromagnetism | 181 | ;; Electromagnetism |
| 180 | ( A nil "*Ampere" ) | 182 | ( A nil "*Ampere" ) |
| 181 | ( C "A s" "Coulomb" ) | 183 | ( C "A s" "Coulomb" ) |
| 182 | ( Fdy "ech Nav" "Faraday" ) | 184 | ( Fdy "ech Nav" "Faraday" ) |
| 183 | ( e "1.60217653e-19 C" "Elementary charge" ) ;; CODATA 2005 | 185 | ( e "ech" "Elementary charge" ) |
| 184 | ( ech "1.60217653e-19 C" "Elementary charge" ) ;; CODATA 2005 | 186 | ( ech "1.602176487e-19 C" "Elementary charge" ) ;;(approx) CODATA |
| 185 | ( V "W/A" "Volt" ) | 187 | ( V "W/A" "Volt" ) |
| 186 | ( ohm "V/A" "Ohm" ) | 188 | ( ohm "V/A" "Ohm" ) |
| 187 | ( mho "A/V" "Mho" ) | 189 | ( mho "A/V" "Mho" ) |
| @@ -189,26 +191,26 @@ | |||
| 189 | ( F "C/V" "Farad" ) | 191 | ( F "C/V" "Farad" ) |
| 190 | ( H "Wb/A" "Henry" ) | 192 | ( H "Wb/A" "Henry" ) |
| 191 | ( T "Wb/m^2" "Tesla" ) | 193 | ( T "Wb/m^2" "Tesla" ) |
| 192 | ( Gs "1e-4 T" "Gauss" ) | 194 | ( Gs "10^(-4) T" "Gauss" ) |
| 193 | ( Wb "V s" "Weber" ) | 195 | ( Wb "V s" "Weber" ) |
| 194 | 196 | ||
| 195 | ;; Luminous intensity | 197 | ;; Luminous intensity |
| 196 | ( cd nil "*Candela" ) | 198 | ( cd nil "*Candela" ) |
| 197 | ( sb "1e4 cd/m^2" "Stilb" ) | 199 | ( sb "10000 cd/m^2" "Stilb" ) |
| 198 | ( lm "cd sr" "Lumen" ) | 200 | ( lm "cd sr" "Lumen" ) |
| 199 | ( lx "lm/m^2" "Lux" ) | 201 | ( lx "lm/m^2" "Lux" ) |
| 200 | ( ph "1e4 lx" "Phot" ) | 202 | ( ph "10000 lx" "Phot" ) |
| 201 | ( fc "10.76391 lx" "Footcandle" ) ;; NIST (http://physics.nist.gov/Pubs/SP811/appenB9.html) | 203 | ( fc "10.76391 lx" "Footcandle" ) ;;(approx) NIST |
| 202 | ( lam "1e4 lm/m^2" "Lambert" ) | 204 | ( lam "10000 lm/m^2" "Lambert" ) |
| 203 | ( flam "3.426259 cd/m^2" "Footlambert" ) ;; NIST (http://physics.nist.gov/Pubs/SP811/appenB9.html) | 205 | ( flam "3.426259 cd/m^2" "Footlambert" ) ;;(approx) NIST |
| 204 | 206 | ||
| 205 | ;; Radioactivity | 207 | ;; Radioactivity |
| 206 | ( Bq "1/s" "*Becquerel" ) | 208 | ( Bq "1/s" "*Becquerel" ) |
| 207 | ( Ci "3.7e10 Bq" "Curie" ) | 209 | ( Ci "37*10^9 Bq" "Curie" ) ;; ESUWM |
| 208 | ( Gy "J/kg" "Gray" ) | 210 | ( Gy "J/kg" "Gray" ) |
| 209 | ( Sv "Gy" "Sievert" ) | 211 | ( Sv "Gy" "Sievert" ) |
| 210 | ( R "2.58e-4 C/kg" "Roentgen" ) | 212 | ( R "258*10^(-6) C/kg" "Roentgen" ) ;; NIST |
| 211 | ( rd ".01 Gy" "Rad" ) | 213 | ( rd "(1/100) Gy" "Rad" ) |
| 212 | ( rem "rd" "Rem" ) | 214 | ( rem "rd" "Rem" ) |
| 213 | 215 | ||
| 214 | ;; Amount of substance | 216 | ;; Amount of substance |
| @@ -228,23 +230,24 @@ | |||
| 228 | ( sr nil "*Steradian" ) | 230 | ( sr nil "*Steradian" ) |
| 229 | 231 | ||
| 230 | ;; Other physical quantities | 232 | ;; Other physical quantities |
| 231 | ( h "6.6260693e-34 J s" "*Planck's constant" ) ;; CODATA 2005 | 233 | ;; The values are from CODATA, and are approximate. |
| 232 | ( hbar "h / 2 pi" "Planck's constant" ) | 234 | ( h "6.62606896e-34 J s" "*Planck's constant" ) |
| 233 | ( mu0 "4 pi 1e-7 H/m" "Permeability of vacuum" ) | 235 | ( hbar "h / (2 pi)" "Planck's constant" ) |
| 234 | ( G "6.6742e-11 m^3/kg^1/s^2" "Gravitational constant" ) ;; CODATA 2005 | 236 | ( mu0 "4 pi 10^(-7) H/m" "Permeability of vacuum" ) |
| 235 | ( Nav "6.02214115e23 / mol" "Avagadro's constant" ) ;; CODATA 2005 | 237 | ( G "6.67428e-11 m^3/(kg s^2)" "Gravitational constant" ) |
| 236 | ( me "9.1093826e-31 kg" "Electron rest mass" ) ;; CODATA 2005 | 238 | ( Nav "6.02214179e23 / mol" "Avagadro's constant" ) |
| 237 | ( mp "1.67262171e-27 kg" "Proton rest mass" ) ;; CODATA 2005 | 239 | ( me "9.10938215e-31 kg" "Electron rest mass" ) |
| 238 | ( mn "1.67492728e-27 kg" "Neutron rest mass" ) ;; CODATA 2005 | 240 | ( mp "1.672621637e-27 kg" "Proton rest mass" ) |
| 239 | ( mmu "1.88353140e-28 kg" "Muon rest mass" ) ;; CODATA 2005 | 241 | ( mn "1.674927211e-27 kg" "Neutron rest mass" ) |
| 240 | ( Ryd "10973731.568525 /m" "Rydberg's constant" ) ;; CODATA 2005 | 242 | ( mmu "1.88353130e-28 kg" "Muon rest mass" ) |
| 241 | ( k "1.3806505e-23 J/K" "Boltzmann's constant" ) ;; CODATA 2005 | 243 | ( Ryd "10973731.568527 /m" "Rydberg's constant" ) |
| 242 | ( alpha "7.297352568e-3" "Fine structure constant" ) ;; CODATA 2005 | 244 | ( k "1.3806504e-23 J/K" "Boltzmann's constant" ) |
| 243 | ( muB "927.400949e-26 J/T" "Bohr magneton" ) ;; CODATA 2005 | 245 | ( alpha "7.2973525376e-3" "Fine structure constant" ) |
| 244 | ( muN "5.05078343e-27 J/T" "Nuclear magneton" ) ;; CODATA 2005 | 246 | ( muB "927.400915e-26 J/T" "Bohr magneton" ) |
| 245 | ( mue "-928.476412e-26 J/T" "Electron magnetic moment" ) ;; CODATA 2005 | 247 | ( muN "5.05078324e-27 J/T" "Nuclear magneton" ) |
| 246 | ( mup "1.41060671e-26 J/T" "Proton magnetic moment" ) ;; CODATA 2005 | 248 | ( mue "-928.476377e-26 J/T" "Electron magnetic moment" ) |
| 247 | ( R0 "8.314472 J/mol/K" "Molar gas constant" ) ;; CODATA 2005 | 249 | ( mup "1.410606662e-26 J/T" "Proton magnetic moment" ) |
| 250 | ( R0 "8.314472 J/(mol K)" "Molar gas constant" ) | ||
| 248 | ( V0 "22.710981e-3 m^3/mol" "Standard volume of ideal gas" ))) | 251 | ( V0 "22.710981e-3 m^3/mol" "Standard volume of ideal gas" ))) |
| 249 | 252 | ||
| 250 | 253 | ||
| @@ -255,35 +258,35 @@ If this is changed, be sure to set math-units-table to nil to ensure | |||
| 255 | that the combined units table will be rebuilt.") | 258 | that the combined units table will be rebuilt.") |
| 256 | 259 | ||
| 257 | (defvar math-unit-prefixes | 260 | (defvar math-unit-prefixes |
| 258 | '( ( ?Y (float 1 24) "Yotta" ) | 261 | '( ( ?Y (^ 10 24) "Yotta" ) |
| 259 | ( ?Z (float 1 21) "Zetta" ) | 262 | ( ?Z (^ 10 21) "Zetta" ) |
| 260 | ( ?E (float 1 18) "Exa" ) | 263 | ( ?E (^ 10 18) "Exa" ) |
| 261 | ( ?P (float 1 15) "Peta" ) | 264 | ( ?P (^ 10 15) "Peta" ) |
| 262 | ( ?T (float 1 12) "Tera" ) | 265 | ( ?T (^ 10 12) "Tera" ) |
| 263 | ( ?G (float 1 9) "Giga" ) | 266 | ( ?G (^ 10 9) "Giga" ) |
| 264 | ( ?M (float 1 6) "Mega" ) | 267 | ( ?M (^ 10 6) "Mega" ) |
| 265 | ( ?k (float 1 3) "Kilo" ) | 268 | ( ?k (^ 10 3) "Kilo" ) |
| 266 | ( ?K (float 1 3) "Kilo" ) | 269 | ( ?K (^ 10 3) "Kilo" ) |
| 267 | ( ?h (float 1 2) "Hecto" ) | 270 | ( ?h (^ 10 2) "Hecto" ) |
| 268 | ( ?H (float 1 2) "Hecto" ) | 271 | ( ?H (^ 10 2) "Hecto" ) |
| 269 | ( ?D (float 1 1) "Deka" ) | 272 | ( ?D (^ 10 1) "Deka" ) |
| 270 | ( 0 (float 1 0) nil ) | 273 | ( 0 (^ 10 0) nil ) |
| 271 | ( ?d (float 1 -1) "Deci" ) | 274 | ( ?d (^ 10 -1) "Deci" ) |
| 272 | ( ?c (float 1 -2) "Centi" ) | 275 | ( ?c (^ 10 -2) "Centi" ) |
| 273 | ( ?m (float 1 -3) "Milli" ) | 276 | ( ?m (^ 10 -3) "Milli" ) |
| 274 | ( ?u (float 1 -6) "Micro" ) | 277 | ( ?u (^ 10 -6) "Micro" ) |
| 275 | ( ?n (float 1 -9) "Nano" ) | 278 | ( ?n (^ 10 -9) "Nano" ) |
| 276 | ( ?p (float 1 -12) "Pico" ) | 279 | ( ?p (^ 10 -12) "Pico" ) |
| 277 | ( ?f (float 1 -15) "Femto" ) | 280 | ( ?f (^ 10 -15) "Femto" ) |
| 278 | ( ?a (float 1 -18) "Atto" ) | 281 | ( ?a (^ 10 -18) "Atto" ) |
| 279 | ( ?z (float 1 -21) "zepto" ) | 282 | ( ?z (^ 10 -21) "zepto" ) |
| 280 | ( ?y (float 1 -24) "yocto" ))) | 283 | ( ?y (^ 10 -24) "yocto" ))) |
| 281 | 284 | ||
| 282 | (defvar math-standard-units-systems | 285 | (defvar math-standard-units-systems |
| 283 | '( ( base nil ) | 286 | '( ( base nil ) |
| 284 | ( si ( ( g '(* (var kg var-kg) (float 1 -3)) ) ) ) | 287 | ( si ( ( g '(/ (var kg var-kg) 1000) ) ) ) |
| 285 | ( mks ( ( g '(* (var kg var-kg) (float 1 -3)) ) ) ) | 288 | ( mks ( ( g '(/ (var kg var-kg) 1000) ) ) ) |
| 286 | ( cgs ( ( m '(* (var cm var-cm) 100 ) ) ) ))) | 289 | ( cgs ( ( m '(* (var cm var-cm) 100 ) ) ) ))) |
| 287 | 290 | ||
| 288 | (defvar math-units-table nil | 291 | (defvar math-units-table nil |
| 289 | "Internal units table derived from math-defined-units. | 292 | "Internal units table derived from math-defined-units. |
| @@ -337,9 +340,11 @@ Entries are (SYMBOL EXPR DOC-STRING TEMP-TYPE BASE-UNITS).") | |||
| 337 | If EXPR is nil, return nil." | 340 | If EXPR is nil, return nil." |
| 338 | (if expr | 341 | (if expr |
| 339 | (let ((cexpr (math-compose-expr expr 0))) | 342 | (let ((cexpr (math-compose-expr expr 0))) |
| 340 | (if (stringp cexpr) | 343 | (replace-regexp-in-string |
| 341 | cexpr | 344 | " / " "/" |
| 342 | (math-composition-to-string cexpr))))) | 345 | (if (stringp cexpr) |
| 346 | cexpr | ||
| 347 | (math-composition-to-string cexpr)))))) | ||
| 343 | 348 | ||
| 344 | (defvar math-default-units-table | 349 | (defvar math-default-units-table |
| 345 | (make-hash-table :test 'equal) | 350 | (make-hash-table :test 'equal) |