Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) M_PI

 

M_PI is the STL constant for the value of pi (that is: 3.141592...).

 

#include <cmath>
#include <cassert>
 
int main()
{
  const double x = 0.5 * M_PI;
  const double y = std::sin(x);
  assert(y == 1.0);
}

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict