Home Libraries People FAQ More

#### 數值常量(Numeric Constants)

##### 概要

```#include <boost/math/constants/constants.hpp>
```

```namespace boost{ namespace math{ namespace constants{

template <class T> T pi();
template <class T> T root_pi();
template <class T> T root_half_pi();
template <class T> T root_two_pi();
template <class T> T root_ln_four();
template <class T> T e();
template <class T> T half();
template <class T> T euler();
template <class T> T root_two();
template <class T> T ln_two();
template <class T> T ln_ln_two();
template <class T> T third();
template <class T> T twothirds();
template <class T> T pi_minus_three();
template <class T> T four_minus_pi();

}}} // namespaces
```
##### 說明

```template <class T>
T circumference(T r)
{
return 2 * boost::math::constants::pi<T>() * r;
}
```

pi

π

3.1415926535897932384...

root_pi

√π

1.772453850905516027...

root_half_pi

√(π/2)

1.253314137315500251...

root_two_pi

√(2*π)

2.506628274631000502...

root_ln_four

√(ln(4))

1.17741002251547469...

e

e

2.71828182845904523536...

half

0.5

0.5

euler

Euler's constant

0.577215664901532860606

root_two

√2

1.4142135623730950488...

ln_two

ln(2)

0.6931471805599453094...

ln_ln_two

ln(ln(2))

-0.3665129205816643...

third

1/3

0.333333333333333333...

twothirds

2/3

0.666666666666666666...

pi_minus_three

π-3

0.14159265358979323846...

four_minus_pi

4-π

0.85840734641020676153735...