What else would you expect of
f
is negative? The value
f
is to be raised in the power
e
. Everyone should know from elementary school algebra, that power operation is not defined on the whole set of real numbers. (It is defined on complex numbers which is not the case.)
Consider this (square root from real -1):
double pow = 0.5;
double bs = -1;
double x = Math.Pow(bs, pow);
In .NET for Windows, the value is
System.Double.NaN
(not a number), which is a very reasonable result. The processors of x86, IE-64 and x86-64 and instruction-set architectures allow the mode where some floating point operations return NaN, or the mode where such operation throw exception — all legal. You just did not come across any trouble in your previous compilation of the system. Hard to say why but it can easily happen.
Consider yourself lucky. You got a diagnostics of incompatibility free of charge! Re-visit your calculations, find out why you have such input values for power operation and fix your code.
—SA