Page 1 of 1
power operator not working?
Posted:
Mon Jul 23, 2012 2:11 pm
by erdnase17
I am trying to input the following expression but it does not seem to accept the power operator with this expression:
((2*(min(live_amt_stack,2*live_amt_avg_stack-live_amt_stack) / live_amt_bb) + live_amt_bb*4) / (live_amt_bb*4)) ^ (1/3)
Any workaround?
Thanks.
Re: power operator not working?
Posted:
Mon Jul 23, 2012 2:44 pm
by kraada
That operator works but only for whole number powers I believe. Can you explain a bit more why you're taking the cube root of that expression? That might help me find a better way to help you do what you want.
Re: power operator not working?
Posted:
Mon Jul 23, 2012 2:52 pm
by erdnase17
I want to apply a formula for the geometric betting of the pot which is based on the effective stack size and pot size on the flop.
I am trying it assuming the pot will be 4bb on the flop which is a fairly common situation in the games I play.
The formula is this for 3 streets of betting:
([((pot+2*eff)/pot)^(1/3)]-1)/2
So I tried to translate the formula as:
((((2*(min(live_amt_stack,2*live_amt_avg_stack-live_amt_stack) / live_amt_bb) + live_amt_bb*4)/(live_amt_bb*4))^(1/3))-1)/2
but I got stuck with the power operator.
Re: power operator not working?
Posted:
Mon Jul 23, 2012 3:24 pm
by kraada
Interesting - I don't see another way to do that. I'll make a note to look into what we'd need to do to get ^ working to give you cube roots, but it may be a while - with the commercial release of PT4 happening tomorrow, there are other higher priorities right now.
Re: power operator not working?
Posted:
Mon Jul 23, 2012 3:29 pm
by erdnase17
kraada wrote:Interesting - I don't see another way to do that. I'll make a note to look into what we'd need to do to get ^ working to give you cube roots, but it may be a while - with the commercial release of PT4 happening tomorrow, there are other higher priorities right now.
A possible workaround is to use a formula to approximate the cube root.
Is there anyway to use assignment in the Expression language?
x = a+b
y = x+c etc.
Re: power operator not working?
Posted:
Mon Jul 23, 2012 4:13 pm
by kraada
No, unfortunately that isn't possible. Everything there gets chunked into the where clause of a PostgreSQL query and there's no such function that will do what you want that I'm aware of.