units::constants
On this page
Physical constants: the seven defining constants of the SI and the
exact values derived from them (CODATA 2018, unchanged in 2022), and
the measured ones from the CODATA 2022 adjustment. Each is a
Quantity constant; codata() lists them with their standard
uncertainties.
Structs
CodataSource
pub struct CodataA CODATA value with its standard uncertainty.
let g = units::constants::lookup("G") ?? panic("G");
assert(!g.exact && g.uncertainty == 0.00015e-11);
assert((g.relative_uncertainty() - 2.2474e-5).abs() < 1e-8);
The usual symbol (
"ħ","N_A").The CODATA name.
The value in the SI unit
unit.The standard uncertainty (0 for an exact value).
The SI unit of
value.Whether the value is exact by the definition of the SI.
uncertainty / |value|.nabiassert((units::constants::lookup("c") ?? panic("c")).relative_uncertainty() == 0.0);
Functions
codataSource
pub fn codata() -> List<Codata> Every constant of this module, with its uncertainty.
assert(units::constants::codata().len() >= 20);
lookupSource
pub fn lookup(text: str) -> Codata | none The constant with symbol or name text ("h", "ħ", "electron mass").
assert((units::constants::lookup("electron mass") ?? panic("m_e")).symbol == "m_e");
Constants
cSource
pub const c: Quantity<f64, 1, 0, -1, 0, 0, 0, 0> = Quantity { value: 299792458.0 }c, the speed of light in vacuum: 299792458.0 m/s (exact).
assert(units::constants::c.value == (units::constants::lookup("c") ?? panic("c")).value);
hSource
pub const h: Quantity<f64, 2, 1, -1, 0, 0, 0, 0> = Quantity { value: 6.62607015e-34 }h, the Planck constant: 6.62607015e-34 J·s (exact).
assert(units::constants::h.value == (units::constants::lookup("h") ?? panic("h")).value);
hbarSource
pub const hbar: Quantity<f64, 2, 1, -1, 0, 0, 0, 0> = Quantity { value: 6.62607015e-34 / (2.0 * f64::PI) }ħ, the reduced Planck constant: 6.62607015e-34 / (2.0 * pi) J·s (exact).
assert(units::constants::hbar.value == (units::constants::lookup("ħ") ?? panic("ħ")).value);
ħSource
pub const ħ: Quantity<f64, 2, 1, -1, 0, 0, 0, 0> = hbarhbar under its symbol.
assert(units::constants::ħ == units::constants::hbar);
eSource
pub const e: Quantity<f64, 0, 0, 1, 1, 0, 0, 0> = Quantity { value: 1.602176634e-19 }e, the elementary charge: 1.602176634e-19 C (exact).
assert(units::constants::e.value == (units::constants::lookup("e") ?? panic("e")).value);
k_BSource
pub const k_B: Quantity<f64, 2, 1, -2, 0, -1, 0, 0> = Quantity { value: 1.380649e-23 }k, the Boltzmann constant: 1.380649e-23 J/K (exact).
assert(units::constants::k_B.value == (units::constants::lookup("k") ?? panic("k")).value);
N_ASource
pub const N_A: Quantity<f64, 0, 0, 0, 0, 0, -1, 0> = Quantity { value: 6.02214076e23 }N_A, the Avogadro constant: 6.02214076e23 1/mol (exact).
assert(units::constants::N_A.value == (units::constants::lookup("N_A") ?? panic("N_A")).value);
delta_nu_CsSource
pub const delta_nu_Cs: Quantity<f64, 0, 0, -1, 0, 0, 0, 0> = Quantity { value: 9192631770.0 }Δν_Cs, the hyperfine transition frequency of Cs-133: 9192631770.0 Hz (exact).
assert(units::constants::delta_nu_Cs.value == (units::constants::lookup("Δν_Cs") ?? panic("Δν_Cs")).value);
K_cdSource
pub const K_cd: Quantity<f64, -2, -1, 3, 0, 0, 0, 1> = Quantity { value: 683.0 }K_cd, the luminous efficacy of 540 THz radiation: 683.0 lm/W (exact).
assert(units::constants::K_cd.value == (units::constants::lookup("K_cd") ?? panic("K_cd")).value);
RSource
pub const R: Quantity<f64, 2, 1, -2, 0, -1, -1, 0> = Quantity { value: 6.02214076e23 * 1.380649e-23 }R, the molar gas constant: 6.02214076e23 * 1.380649e-23 J/(mol·K) (exact).
assert(units::constants::R.value == (units::constants::lookup("R") ?? panic("R")).value);
FSource
pub const F: Quantity<f64, 0, 0, 1, 1, 0, -1, 0> = Quantity { value: 6.02214076e23 * 1.602176634e-19 }F, the Faraday constant: 6.02214076e23 * 1.602176634e-19 C/mol (exact).
assert(units::constants::F.value == (units::constants::lookup("F") ?? panic("F")).value);
sigmaSource
pub const sigma: Quantity<f64, 0, 1, -3, 0, -4, 0, 0> = Quantity { value: 5.670374419184429453970996731889e-8 }σ, the Stefan-Boltzmann constant: 5.670374419184429453970996731889e-8 W/(m²·K⁴) (exact).
assert(units::constants::sigma.value == (units::constants::lookup("σ") ?? panic("σ")).value);
σSource
pub const σ: Quantity<f64, 0, 1, -3, 0, -4, 0, 0> = sigmasigma under its symbol.
assert(units::constants::σ == units::constants::sigma);
GSource
pub const G: Quantity<f64, 3, -1, -2, 0, 0, 0, 0> = Quantity { value: 6.67430e-11 }G, the Newtonian constant of gravitation: 6.67430e-11 m³/(kg·s²) (CODATA 2022, standard uncertainty 0.00015e-11).
assert(units::constants::G.value == (units::constants::lookup("G") ?? panic("G")).value);
g_nSource
pub const g_n: Quantity<f64, 1, 0, -2, 0, 0, 0, 0> = Quantity { value: 9.80665 }g_n, the standard acceleration of gravity: 9.80665 m/s² (exact).
assert(units::constants::g_n.value == (units::constants::lookup("g_n") ?? panic("g_n")).value);
alphaSource
pub const alpha: Quantity<f64, 0, 0, 0, 0, 0, 0, 0> = Quantity { value: 7.2973525643e-3 }α, the fine-structure constant: 7.2973525643e-3 1 (CODATA 2022, standard uncertainty 0.0000000011e-3).
assert(units::constants::alpha.value == (units::constants::lookup("α") ?? panic("α")).value);
αSource
pub const α: Quantity<f64, 0, 0, 0, 0, 0, 0, 0> = alphaalpha under its symbol.
assert(units::constants::α == units::constants::alpha);
mu_0Source
pub const mu_0: Quantity<f64, 1, 1, -2, -2, 0, 0, 0> = Quantity { value: 1.25663706127e-6 }μ₀, the vacuum magnetic permeability: 1.25663706127e-6 N/A² (CODATA 2022, standard uncertainty 0.00000000020e-6).
assert(units::constants::mu_0.value == (units::constants::lookup("μ₀") ?? panic("μ₀")).value);
μ₀Source
pub const μ₀: Quantity<f64, 1, 1, -2, -2, 0, 0, 0> = mu_0mu_0 under its symbol.
assert(units::constants::μ₀ == units::constants::mu_0);
epsilon_0Source
pub const epsilon_0: Quantity<f64, -3, -1, 4, 2, 0, 0, 0> = Quantity { value: 8.8541878188e-12 }ε₀, the vacuum electric permittivity: 8.8541878188e-12 F/m (CODATA 2022, standard uncertainty 0.0000000014e-12).
assert(units::constants::epsilon_0.value == (units::constants::lookup("ε₀") ?? panic("ε₀")).value);
ε₀Source
pub const ε₀: Quantity<f64, -3, -1, 4, 2, 0, 0, 0> = epsilon_0epsilon_0 under its symbol.
assert(units::constants::ε₀ == units::constants::epsilon_0);
Z_0Source
pub const Z_0: Quantity<f64, 2, 1, -3, -2, 0, 0, 0> = Quantity { value: 376.730313412 }Z₀, the characteristic impedance of vacuum: 376.730313412 Ω (CODATA 2022, standard uncertainty 0.000000059).
assert(units::constants::Z_0.value == (units::constants::lookup("Z₀") ?? panic("Z₀")).value);
m_eSource
pub const m_e: Quantity<f64, 0, 1, 0, 0, 0, 0, 0> = Quantity { value: 9.1093837139e-31 }m_e, the electron mass: 9.1093837139e-31 kg (CODATA 2022, standard uncertainty 0.0000000028e-31).
assert(units::constants::m_e.value == (units::constants::lookup("m_e") ?? panic("m_e")).value);
m_pSource
pub const m_p: Quantity<f64, 0, 1, 0, 0, 0, 0, 0> = Quantity { value: 1.67262192595e-27 }m_p, the proton mass: 1.67262192595e-27 kg (CODATA 2022, standard uncertainty 0.00000000052e-27).
assert(units::constants::m_p.value == (units::constants::lookup("m_p") ?? panic("m_p")).value);
m_nSource
pub const m_n: Quantity<f64, 0, 1, 0, 0, 0, 0, 0> = Quantity { value: 1.67492750056e-27 }m_n, the neutron mass: 1.67492750056e-27 kg (CODATA 2022, standard uncertainty 0.00000000085e-27).
assert(units::constants::m_n.value == (units::constants::lookup("m_n") ?? panic("m_n")).value);
m_uSource
pub const m_u: Quantity<f64, 0, 1, 0, 0, 0, 0, 0> = Quantity { value: 1.66053906892e-27 }m_u, the atomic mass constant: 1.66053906892e-27 kg (CODATA 2022, standard uncertainty 0.00000000052e-27).
assert(units::constants::m_u.value == (units::constants::lookup("m_u") ?? panic("m_u")).value);
a_0Source
pub const a_0: Quantity<f64, 1, 0, 0, 0, 0, 0, 0> = Quantity { value: 5.29177210544e-11 }a_0, the Bohr radius: 5.29177210544e-11 m (CODATA 2022, standard uncertainty 0.00000000082e-11).
assert(units::constants::a_0.value == (units::constants::lookup("a_0") ?? panic("a_0")).value);
R_infSource
pub const R_inf: Quantity<f64, -1, 0, 0, 0, 0, 0, 0> = Quantity { value: 10973731.568157 }R_∞, the Rydberg constant: 10973731.568157 1/m (CODATA 2022, standard uncertainty 0.000012).
assert(units::constants::R_inf.value == (units::constants::lookup("R_∞") ?? panic("R_∞")).value);
mu_BSource
pub const mu_B: Quantity<f64, 2, 0, 0, 1, 0, 0, 0> = Quantity { value: 9.2740100657e-24 }μ_B, the Bohr magneton: 9.2740100657e-24 J/T (CODATA 2022, standard uncertainty 0.0000000029e-24).
assert(units::constants::mu_B.value == (units::constants::lookup("μ_B") ?? panic("μ_B")).value);
r_eSource
pub const r_e: Quantity<f64, 1, 0, 0, 0, 0, 0, 0> = Quantity { value: 2.8179403205e-15 }r_e, the classical electron radius: 2.8179403205e-15 m (CODATA 2022, standard uncertainty 0.0000000013e-15).
assert(units::constants::r_e.value == (units::constants::lookup("r_e") ?? panic("r_e")).value);
atmSource
pub const atm: Quantity<f64, -1, 1, -2, 0, 0, 0, 0> = Quantity { value: 101325.0 }atm, the standard atmosphere: 101325.0 Pa (exact).
assert(units::constants::atm.value == (units::constants::lookup("atm") ?? panic("atm")).value);
eVSource
pub const eV: Quantity<f64, 2, 1, -2, 0, 0, 0, 0> = Quantity { value: 1.602176634e-19 }eV, the electronvolt: 1.602176634e-19 J (exact).
assert(units::constants::eV.value == (units::constants::lookup("eV") ?? panic("eV")).value);