abdulsulo
- 13
- 0
Hello there. I am trying to take a power of 1/7 of one variable but as a default it gives me 1 similar to if I was taking power of 0. How can I solve this problem. Thanks
Do I=2,N,1
X1=(Yr(I)/R)
X2=X1**(1/7)
Ua(I)=Um*X2
END DO
Your hint gave me an idea and I think I solved the problem. I put 1./7. to the equation and problem solved. Didn't notice it would roll it down to 0. Thank you very much.DrClaude said:What exactly did you write? I suspect that the 1/7 is being treated as an integer operation and rounded to 0.
I use integer division often. This operation and the modulus operation are useful in converting days to weeks and days, ounces to pounds and ounces, making change, and many other applications.rumborak said:If I ever designed a programming language, floating point division would be the default behavior. I do not recall the last time I actually used integer division.