In VB, the '
^
' operator is not exponent, but a power operator,
N ^ p
means N
p, and "exponent" means e
x, in VB it would be
e ^ x
:
http://msdn.microsoft.com/en-us/library/zh100ckf%28v=vs.100%29.aspx[
^].
"Exponent" is a unary function, and there is no a unary operator for it in any language. And '^', yes, is a binary infix operator, between number to be
N
powered and the exponent
p
(as denoted above).
So, the question is already not quite correct, or at least not clear.
So, what's the problem with Java? In Java, '^' means XOR operator, and the function you need is
Math.pow(double, double)
, and the exponential function is
Math.exp(double)
:
http://en.wikipedia.org/wiki/Exclusive-or[
^],
http://docs.oracle.com/javase/6/docs/api/java/lang/Math.html[
^].
Now, how operators and functions look in the language you use for implementation of a calculator, has nothing to do with how it looks in a calculator, in a usual approach. In a calculator… they will look how you design it; and the syntax of the implementation language cannot prevent it; at least is a developer has an idea what programming is. I don't even understand how can it be a problem, but pretty much sure you can do it.
—SA