**diff options**

author | murf <murf@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-07-02 20:16:31 +0000 |
---|---|---|

committer | murf <murf@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-07-02 20:16:31 +0000 |

commit | 3815448e305ac5e4a2c13477cbf1d880cfdce66a (patch) | |

tree | 9d7a062ff32d04003b52d287168606481a264ba1 /doc | |

parent | e91e4df8d5089c7776703ffc3365d00d0d1faa51 (diff) |

support for floating point numbers added to ast_expr2 $\[...\] exprs. Fixes bug 9508, where the expr code fails with fp numbers. The MATH function returns fp numbers by default, so this fix is considered necessary.

git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@72933 f38db490-d61c-443f-a65b-d21fe96a405b

Diffstat (limited to 'doc')

-rw-r--r-- | doc/channelvariables.txt | 21 |

1 files changed, 14 insertions, 7 deletions

diff --git a/doc/channelvariables.txt b/doc/channelvariables.txt index 761516fa7..6c501ae52 100644 --- a/doc/channelvariables.txt +++ b/doc/channelvariables.txt @@ -212,19 +212,19 @@ with equal precedence are grouped within { } symbols. an empty string or zero; otherwise, returns zero. expr1 {=, >, >=, <, <=, !=} expr2 - Return the results of integer comparison if both arguments are - integers; otherwise, returns the results of string comparison + Return the results of floating pt. comparison if both arguments are + numbers; otherwise, returns the results of string comparison using the locale-specific collation sequence. The result of each comparison is 1 if the specified relation is true, or 0 if the relation is false. expr1 {+, -} expr2 - Return the results of addition or subtraction of integer-valued + Return the results of addition or subtraction of arguments. expr1 {*, /, %} expr2 - Return the results of multiplication, integer division, or - remainder of integer-valued arguments. + Return the results of multiplication, division, or + remainder of arguments. (floating point [long double if possible]). - expr1 Return the result of subtracting expr1 from 0. @@ -322,10 +322,13 @@ __________________________ NUMBERS VS STRINGS -------------------------- -Tokens consisting only of numbers are converted to 64-bit numbers for -most of the operators. This means that overflows can occur when the +Tokens consisting only of numbers are converted to long doubles for +most of the operators (80-128 bits, depending on the compiler/platform/etc). +This means that overflows can occur when the numbers get above 18 digits. Warnings will appear in the logs in this case. +If "long double" is not available, then "double" is used (usually 64 bit floating +point numbers). ___________________________ CONDITIONALS --------------------------- @@ -484,6 +487,10 @@ of possible concern with "legacy" extension.conf files: 9. Unary operators '-' and '!' were made right associative. +10. All arithmetic operations are now done in floating point (long double + if possible, plain double otherwise). + + -------------------------------------------------------- DEBUGGING HINTS FOR $[ ] EXPRESSIONS -------------------------------------------------------- |