I know in Root we can use a2.0 to calculate the square of number a. But I don’t know how does this ** operator implemented. I learned from all C++ books and internet C++ tutorials that in C++ you can’t define new operators like square ab or power a^b, because the compiler will treat them as " a times (*b) where b is a point" and " a xor b". I really want to know this technique, do any one know the answer?
I tried to use a macro “#define a**2 (a)*(a)” in C++, of cause this failed. Is there a smart macro in Root or a complicated modification on the compiler?
Thank your guys very much for any help.