Page 1 of 3
Square root
Posted:
Mon Nov 17, 2008 2:50 am
by preparac
Probably a silly question. Is there a square root function available to use for custom stats?
Re: Square root
Posted:
Mon Nov 17, 2008 5:32 am
by WhiteRider
There isn't a square root function that I'm aware of, but you can use the 'power' operator; ^
e.g. 3 ^ 2 = 3 to the power 2 = 9
9 ^ 0.5 = square root of 9 = 3.
Re: Square root
Posted:
Sat Nov 29, 2008 4:06 am
by preparac
cool thanks!
Re: Square root
Posted:
Mon Dec 08, 2008 7:00 am
by Dan_Jazz_Man
WhiteRider wrote:There isn't a square root function that I'm aware of, but you can use the 'power' operator; ^
e.g. 3 ^ 2 = 3 to the power 2 = 9
9 ^ 0.5 = square root of 9 = 3.
Hmm, this doesn't work. I wrote "format_number (cnt_holecards ^ 2 - 0.664, 0, false, false)" for a report, dealing with confidence
intervals, and got a warning of "expression is NOT valid".
Re: Square root
Posted:
Mon Dec 08, 2008 10:10 am
by Dan_Jazz_Man
Dan_Jazz_Man wrote:WhiteRider wrote:There isn't a square root function that I'm aware of, but you can use the 'power' operator; ^
e.g. 3 ^ 2 = 3 to the power 2 = 9
9 ^ 0.5 = square root of 9 = 3.
EDIT: Hmm, this doesn't work. I wrote "format_number (cnt_holecards ^ 0.5 - 0.664, 0, false, false)" for a report, dealing with confidence
intervals, and got a warning of "expression is NOT valid".
Re: Square root
Posted:
Mon Dec 08, 2008 11:13 am
by WhiteRider
Possibly this doesn't work in the Statistics tab - try doing your calculation in your cnt_holecards column.
Re: Square root
Posted:
Tue Dec 09, 2008 8:35 am
by Dan_Jazz_Man
I'm sorry, I don't understand what you mean.
I have a column in a report for showing the expected number of times a pocket pair improves on the flop, and also
left and right values of a 95% confidence interval. So here's what I want to write:
format ('{1}, {2}. {3},
format_number (cnt_holecards * 0.1175 - (cnt_holecards ^ 0.5) * 2 * 0.332, 0, false, false),
format_number (cnt_holecards * 0.1175, 0, false, false),
format_number (cnt_holecards * 0.1175 + (cnt_holecards ^ 0.5) * 2 * 0.332, 0, false, false) )
How can I do it differently?
Re: Square root
Posted:
Tue Dec 09, 2008 1:31 pm
by WhiteRider
I think you need to put your square root calculation in the Column "cnt_holecards" - or actually you may need to create a new column for each calculation; cnt_holecards_root for instance, where the Value Expression in the column has the ^ 0.5 added to whatever is already in the cnt_holecards column.
Re: Square root
Posted:
Wed Dec 10, 2008 8:26 am
by Dan_Jazz_Man
This doesn't work either. I created a cnt_holecard_sqrt column and tried to write the following expression for it:
cnt_holecard ^ 0.5
PT gives a warning message of "NOT a valid SQL expression".
Re: Square root
Posted:
Wed Dec 10, 2008 10:14 am
by kraada
Earlier you were referring to cnt_holecards not cnt_holecard -- could this perhaps be the problem now?