#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#include <math.h>
#include <sys/types.h>
#include "asterisk/module.h"
MULTIPLYFUNCTION,
SUBTRACTFUNCTION,
MODULUSFUNCTION,
+ POWFUNCTION,
+ SHLEFTFUNCTION,
+ SHRIGHTFUNCTION,
GTFUNCTION,
LTFUNCTION,
GTEFUNCTION,
} else if ((op = strchr(mvalue1, '%'))) {
iaction = MODULUSFUNCTION;
*op = '\0';
+ } else if ((op = strchr(mvalue1, '^'))) {
+ iaction = POWFUNCTION;
+ *op = '\0';
} else if ((op = strchr(mvalue1, '>'))) {
iaction = GTFUNCTION;
*op = '\0';
if (*(op + 1) == '=') {
*++op = '\0';
iaction = GTEFUNCTION;
+ } else if (*(op + 1) == '>') {
+ *++op = '\0';
+ iaction = SHRIGHTFUNCTION;
}
} else if ((op = strchr(mvalue1, '<'))) {
iaction = LTFUNCTION;
if (*(op + 1) == '=') {
*++op = '\0';
iaction = LTEFUNCTION;
+ } else if (*(op + 1) == '<') {
+ *++op = '\0';
+ iaction = SHLEFTFUNCTION;
}
} else if ((op = strchr(mvalue1, '='))) {
*op = '\0';
break;
}
+ case POWFUNCTION:
+ ftmp = pow(fnum1, fnum2);
+ break;
+ case SHLEFTFUNCTION:
+ {
+ int inum1 = fnum1;
+ int inum2 = fnum2;
+
+ ftmp = (inum1 << inum2);
+ break;
+ }
+ case SHRIGHTFUNCTION:
+ {
+ int inum1 = fnum1;
+ int inum2 = fnum2;
+
+ ftmp = (inum1 >> inum2);
+ break;
+ }
case GTFUNCTION:
ast_copy_string(buf, (fnum1 > fnum2) ? "TRUE" : "FALSE", len);
break;