Summary:ASTERISK-07749: [patch] [post-1.4] add new function POW()
Reporter:k-egg (k-egg)Labels:
Date Opened:2006-09-15 04:48:59Date Closed:2007-01-02 11:04:42.000-0600
Versions:Frequency of
Environment:Attachments:( 0) func_math.c.patch
( 1) func_math.c.patch2
( 2) func_math-7959-r47783.diff
( 3) func_math-feature_pow_lshift_rshift.diff
( 4) func_math-feature_pow_rshift_lshift.diff
( 5) func_math-feature_pow.diff
Description:why does func_math.c  not have the ability to do pow() ?

patch includes this feature.

MATH(2P2)  ==> pow (2,2)

plz check patch for overflows.
Comments:By: k-egg (k-egg) 2006-09-15 04:51:41

L for leftshift
R for rightshift
P for pow

By: Serge Vecher (serge-v) 2006-09-18 09:30:52

k-egg: since this is a new feature, the patch (please combine them) needs to be against trunk. Thanks.

By: k-egg (k-egg) 2006-09-18 10:20:57

serge-v: i only downloaded func_math.c from trunk and applied tha changes.
dont know if it compiles or not, caus i dont have a complete svn checkout.
plz test it.

By: jmls (jmls) 2006-11-01 05:37:04.000-0600

k-egg: would you please combine these patches into a single patch against trunk. thanks.

By: k-egg (k-egg) 2006-11-02 04:41:23.000-0600

func_math-feature_pow_lshift_rshift.diff is the combined one

By: Jason Parker (jparker) 2006-11-20 15:56:10.000-0600

Could somebody test this patch?  If we're gonna bitshift, we might as well go all the way.

>> and << should now be supported, in addition to L and R.

By: k-egg (k-egg) 2006-11-21 02:50:55.000-0600

okay, L and R could be removed. '<<' and '>>' makes more sense to me.

can not test this anymore, cause i have solved the task, where i wanted
to use L and R, in an other way.

By: Tilghman Lesher (tilghman) 2006-12-30 23:21:19.000-0600

Committed, revision 49076.  In addition to Qwell's changes, power is now '^'.

By: k-egg (k-egg) 2007-01-02 10:35:30.000-0600

^, <<, >>, are missing in .desc ; see below:

static struct ast_custom_function math_function = {
.desc = "Perform calculation on number 1 to number 2. Valid ops are: \n"
"    +,-,/,*,%,<,>,>=,<=,==\n"

By: k-egg (k-egg) 2007-01-02 10:50:15.000-0600

patch2 removes space between number and 2 to make description consistent

-       .syntax = "MATH(<number1><op><number 2>[,<type_of_result>])",
+       .syntax = "MATH(<number1><op><number2>[,<type_of_result>])",

By: Tilghman Lesher (tilghman) 2007-01-02 11:04:42.000-0600