![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Jul 2005
Location: Houston. Texas
Posts: 3
Rep Power: 0
![]() |
How do i use a ^ for a double variable?
I need to raise a double variable to X power.
something like this... double rate; double sum; sum = rate ^ -360; When i try to compile i get the error "Operator '^' cannot be applied operands of type 'double'. So how does one take a double to X power? Sorry if i am hard to understand. Im still very new to this. TIA |
|
|
|
|
|
#2 |
|
Professional Programmer
Join Date: Sep 2005
Location: serbia & montenegro
Posts: 484
Rep Power: 4
![]() |
I don't know C#, but I can suggest you either to create your function or overload operator ^ if C# allows that.
|
|
|
|
|
|
#3 | |
|
Programmer
Join Date: Dec 2005
Posts: 53
Rep Power: 3
![]() |
Quote:
The '^' character is a bitwise character for XOR |
|
|
|
|
|
|
#4 |
|
Newbie
Join Date: Jul 2005
Location: Houston. Texas
Posts: 3
Rep Power: 0
![]() |
wow thanks guys. You guys are the best
|
|
|
|
|
|
#5 |
|
Professional Programmer
Join Date: Mar 2005
Location: Student of University of Mumbai, Maharashtra State, India
Posts: 344
Rep Power: 4
![]() |
Math.Pow is a static method and can be applied to different data types. Like that, there are many other math methods associated and u can find them at http://msdn.microsoft.com
__________________
Visit: http://www.somaiya.edu |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|