"pow" returns 1, although from maths standpoint it is not correct result

Hello all.
I have a piece of code that uses the power function "pow", it looks like this :

1
2
3
4
double a, pow2, base2;
base2 = 15.51003028914760;
pow2 = 2/3;
a = 6.6228 / (pow(base2, pow2));


The result for 'a' is 1 , although it is not a correct answer. I expect my expression to result in 1.0648 .

Why am I getting such result ? Thank you.
Kind regards, T
Last edited on
1
2
// pow2 = 2/3; // integer division
pow2 = 2 / 3.0 ;
That was it, thanks !
Topic archived. No new replies allowed.