|
-
Jul 24th, 2007, 11:02 AM
#1
Thread Starter
PowerPoster
[RESOLVED] Feeling like an idiot now..
How would I say " x to the yth power" in C#?
x^y isn't doing it...
===================================================
If your question has been answered, mark the thread as [RESOLVED]
-
Jul 24th, 2007, 11:08 AM
#2
Re: Feeling like an idiot now..
-
Jul 24th, 2007, 11:10 AM
#3
Thread Starter
PowerPoster
Re: Feeling like an idiot now..
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
===================================================
If your question has been answered, mark the thread as [RESOLVED]
-
Jul 24th, 2007, 11:30 AM
#4
Re: Feeling like an idiot now..
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
-
Jul 24th, 2007, 11:39 AM
#5
Thread Starter
PowerPoster
Re: Feeling like an idiot now..
That did it. Thanks again.
===================================================
If your question has been answered, mark the thread as [RESOLVED]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|