scripter73
Programmer
Hi,
I'm new to Java. This may sound like a total newbie question, but how do you do exponentiation in Java? I can't find an operator.
Here's my sample code:
class quad
{
public static void main (String[] args)
{
double x = 4;
double value = ((3 * x^2) - (8*x) + 4);
System.out.println("At X = " + x + "the value is " + value);
}
}
Thanks in advance,
scripter73
Change Your Thinking, Change Your Life.
I'm new to Java. This may sound like a total newbie question, but how do you do exponentiation in Java? I can't find an operator.
Here's my sample code:
class quad
{
public static void main (String[] args)
{
double x = 4;
double value = ((3 * x^2) - (8*x) + 4);
System.out.println("At X = " + x + "the value is " + value);
}
}
Thanks in advance,
scripter73
Change Your Thinking, Change Your Life.