Boost C++ Libraries Home Libraries People FAQ More

PrevUpHomeNext

The Mathematical Constants

This section lists the mathematical constants, their use(s) (and sometimes rationale for their inclusion).

Table 4.1. Mathematical Constants

name

formula

Value (6 decimals)

Uses and Rationale

Rational fractions

half

1/2

0.5

third

1/3

0.333333

two_thirds

2/3

0.66667

three_quarters

3/4

0.75

two and related

root_two

√2

1.41421

Equivalent to POSIX constant M_SQRT2

root_three

√3

1.73205

half_root_two

√2 /2

0.707106

ln_two

ln(2)

0.693147

Equivalent to POSIX constant M_LN2

ln_ten

ln(10)

2.30258

Equivalent to POSIX constant M_LN10

ln_ln_two

ln(ln(2))

-0.366512

Gumbel distribution median

root_ln_four

√ln(4)

1.177410

one_div_root_two

1/√2

0.707106

Equivalent to POSIX constant M_SQRT1_2

π and related

pi

pi

3.14159

Ubiquitous. Archimedes constant π. Equivalent to POSIX constant M_PI

half_pi

π/2

1.570796

Equivalent to POSIX constant M_PI2

third_pi

π/3

1.04719

quarter_pi

π/4

0.78539816

Equivalent to POSIX constant M_PI_4

sixth_pi

π/6

0.523598

two_pi

6.28318

Many uses, most simply, circumference of a circle

two_thirds_pi

2/3 π

2.09439

volume of a hemi-sphere = 4/3 π r³

three_quarters_pi

3/4 π

2.35619

= 3/4 π

four_thirds_pi

4/3 π

4.18879

volume of a sphere = 4/3 π r³

one_div_two_pi

1/(2π)

1.59155

Widely used

root_pi

√π

1.77245

Widely used

root_half_pi

√ π/2

1.25331

Widely used

root_two_pi

√ π*2

2.50662

Widely used

one_div_pi

1/π

0.31830988

Equivalent to POSIX constant M_1_PI

two_div_pi

2/π

0.63661977

Equivalent to POSIX constant M_2_PI

one_div_root_pi

1/√π

0.564189

two_div_root_pi

2/√π

1.128379

Equivalent to POSIX constant M_2_SQRTPI

one_div_root_two_pi

1/√(2π)

0.398942

root_one_div_pi

√(1/π

0.564189

pi_minus_three

π-3

0.141593

four_minus_pi

4 -π

0.858407

pi_pow_e

πe

22.4591

pi_sqr

π2

9.86960

pi_sqr_div_six

π2/6

1.64493

pi_cubed

π3

31.00627

cbrt_pi

3 π

1.46459

one_div_cbrt_pi

1/√3 π

0.682784

Euler's e and related

e

e

2.71828

Euler's constant e, equivalent to POSIX constant M_E

exp_minus_half

e -1/2

0.606530

e_pow_pi

e π

23.14069

root_e

√ e

1.64872

log10_e

log10(e)

0.434294

Equivalent to POSIX constant M_LOG10E

one_div_log10_e

1/log10(e)

2.30258

log2_e

log2(e)

1.442695

This is the same as 1/ln(2) and is equivalent to POSIX constant M_LOG2E

Trigonometric

degree

radians = π / 180

0.017453

radian

degrees = 180 / π

57.2957

sin_one

sin(1)

0.841470

cos_one

cos(1)

0.54030

sinh_one

sinh(1)

1.17520

cosh_one

cosh(1)

1.54308

Phi

Phidias golden ratio

Phidias golden ratio

phi

(1 + √5) /2

1.61803

finance

ln_phi

ln(φ)

0.48121

one_div_ln_phi

1/ln(φ)

2.07808

Euler's Gamma

euler

euler

0.577215

Euler-Mascheroni gamma constant

one_div_euler

1/euler

1.73245

euler_sqr

euler2

0.333177

Misc

zeta_two

ζ(2)

1.64493

Riemann zeta function

zeta_three

ζ(3)

1.20205

Riemann zeta function

catalan

K

0.915965

Catalan (or Glaisher) combinatorial constant

glaisher

A

1.28242

Decimal expansion of Glaisher-Kinkelin constant

khinchin

k

2.685452

Decimal expansion of Khinchin constant

extreme_value_skewness

12√6 ζ(3)/ π3

1.139547

Extreme value distribution

rayleigh_skewness

2√π(π-3)/(4 - π)3/2

0.631110

Rayleigh distribution skewness

rayleigh_kurtosis_excess

-(6π2-24π+16)/(4-π)2

0.245089

Rayleigh distribution kurtosis excess

rayleigh_kurtosis

3+(6π2-24π+16)/(4-π)2

3.245089

Rayleigh distribution kurtosis


[Note] Note

Integer values are not included in this list of math constants, however interesting, because they can be so easily and exactly constructed, even for UDT, for example: static_cast<cpp_float>(42).

[Tip] Tip

If you know the approximate value of the constant, you can search for the value to find Boost.Math chosen name in this table.

[Tip] Tip

Bernoulli numbers are available at Bernoulli numbers.

[Tip] Tip

Factorials are available at factorial.


PrevUpHomeNext