|
-
Oct 10th, 2002, 07:09 PM
#1
Thread Starter
New Member
What is the Java exponent operator?
I know that in VB, the operator to illustrate exponents is a hat (^). How can I write this exponent operator in java?
Thanks a bunch!
-
Oct 10th, 2002, 07:37 PM
#2
Ya ya Baby!!!Me is Back
Search in the Math librairy.
-
Oct 10th, 2002, 07:37 PM
#3
Hyperactive Member
The Math class holds the answers you seek.
-
Oct 11th, 2002, 03:33 PM
#4
Lively Member
The Math class is cool!
-
Oct 14th, 2002, 12:27 PM
#5
Hyperactive Member
2 ^ 3 = 8
Code:
double cubed = java.lang.Math.pow ( 2, 3);
yeah, there is no explicit operator for exponents in java
and you don't need to type the whole java.lang.Math.pow
as the java.lang package is imported by default, i jsut wanted to show you the whole path to the class so you didn't confuse it w/ java.math.*.
"There are only two things that are infinite. The universe and human stupidity... and the universe I'm not sure about." - Einstein
If you are programming in Java use www.NetBeans.org
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
|