0
The expression 2^(1/12)
should present the result: 1,0594630943593
.
But when I apply the Math.Pow function the result only gives 1.0
. Could someone help me and tell me how to print the correct amount?
I’m using the following code:
double x = Math.pow(2, (1/12));
System.out.println(x);
SAÍDA: 1.0
1/12 is a division of integers and the result is an integer. Try 1.0/12.
– Piovezan
It’s true. I didn’t notice this fact. Thank you very much!
– Habemus Capital