Simple question : how to do "10 to the power of x"
Simple question : how to do "10 to the power of x"
Hello,
I wonder how to execute a basic mathematical operation :
"10 to the power x" ?
I don't know if my explanation is clear, so I will give some examples :
For example I would like to have the result of "10 to the power of 4" ( = 10000 ) ... or even "5 to th power of 3" ( = 75 ).
I did not find anything in the manual or help for this basic operator, so if you can help me, I would really appreciate.
Thanks in advance.
I wonder how to execute a basic mathematical operation :
"10 to the power x" ?
I don't know if my explanation is clear, so I will give some examples :
For example I would like to have the result of "10 to the power of 4" ( = 10000 ) ... or even "5 to th power of 3" ( = 75 ).
I did not find anything in the manual or help for this basic operator, so if you can help me, I would really appreciate.
Thanks in advance.
I don't know TX, but usually x**y will do it (at least that will work in server/px) - have you tried that?
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Here's how I got it. Input tt has 2 fields - number, exponent
Output tt has 1 field, nbrout (1:s)
Map has 1 input card, 2 output cards (first one set to 'sink'), one Functional map.
1st output card has the nbrout field indexed to get to the 1st occurance, then the rest. nbrout [1], nbrout[2:s] The first occurance gets loaded with the number itself.
nbrout[2:s] is the FMap using an index to compare to the exponent for the looping. The FMap just multiplies the nbrout*number repeatedly until loop condition is met.
"IF ( INDEX($) < Exp Fields:NbrFle, DoFINAL(NumberTst Fields:NbrFle, NbrOut Fields:DtOut))"
The 2nd output card maps the last occurance of the multiple nbrout from the first output card for the answer. nbrout[LAST].
Doing this, I used 2 as the number and 4 as the exponent, got 16 for my output.
Of course if you're working from deeper within a map, you can change it as needed, but you get the idea.
Output tt has 1 field, nbrout (1:s)
Map has 1 input card, 2 output cards (first one set to 'sink'), one Functional map.
1st output card has the nbrout field indexed to get to the 1st occurance, then the rest. nbrout [1], nbrout[2:s] The first occurance gets loaded with the number itself.
nbrout[2:s] is the FMap using an index to compare to the exponent for the looping. The FMap just multiplies the nbrout*number repeatedly until loop condition is met.
"IF ( INDEX($) < Exp Fields:NbrFle, DoFINAL(NumberTst Fields:NbrFle, NbrOut Fields:DtOut))"
The 2nd output card maps the last occurance of the multiple nbrout from the first output card for the answer. nbrout[LAST].
Doing this, I used 2 as the number and 4 as the exponent, got 16 for my output.
Of course if you're working from deeper within a map, you can change it as needed, but you get the idea.