Expand description
121 mathematical, physical, and cryptographic constants as
compile-time const values. The const values are always
available, even in no_std. The runtime Constants lookup
API and ConstantValue enum require the std feature.
Structs§
- Constant
std - A single named constant with its string-encoded value.
Requires the
stdfeature. - Constants
std - Collection of 121 mathematical, physical, and cryptographic constants.
Requires the
stdfeature.
Enums§
- Category
- Constant category for
CONSTANTS_TABLE. - Constant
Value std - Enum to represent the different constant values.
Requires the
stdfeature.
Constants§
- ALPHA_
PARTICLE_ MASS - Alpha particle mass (CODATA 2018). m_α ≈ 6.6446573357e-27 kg
- APERY
- Apéry’s constant, which is the sum of the reciprocals of the positive cubes. ζ(3) ≈ 1.2020569032
- ATOMIC_
MASS_ UNIT - The unified atomic mass unit / dalton (CODATA 2018). u ≈ 1.66053906660 x 10^-27 kg
- ATOMIC_
MASS_ UNIT_ UNCERTAINTY - Standard uncertainty of
ATOMIC_MASS_UNIT. Source: CODATA 2018. - ATOMIC_
UNIT_ OF_ ELECTRIC_ FIELD - Atomic unit of electric field. E_h/(ea_0) ≈ 5.14220674763e11 V/m
- ATOMIC_
UNIT_ OF_ FORCE - Atomic unit of force. E_h/a_0 ≈ 8.2387234983e-8 N
- ATOMIC_
UNIT_ OF_ LENGTH - Atomic unit of length (= Bohr radius). a_0 ≈ 5.29177210903e-11 m
- ATOMIC_
UNIT_ OF_ POLARIZABILITY - Atomic unit of electric polarizability. e²a₀²/E_h ≈ 1.64877727436e-41 C²m²/J
- ATOMIC_
UNIT_ OF_ TIME - Atomic unit of time. ℏ/E_h ≈ 2.4188843265857e-17 s
- ATOMIC_
UNIT_ OF_ VELOCITY - Atomic unit of velocity. a_0 E_h/ℏ ≈ 2.18769126364e6 m/s
- AVOGADRO
- Avogadro’s constant (CODATA 2018, exact since 2019 SI). N_A = 6.02214076 x 10^23 mol^-1
- BOHR_
MAGNETON - Bohr magneton (CODATA 2018). μ_B = eℏ/(2m_e) ≈ 9.2740100783e-24 J/T
- BOHR_
RADIUS - The Bohr radius (CODATA 2018). a_0 ≈ 5.29177210903 x 10^-11 m
- BOHR_
RADIUS_ UNCERTAINTY - Standard uncertainty of
BOHR_RADIUS. Source: CODATA 2018. - BOLTZMANN
- Boltzmann’s constant (CODATA 2018, exact since 2019 SI). k_B = 1.380649 x 10^-23 J K^-1
- CATALAN
- Catalan’s constant, which is the sum of the alternating harmonic series. C ≈ 0.915965594177219
- CLASSICAL_
ELECTRON_ RADIUS - Classical electron radius (CODATA 2018). r_e = α²a_0 ≈ 2.8179403262e-15 m
- CONDUCTANCE_
QUANTUM - The conductance quantum (CODATA 2018, exact since 2019 SI). G_0 = 2e²/h = 7.748091729 x 10^-5 S
- CONSTANTS_
TABLE - A static lookup table of all named float constants.
- COULOMB
- Coulomb’s constant (CODATA 2018). k_e ≈ 8.9875517923 x 10^9 N m^2 C^-2
- COULOMB_
UNCERTAINTY - Standard uncertainty of
COULOMB. Source: CODATA 2018. - DEUTERON_
MASS - Deuteron mass (CODATA 2018). m_d ≈ 3.3435837724e-27 kg
- DEUTERON_
PROTON_ MASS_ RATIO - Deuteron-to-proton mass ratio (CODATA 2018). m_d / m_p ≈ 1.99900750139
- ELECTRON_
CHARGE_ TO_ MASS - Electron charge-to-mass quotient (CODATA 2018). e/m_e ≈ -1.75882001076e11 C/kg
- ELECTRON_
COMPTON_ WAVELENGTH - Compton wavelength of the electron (CODATA 2018). λ_C = h/(m_e c) ≈ 2.42631023867e-12 m
- ELECTRON_
G_ FACTOR - Electron g-factor (CODATA 2018). g_e ≈ -2.00231930436256
- ELECTRON_
MAGNETIC_ MOMENT - Electron magnetic moment (CODATA 2018). μ_e ≈ -9.2847647043e-24 J/T
- ELECTRON_
MASS - The rest mass of an electron (CODATA 2018). m_e ≈ 9.1093837015 x 10^-31 kg
- ELECTRON_
MASS_ MEV - Electron mass in MeV/c² (CODATA 2018). m_e c² ≈ 0.51099895000 MeV
- ELECTRON_
MASS_ UNCERTAINTY - Standard uncertainty of
ELECTRON_MASS. Source: CODATA 2018. - ELECTRON_
PROTON_ MASS_ RATIO - Electron-to-proton mass ratio (CODATA 2018). m_e / m_p ≈ 5.44617021487e-4
- ELECTRON_
REDUCED_ COMPTON - Reduced Compton wavelength of the electron. λ̄_e = ℏ/(m_e c) ≈ 3.8615926796e-13 m
- ELECTRON_
VOLT - Electron volt in joules (CODATA 2018, exact). 1 eV = 1.602176634e-19 J
- ELEMENTARY_
CHARGE - The elementary charge (CODATA 2018, exact since 2019 SI). e = 1.602176634 x 10^-19 C
- EULER
- The base of the natural logarithm, Euler’s number. e ≈ 2.7182818284590452353602874713527
- EV_
TO_ AMU - Electron volt–atomic mass unit relationship. 1 eV/c² ≈ 1.07354410233e-9 u
- EV_
TO_ HZ - Electron volt–hertz relationship (exact). 1 eV/h ≈ 2.417989242e14 Hz
- EV_
TO_ INVERSE_ METER - Electron volt–inverse meter relationship (exact). 1 eV/(hc) ≈ 8.065543937e5 /m
- EV_
TO_ KELVIN - Electron volt–kelvin relationship (exact). 1 eV/k_B ≈ 1.160451812e4 K
- EV_
TO_ KG - Electron volt–kilogram relationship (exact). 1 eV/c² ≈ 1.782661921e-36 kg
- FARADAY
- Faraday constant (CODATA 2018, exact since 2019 SI). F = N_A * e = 96485.33212 C mol^-1
- FINE_
STRUCTURE - The fine-structure constant (CODATA 2018). α ≈ 7.2973525693 x 10^-3 (dimensionless)
- FINE_
STRUCTURE_ UNCERTAINTY - Standard uncertainty of
FINE_STRUCTURE. Source: CODATA 2018. - FIRST_
RADIATION_ CONSTANT - First radiation constant (CODATA 2018). c_1 = 2πhc² ≈ 3.741771852e-16 W m²
- FRAC_
1_ PI - The reciprocal of pi. 1/π ≈ 0.3183098861837907
- FRAC_
1_ SQRT_ 2 - The reciprocal of the square root of 2. 1/√2 ≈ 0.7071067811865476
- FRAC_
2_ PI - Two divided by pi. 2/π ≈ 0.6366197723675814
- FRAC_
2_ SQRT_ PI - Two divided by the square root of pi. 2/√π ≈ 1.1283791670955126
- FRAC_
PI_ 2 - Pi divided by 2 (a right angle in radians). π/2 ≈ 1.5707963267948966
- FRAC_
PI_ 3 - Pi divided by 3 (60 degrees in radians). π/3 ≈ 1.0471975511965979
- FRAC_
PI_ 4 - Pi divided by 4 (45 degrees in radians). π/4 ≈ 0.7853981633974483
- FRAC_
PI_ 6 - Pi divided by 6 (30 degrees in radians). π/6 ≈ 0.5235987755982989
- FRAC_
PI_ 8 - Pi divided by 8 (22.5 degrees in radians). π/8 ≈ 0.39269908169872414
- GAMMA
- The Euler-Mascheroni constant, which is the limiting difference between the harmonic series and the natural logarithm. γ ≈ 0.5772156649015329
- GAS_
CONSTANT - The molar gas constant (CODATA 2018, exact since 2019 SI). R = N_A * k_B = 8.314462618 J mol^-1 K^-1
- GAS_
CONSTANT_ L_ ATM - Molar gas constant in L·atm/(mol·K). R ≈ 0.08205736608 L·atm/(mol·K)
- GLAISHER_
KINKELIN - Glaisher-Kinkelin constant, which arises in the asymptotic expansion of the Barnes G-function. A ≈ 1.2824271291
- GRAVITATIONAL_
CONSTANT - The Newtonian gravitational constant (CODATA 2018). G ≈ 6.67430 x 10^-11 m^3 kg^-1 s^-2
- GRAVITATIONAL_
CONSTANT_ UNCERTAINTY - Standard uncertainty of
GRAVITATIONAL_CONSTANT. Source: CODATA 2018. - HARTREE_
ENERGY - Hartree energy (CODATA 2018). E_h = m_e c² α² ≈ 4.3597447222071e-18 J
- HARTREE_
ENERGY_ EV - Hartree energy in eV (CODATA 2018). E_h ≈ 27.211386245988 eV
- HASH_
ALGORITHM - The hash algorithm used. The default is Blake3.
- HASH_
COST - The cost of the hash algorithm. The default is 8.
- HASH_
LENGTH - The hash length is the length of the hash in bytes.
- HELION_
MASS - Helion (He-3 nucleus) mass (CODATA 2018). m_h ≈ 5.0064127796e-27 kg
- HIGGS_
BOSON_ MASS_ GEV - Higgs boson mass (PDG 2022). m_H ≈ 125.25 GeV/c²
- IMPEDANCE_
OF_ FREE_ SPACE - Impedance of free space (CODATA 2018). Z_0 = μ₀c ≈ 376.730313668 Ω
- INVERSE_
FINE_ STRUCTURE - Inverse fine-structure constant (CODATA 2018). 1/α ≈ 137.035999084
- JOSEPHSON_
CONSTANT - Josephson constant (CODATA 2018, exact since 2019 SI). K_J = 2e/h ≈ 4.835978484e14 Hz/V
- KHINCHIN
- Khinchin’s constant, which appears in the theory of continued fractions. K ≈ 2.6854520010
- LN_2
- The natural logarithm of 2. ln(2) ≈ 0.6931471805599453
- LN_10
- The natural logarithm of 10. ln(10) ≈ 2.302585092994046
- LOG2_E
- The base-2 logarithm of Euler’s number. log₂(e) ≈ 1.4426950408889634
- LOG10_E
- The base-10 logarithm of Euler’s number. log₁₀(e) ≈ 0.4342944819032518
- LOSCHMIDT_
CONSTANT - Loschmidt constant at 273.15 K, 101.325 kPa. n_0 ≈ 2.6867774e25 /m³
- MAGNETIC_
FLUX_ QUANTUM - The magnetic flux quantum (CODATA 2018, exact since 2019 SI). Φ_0 = h/(2e) = 2.067833848 x 10^-15 Wb
- MOLAR_
MASS_ CONSTANT - Molar mass constant (CODATA 2018). M_u ≈ 0.99999999965e-3 kg/mol
- MOLAR_
PLANCK_ CONSTANT - Molar Planck constant (exact). N_A h ≈ 3.990312712e-10 J s/mol
- MOLAR_
VOLUME_ IDEAL_ GAS - Molar volume of ideal gas at STP (273.15 K, 100 kPa). V_m ≈ 22.71095e-3 m³/mol
- MUON_
ELECTRON_ MASS_ RATIO - Muon-to-electron mass ratio (CODATA 2018). m_μ / m_e ≈ 206.7682830
- MUON_
MASS - Muon mass (CODATA 2018). m_μ ≈ 1.883531627e-28 kg
- MUON_
MASS_ MEV - Muon mass in MeV/c² (CODATA 2018). m_μ c² ≈ 105.6583755 MeV
- NEUTRON_
COMPTON_ WAVELENGTH - Compton wavelength of the neutron (CODATA 2018). λ_C,n = h/(m_n c) ≈ 1.31959090581e-15 m
- NEUTRON_
MAGNETIC_ MOMENT - Neutron magnetic moment (CODATA 2018). μ_n ≈ -9.6623651e-27 J/T
- NEUTRON_
MASS - The rest mass of a neutron (CODATA 2018). m_n ≈ 1.67492749804 x 10^-27 kg
- NEUTRON_
MASS_ MEV - Neutron mass in MeV/c² (CODATA 2018). m_n c² ≈ 939.56542052 MeV
- NEUTRON_
MASS_ UNCERTAINTY - Standard uncertainty of
NEUTRON_MASS. Source: CODATA 2018. - NEUTRON_
PROTON_ MASS_ RATIO - Neutron-to-proton mass ratio (CODATA 2018). m_n / m_p ≈ 1.00137841931
- NEUTRON_
REDUCED_ COMPTON - Reduced Compton wavelength of the neutron. λ̄_n = ℏ/(m_n c) ≈ 2.10019415600e-16 m
- NUCLEAR_
MAGNETON - Nuclear magneton (CODATA 2018). μ_N = eℏ/(2m_p) ≈ 5.0507837461e-27 J/T
- PHI
- The golden ratio, which is the limit of the ratio of consecutive Fibonacci numbers. φ = (1 + √5) / 2 ≈ 1.6180339887498948482045868343656
- PI
- The ratio of a circle’s circumference to its diameter. π ≈ 3.14159265358979323846264338327950288
- PLANCK
- Planck’s constant (CODATA 2018, exact since 2019 SI). h = 6.62607015 x 10^-34 J s
- PLANCK_
CHARGE - Planck charge. q_P = √(4πε₀ℏc) ≈ 1.875546e-18 C
- PLANCK_
LENGTH - Planck length. l_P = √(ℏG/c³) ≈ 1.616255e-35 m
- PLANCK_
MASS - Planck mass. m_P = √(ℏc/G) ≈ 2.176434e-8 kg
- PLANCK_
REDUCED - Planck’s reduced constant, which is Planck’s constant divided by 2π. ħ = h / (2π) ≈ 1.054571817 x 10^-34 J s
- PLANCK_
TEMPERATURE - Planck temperature. T_P = m_P c²/k_B ≈ 1.416784e32 K
- PLANCK_
TIME - Planck time. t_P = √(ℏG/c⁵) ≈ 5.391247e-44 s
- PROTON_
CHARGE_ TO_ MASS - Proton charge-to-mass quotient (CODATA 2018). e/m_p ≈ 9.5788332e7 C/kg
- PROTON_
COMPTON_ WAVELENGTH - Compton wavelength of the proton (CODATA 2018). λ_C,p = h/(m_p c) ≈ 1.32140985539e-15 m
- PROTON_
ELECTRON_ MASS_ RATIO - Proton-to-electron mass ratio (CODATA 2018). m_p / m_e ≈ 1836.15267343
- PROTON_
G_ FACTOR - Proton g-factor (CODATA 2018). g_p ≈ 5.5856946893
- PROTON_
MAGNETIC_ MOMENT - Proton magnetic moment (CODATA 2018). μ_p ≈ 1.41060679736e-26 J/T
- PROTON_
MASS - The rest mass of a proton (CODATA 2018). m_p ≈ 1.67262192369 x 10^-27 kg
- PROTON_
MASS_ MEV - Proton mass in MeV/c² (CODATA 2018). m_p c² ≈ 938.27208816 MeV
- PROTON_
MASS_ UNCERTAINTY - Standard uncertainty of
PROTON_MASS. Source: CODATA 2018. - PROTON_
REDUCED_ COMPTON - Reduced Compton wavelength of the proton. λ̄_p = ℏ/(m_p c) ≈ 2.10308910336e-16 m
- RYDBERG
- The Rydberg constant (CODATA 2018). R∞ ≈ 10973731.568160 m^-1
- RYDBERG_
UNCERTAINTY - Standard uncertainty of
RYDBERG. Source: CODATA 2018. - SACKUR_
TETRODE_ CONSTANT - Sackur-Tetrode constant at 1 K, 101.325 kPa. S_0/R ≈ -1.15170753706
- SECOND_
RADIATION_ CONSTANT - Second radiation constant (CODATA 2018). c_2 = hc/k_B ≈ 1.438776877e-2 m K
- SILVER_
RATIO - The silver ratio, which is one of the silver means. δ_s = 1 + √2 ≈ 2.4142135623730950488016887242097
- SPECIAL_
CHARS - A set of special characters.
- SPEED_
OF_ LIGHT - The speed of light in vacuum (exact since 1983 SI definition). c = 299792458 m s^-1
- SQRT2
- The square root of 2. √2 ≈ 1.4142135623730950488016887242097
- SQRT3
- The square root of 3. √3 ≈ 1.7320508075688772935274463415059
- SQRT5
- The square root of 5. √5 ≈ 2.23606797749979
- STANDARD_
ATMOSPHERE - Standard atmosphere pressure (exact by definition). atm = 101325 Pa
- STANDARD_
GRAVITY - Standard acceleration of gravity (exact by definition). g = 9.80665 m s^-2
- STEFAN_
BOLTZMANN - The Stefan-Boltzmann constant (CODATA 2018, exact since 2019 SI). σ = 5.670374419 x 10^-8 W m^-2 K^-4
- TAU
- The circle constant, which is the ratio of a circle’s circumference to its radius. τ = 2π ≈ 6.28318530717958647692528676655900577
- TAU_
PARTICLE_ MASS - Tau lepton mass (CODATA 2018). m_τ ≈ 3.16754e-27 kg
- THOMSON_
CROSS_ SECTION - Thomson cross section (CODATA 2018). σ_T = (8π/3)r_e² ≈ 6.6524587321e-29 m²
- TRITON_
MASS - Triton mass (CODATA 2018). m_t ≈ 5.0073567446e-27 kg
- VACUUM_
PERMEABILITY - The vacuum permeability (CODATA 2018). μ_0 ≈ 1.25663706212 x 10^-6 N A^-2
- VACUUM_
PERMEABILITY_ UNCERTAINTY - Standard uncertainty of
VACUUM_PERMEABILITY. Source: CODATA 2018. - VACUUM_
PERMITTIVITY - The vacuum permittivity (CODATA 2018). ε_0 ≈ 8.8541878128 x 10^-12 F m^-1
- VACUUM_
PERMITTIVITY_ UNCERTAINTY - Standard uncertainty of
VACUUM_PERMITTIVITY. Source: CODATA 2018. - VON_
KLITZING_ CONSTANT - Von Klitzing constant (CODATA 2018, exact since 2019 SI). R_K = h/e² ≈ 25812.80745 Ω
- WIEN_
DISPLACEMENT - Wien’s displacement constant (CODATA 2018). b ≈ 2.897771955 x 10^-3 m K
- WIEN_
DISPLACEMENT_ UNCERTAINTY - Standard uncertainty of
WIEN_DISPLACEMENT. Source: CODATA 2018. - W_
BOSON_ MASS_ GEV - W boson mass (PDG 2022). m_W ≈ 80.377 GeV/c²
- Z_
BOSON_ MASS_ GEV - Z boson mass (PDG 2022). m_Z ≈ 91.1876 GeV/c²