Strange behaviour of #define... (solved)


I’ve just discovered that although [color=orange]#define Double_t mup=2.792847337;[/color] works fine in ROOT’s prompt, it returns color=orange2[/color] when loaded in a macro… What should I do to keep it double ?


Sorry for the trouble, it seems better with [color=orange]const Double_t mup=2.7928[/color]…

:blush: It works better too without the ‘=’ : [color=orange]#define mup 2.7928[/color]… :blush:

But what’s the difference between the ‘const’ and the ‘#define’ version ?

one is done by the preprocessor (#define), the other is C(++). For questions like these please consult your C++ programmer’s introduction; asking the root forum is inapropriate. There’s a nice posting on books with introductions to C++ in this forum; use the search facility to find it.