Recent Changes - Search:

Public

Physics

Engineering

Literature
Journal Club
People

MineralPET
DAQ

Computing

Africa


Tips and Tricks

Using Pi in C++ programs

 #include <cmath>

Then M_PI becomes equal to the value 3.1415....

Use C++ style includes for standard C include files

<cmath> instead of <math.h>; <cstdio> instead of <stdio.h> and so on.
This meant to take care of C definitions which may conflict with C++.

Advanced

  • Fast Delegate Dealing with pointers to class methods. (beginners beware)
    Improves on boost::function. You can also use someting like template<class T> bool RMINFC(T* const instance, double (T::*F)(double) const,....
Edit - History - Print - Recent Changes - Search
Page last modified on February 26, 2009, at 12:12 PM