I have these formulas and I'm looking for a way to translate them into code, but I chew more that I could eat, I really don't know how to raise a value to a fractional power in programming.
I stumbled with these questions:
But they don't answer my question
So... what's the proper way to do that?
EDIT:
SHOOT!!
I thought if I ask a simple question with less info I could get a proper answer...
Well... here is my attempt to do what I want to do:
If I follow the answer from the first question I get this:
public static void main(String []args)
{
double pow = 3.0/2;
double valA = 20.5;
System.out.println(Math.pow(valA, pow)/(6 * Math.sqrt(Math.PI)));
}
Result: 8.727796365331747
If I do like I was doing:
public static void main(String []args)
{
double pow = 3/2;
double valA = 20.5;
System.out.println(Math.pow(valA, pow)/(6 * Math.sqrt(Math.PI)));
}
Result: 1.9276477437881674
Again... What's the proper way? and why?