MATH(Zahl1
Operator
Zahl2
[,Ergebnistyp
])
+
, -
, /
, *
,
<
, >
, <=
,
>=
, ==
, %
(Modulo). Ergebnistyp:
f
, float
(Fließkommazahl, Default),
i
, int
(Ganzzahl), h
,
hex
(Wert im Hexadezimal-System), c
,
char
(Byte).; 3*8 als Ganzzahl berechnen: exten => 123,1,Set(i=${MATH(3*8,int)})
————————| 1.2 |————————| 1.4 |————————| 1.6 |————————
-= Info about function 'MATH' =-
[Syntax]
MATH(<number1><op><number 2>[,<type_of_result>])
[Synopsis]
Performs Mathematical Functions
[Description]
Perform calculation on number 1 to number 2. Valid ops are:
+,-,/,*,%%%%,<,>,>=,<=,==
and behave as their C equivalents.
<type_of_result> - wanted type of result:
f, float - float(default)
i, int - integer,
h, hex - hex,
c, char - char
Example: Set(i=${MATH(123%%%%16,int)}) - sets var i=11
--- in Asterisk 1.4
+++ in Asterisk 1.6
@@ -1,14 +1,14 @@
-= Info about function 'MATH' =-
[Syntax]
- MATH(<number1><op><number 2>[,<type_of_result>])
+ MATH(<number1><op><number2>[,<type_of_result>])
[Synopsis]
Performs Mathematical Functions
[Description]
- Perform calculation on number 1 to number 2. Valid ops are:
- +,-,/,*,%%%%,<,>,>=,<=,==
+ Perform calculation on number1 to number2. Valid ops are:
+ +,-,/,*,%%%%,<<,>>,^,AND,OR,XOR,<,>,>=,<=,==
and behave as their C equivalents.
<type_of_result> - wanted type of result:
f, float - float(default)