Might be a stupid question. I have checked this many times, it seems as if only the following statement works:
value = (n**2+n)/2;
And not:
value = (n^2+n)/2;
Since it gives unexpected, strangely low and volatile results.
Although there are sources on the net which show usage with ^
like this. I finally found out that only **
is right. Is it possible that the ^
still works in some situations or is this just an error of some documentations?