Page MenuHomePhabricator

Too many different definitions of constants like pi are floating around.
Closed, WontfixPublic

Description

Preferably use the M_PI macro in <cmath>.

Event Timeline

A grep 3.1415 given list

[4ad423]: Merge branch 'bug-10337-UseMathDefinitionForPI'

Merged commits:

2011-12-14 16:21:48 Diana Wald [6e2543]
Reduced number of numerical constants in MITK

Hitherto many bundles defined pi for themselves. These definitions have been replaced by the math.h definition of M_PI. To this purpose the #include <math.h> has been added where required as well as #define _USE_MATH_DEFINES .

Use of pi has not been changed in the utilities.

We should consider to switch to vnl_math::pi (vnl/vnl_math.h). VNL is included as third-party library in ITK and hence it is always available in MITK. Currently we have some compiler warnings caused by the usage of M_PI. Last but not least - AFAIK - M_PI is not part of the standard.

kislinsk claimed this task.
This task was automatically closed because it wasn't updated at least since July 2016 (over 2 years). Please re-open this task if you think that it is still relevant. This most probably means that you will resolve it.