variables transformation

For questions and discussion related to reading in and working with data.
chaveslima
Posts: 18
Joined: Mon Jun 25, 2012 3:49 pm

variables transformation

Unread post by chaveslima »

Dear Tom

Looks like RATS do not accept "/" as exponent. There is, if I do:
display 9**(0.5) it gives me 3, but if I do
display 9**(1/2) it gives me 1
I actually needed a formula like:
set interm = inter**(1/12) to calculate monthly interest from the yearly value, but it does not work
If I do interm = inter**(0.083333333) it does work, but I want to use the fraction (1/12) as exponent…
what should I do?

Ricardo
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: variables transformation

Unread post by TomDoan »

1/2 is an integer divide, producing 0. Use 1.0/2.0 (or 1.0/2) to make it a real-valued divide.
chaveslima
Posts: 18
Joined: Mon Jun 25, 2012 3:49 pm

Re: variables transformation

Unread post by chaveslima »

Great Thanks!
Post Reply