Constant
Constant is a term with multiple meanings. In science and mathematics, it refers to a fixed value that does not change, such as mathematical constants like π (the ratio of a circle's circumference to its diameter) or physical constants like the speed of light c = 299,792,458 m/s.[1][2] The term is also used in computing and logic for invariant elements, as well as for names of people, places, and works in arts and entertainment.[3]Mathematics
Mathematical constants
In mathematics, a constant is a fixed real number that arises naturally in various contexts and exhibits special properties, often being irrational or transcendental, making it significantly interesting for theoretical study.[4] These constants are typically well-defined through limits, ratios, or infinite processes and play foundational roles in geometry, analysis, and number theory. Unlike variables, they remain invariant across equations and theorems, providing universal benchmarks for mathematical expressions. A prominent example is \pi (pi), defined as the ratio of a circle's circumference to its diameter, with approximate value $3.14159.[5] [Archimedes](/page/Archimedes) provided the first known systematic approximation in the [3rd century](/page/3rd_century) BCE by inscribing and circumscribing [regular](/page/Regular) polygons around a [circle](/page/Circle), establishing that \pilies between3\frac{10}{71} (approximately $3.14085) and $3\frac{1}{7} (approximately $3.14286).[5] The irrationality of \piwas first rigorously proved by [Johann Heinrich Lambert](/page/Johann_Heinrich_Lambert) in 1761 using continued fractions, with subsequent proofs by [Adrien-Marie Legendre](/page/Adrien-Marie_Legendre) in 1794 and Charles Hermite in 1873 confirming its transcendence.[5]\piis computable through series expansions, such as the Leibniz formula\pi/4 = \sum_{n=0}^{\infty} (-1)^n / (2n+1), allowing arbitrary precision approximations. In [pure mathematics](/page/Pure_mathematics), \piis essential in [circle](/page/Circle) geometry, trigonometric identities, [Fourier analysis](/page/Fourier_analysis) via integrals like the Gaussian\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}$, and number theory through connections to the Riemann zeta function.[5][6] Another key constant is e (Euler's number), the base of the natural logarithm, approximately $2.71828, defined as the [limit](/page/Limit) \lim_{n \to \infty} (1 + 1/n)^nor via its seriese = \sum_{n=0}^{\infty} 1/n!.[7] Leonhard Euler introduced ein the [18th century](/page/18th_century), notably in his 1731 work *Mechanica* and later explorations of [infinite](/page/Infinite) series, recognizing its role in [exponential growth](/page/Exponential_growth) and [calculus](/page/Calculus).[7] Euler himself provided an early proof ofe's [irrationality](/page/Irrationality) in 1737 using its [continued fraction](/page/Continued_fraction) expansion, with a modern series-based proof by [Joseph Fourier](/page/Joseph_Fourier) emphasizing its non-repeating decimal nature.[](https://digitalcommons.ursinus.edu/cgi/viewcontent.cgi?article=1014&context=triumphs_calculus) Like \pi, eis transcendental, as proved by Charles Hermite in 1873, and is computable to high precision via its rapidly converging [Taylor series](/page/Taylor_series). Applications in [pure mathematics](/page/Pure_mathematics) include Taylor expansions for functions like\sin xand\cos x, differential equations modeling continuous [compounding](/page/Compounding), and [complex analysis](/page/Complex_analysis) through [Euler's formula](/page/Euler's_formula) e^{i\pi} + 1 = 0, linking eand\pi$ in profound ways.[7] The Euler-Mascheroni constant \gamma, approximately $0.57721, emerges from the harmonic series as the limit \gamma = \lim_{n \to \infty} (H_n - \ln n), where H_n = \sum_{k=1}^n 1/kis thenth [harmonic number](/page/Harmonic_number).[8] Euler first defined and computed \gammain 1735, describing it as worthy of serious consideration for its appearance in [divergent series](/page/Divergent_series) and [integral](/page/Integral)s, with Lorenzo Mascheroni later refining its value to 32 decimal places in 1790.[8] While\gammais believed to be [irrational](/page/The_Irrational) and possibly transcendental, this remains unproven despite extensive computational [evidence](/page/Evidence) up to trillions of digits. It is computable through accelerated series or [integral](/page/Integral) representations like\gamma = -\int_0^{\infty} e^{-t} \ln(\ln(1 + 1/t)) dt. In pure mathematics, \gammafeatures in the [digamma function](/page/Digamma_function)\psi(1) = -\gamma, the gamma function's [asymptotic expansion](/page/Asymptotic_expansion) via the [Stirling](/page/Stirling) approximation n! \sim \sqrt{2\pi n} (n/e)^n e^{\gamma + 1/(12n) - \cdots}$, harmonic number theory, and zeta function regularizations, underscoring its ubiquity in analytic number theory.[8]Constant functions and equations
In mathematics, a constant function is defined as a function f: D \to \mathbb{R} where D is the domain, such that f(x) = c for all x \in D and some fixed real number c.[4] This means the output remains unchanged regardless of the input value within the domain. The graph of a constant function is a horizontal line at height c, reflecting its uniformity across the real line or any specified interval. Constant functions exhibit several key properties that make them fundamental in analysis. Their derivative is zero everywhere in the domain, as the constant rule of differentiation states that \frac{d}{dx}(c) = 0, indicating no rate of change./03%3A_Derivatives/3.03%3A_Differentiation_Rules) They are continuous on their entire domain and serve as basic examples in studying limits, where \lim_{x \to a} f(x) = c holds for any a./01%3A_Functions_and_Graphs/1.02%3A_Basic_Classes_of_Functions) Additionally, constant functions are both injective and surjective only in trivial cases, such as when the domain is a singleton set, but generally they are neither.[9] Constant equations arise when an equation does not depend on the variable, such as ax + b = c where the coefficient a = 0. In this case, the equation simplifies to b = c, which is independent of x; if b = c, it holds for all x (infinite solutions), and if b \neq c, there are no solutions, representing a trivial or degenerate case./02%3A_Linear_Equations_and_Inequalities_in_One_Variable/2.02%3A_Solve_Linear_Equations) These equations highlight inconsistencies or identities without variable influence, contrasting with non-degenerate forms where solutions vary. Examples of constant functions include constant polynomials, which are polynomials of degree 0, expressed as p(x) = c where c \neq 0 (the zero polynomial p(x) = 0 is a special case often assigned undefined or -\infty degree)./03%3A_Polynomial_and_Rational_Functions/3.01%3A_Power_Functions) Step functions, being piecewise constant, can approximate constant functions exactly over intervals by having a single constant piece, though they are more generally used for discontinuous approximations in integration theory.[10] In applications, constant functions simplify the analysis of differential equations by providing equilibrium or steady-state solutions, where the derivative is zero, such as y' = 0 yielding y(x) = c.[11] They model steady-state systems in mathematical modeling, where variables reach a fixed value over time, aiding in the decomposition of transient and long-term behaviors.[11]Physical sciences
Physical constants
Physical constants are fundamental quantities in physics that characterize the basic interactions and properties of the universe, remaining invariant under changes in location, time, or reference frame. These constants are typically dimensioned, meaning they carry units, and their values are determined through precise experiments rather than derived purely from theory. Unlike mathematical constants, which are abstract and dimensionless, physical constants bridge theory and observation, enabling the formulation of universal laws such as those in relativity, quantum mechanics, and gravitation. A prime example is the speed of light in vacuum, c, defined exactly as $299792458 m/s since the 1983 revision of the International System of Units (SI), where it serves to define the meter itself. This exact value was established after historical measurements refined it to high precision, such as those using laser interferometry in the 1970s, which achieved accuracies better than 1 m/s by comparing laser wavelengths to known distances.[12][13] In special relativity, c appears in Einstein's mass-energy equivalence principle, E = mc^2, linking energy and mass through this invariant speed limit for information and causality.[14] Another key constant is Planck's constant, h, fixed exactly at $6.62607015 \times 10^{-34} J s following the 2019 SI redefinition, which anchors the kilogram and other units to fundamental invariants. It quantifies the scale of quantum effects, appearing in the energy of photons as E = h\nu, where \nu is frequency, and underpins quantization in quantum mechanics. In quantum field theory, h (or its reduced form \hbar = h / 2\pi) sets the fundamental commutation relations for fields, distinguishing quantum fluctuations from classical behavior.[12][15][16] The gravitational constant, G, governs the strength of gravity in Newton's law of universal gravitation, F = G \frac{m_1 m_2}{r^2}, with the 2022 CODATA value of $6.67430 \times 10^{-11} m³ kg⁻¹ s⁻² and a relative uncertainty of about 22 parts per million, reflecting challenges in precise measurement due to gravity's weakness. The fine-structure constant, \alpha, a dimensionless measure of electromagnetic interaction strength approximately $7.2973525693 \times 10^{-3} (or \approx 1/137.036) with a relative uncertainty of $1.6 \times 10^{-10}, arises in quantum electrodynamics to describe phenomena like atomic spectral fine structure and the coupling between charged particles and photons.[12][17] These values are periodically adjusted by the Committee on Data for Science and Technology (CODATA), with the 2022 recommendations incorporating global experimental data to minimize uncertainties, as seen in ongoing refinements for G via torsion balance experiments and for \alpha through quantum Hall effect and anomalous magnetic moment measurements. The 2019 SI redefinition fixed seven constants—including c, h, and others like the elementary charge e—to ensure stability and universality, eliminating reliance on physical artifacts like the prototype kilogram.[15]Other scientific constants
In scientific experiments across chemistry and biology, constants often refer to fixed parameters or derived values that remain stable under specific conditions to enable precise analysis. These include control variables, which are deliberately held constant to isolate the effects of manipulated factors, and experimentally determined constants like equilibrium values in chemical reactions or affinity measures in biochemical processes. Such constants provide foundational benchmarks for understanding reaction dynamics, molecular interactions, and system behaviors in applied sciences.[18] Control variables, also known as scientific constants in experimental design, are factors maintained at a fixed level to prevent them from influencing the outcome and to ensure that observed changes result solely from the independent variable. For instance, in studies of reaction rates, temperature is often controlled as a constant to isolate the impact of concentration variations on kinetics. This practice is essential in experimental design, allowing researchers to attribute results reliably to specific variables while minimizing confounding effects.[18][19] In chemistry, the equilibrium constant K, a key constant for reversible reactions, quantifies the ratio of product to reactant concentrations at equilibrium under constant temperature and pressure. For the Haber-Bosch process, which synthesizes ammonia from nitrogen and hydrogen (\ce{N2 + 3H2 ⇌ 2NH3}), K = \frac{[\ce{NH3}]^2}{[\ce{N2}][\ce{H2}]^3}, with its value decreasing at higher temperatures due to the exothermic nature of the reaction, guiding industrial optimization./31%3A_Solids_and_Surface_Chemistry/31.10%3A_The_Haber-Bosch_Reaction_Can_Be_Surface_Catalyzed)[20] Another fundamental chemical constant is Avogadro's number N_A = 6.02214076 \times 10^{23} \, \mathrm{mol}^{-1}, which defines the number of particles (atoms, molecules, or ions) in one mole, serving as a bridge between microscopic particle counts and macroscopic quantities in stoichiometric calculations.[21] The Faraday constant F \approx 96485 \, \mathrm{C/mol} is crucial in electrochemistry, representing the charge of one mole of electrons and enabling conversions between electrical quantities and chemical reaction extents in processes like electrolysis.[22] Biological constants extend these principles to living systems, where the universal gas constant R \approx 8.314 \, \mathrm{J \cdot mol^{-1} \cdot K^{-1}} appears in the ideal gas law applied to biophysical contexts, such as gas exchange in respiration, and is derived from the Boltzmann constant scaled by Avogadro's number. In enzyme kinetics, the Michaelis constant K_m measures an enzyme's substrate affinity, defined as the substrate concentration at which the reaction velocity reaches half its maximum value (V_{\max}); lower K_m values indicate higher affinity, influencing metabolic efficiency in cellular processes.[23][24] Representative examples highlight the context-specific nature of these constants. The pH of pure water at 25°C is 7.0, reflecting equal concentrations of hydrogen and hydroxide ions ($10^{-7} \, \mathrm{M} each) in neutral equilibrium, a standard reference for acidity measurements in aqueous solutions. These constants underpin applications in thermodynamics, where the equilibrium constant relates to Gibbs free energy via \Delta G = -RT \ln K, determining reaction spontaneity and feasibility in both chemical syntheses and biological pathways, while also informing robust experimental designs to replicate natural conditions.[25]/7%3A_Equilibrium_and_Thermodynamics/7.11%3A_Gibbs_Free_Energy_and_Equilibrium)Computing and logic
Programming constants
In computer programming, constants are immutable values bound to identifiers, ensuring they remain unchanged throughout program execution to promote code reliability and clarity. These fixed values can be evaluated at compile time or runtime, depending on the language, and are essential for defining parameters that should not vary, such as configuration limits or algorithmic thresholds.[26] Different programming languages implement constants through specific syntax and conventions. In C and C++, theconst keyword declares a constant variable, enforcing immutability at compile time; for example, const int MAX_SIZE = 100; prevents reassignment and allows optimization by the compiler. Python lacks enforced constants but follows the PEP 8 style guide by using uppercase names with underscores for variables intended as unchanging, such as MAX_SIZE = 100, relying on developer discipline rather than runtime checks.[27] In Java, the final keyword creates constants, often combined with static for class-level immutability, as in public static final int MAX_SIZE = 100;, which supports compile-time evaluation and inheritance restrictions. Rust uses the const keyword for compile-time constants with explicit typing, like const MAX_SIZE: i32 = 100;, distinguishing them from static for runtime-global data.[26]
Constants are categorized into several types based on their form and usage. Literal constants are unnamed fixed values directly embedded in code, such as the integer 42 or string "hello", which provide immediate but opaque representations. Symbolic constants assign meaningful names to literals for better readability, exemplified by const double PI = 3.14159; in C++ or JavaScript's const PI = 3.14159;. Enumerated constants group related values using enum constructs, as in C#'s enum Color { Red, Green, Blue }; or C++'s equivalent, enabling type-safe selections without raw integers. These types support both compile-time (e.g., in Rust and C++) and runtime (e.g., in Python) evaluation, with compile-time variants allowing optimizations like inlining.[28]
Using constants offers key benefits in software development, including enhanced code maintainability by centralizing changes—updating a single definition propagates everywhere—and error prevention through immutability, which avoids accidental modifications or "magic numbers" that obscure intent. They also improve readability and type safety, as symbolic names clarify purpose (e.g., BUFFER_SIZE over 1024), and in compiled languages, enable optimizations like constant folding during compilation.[29]
In modern applications, constants are prevalent in AI and machine learning for defining hyperparameters like learning rates, such as LEARNING_RATE = 0.001 in PyTorch optimizers, ensuring consistent model training without runtime alterations. In August 2025, Rust 1.89.0 stabilized explicitly inferred arguments to const generics, allowing the use of _ to infer const generic parameters in various contexts, including within const fn for more flexible compile-time computations such as array sizes. For example, this enables usage like const fn create_array<const N: usize>() -> [u8; _] { [0u8; N] } where the size can be inferred from context.[30]
Representative examples include defining buffer limits as const MAX_BUFFER_SIZE: usize = 1024; in Rust for memory allocation or final int MAX_BUFFER_SIZE = 1024; in Java to cap data structures, distinguishing compile-time enforcement (Rust, C++) from runtime conventions (Python). Logical constants like true and false may appear in code for boolean expressions, bridging to formal logic implementations.[31]