How would I say " x to the yth power" in C#?
x^y isn't doing it...
Printable View
How would I say " x to the yth power" in C#?
x^y isn't doing it...
You can use
http://msdn2.microsoft.com/en-us/lib....math.pow.aspxCode:Math.Pow(x, y)
^ is the exclusive-or operator in C#.
I have this line of code:
FVal = (Payment / APR2) * (1 - Math.Pow((1 + APR2), -TotPmts));
All the variables are defined as single.
I get this error:
Error 1 Cannot implicitly convert type 'double' to 'float'. An explicit conversion exists (are you missing a cast?) I:\VB NET Source Code\C#\TVAL\TVAL\TVAL\Form1.cs 1248 20 TVAL
Not exactly sure what data types you should be using but for this you can try changing your FVal variable to a double. Check this out too:
http://msdn2.microsoft.com/en-us/lib...za(VS.80).aspx
That did it. Thanks again.