Merged revisions 67162 via svnmerge from
authorTilghman Lesher <tilghman@meg.abyt.es>
Mon, 4 Jun 2007 23:45:05 +0000 (23:45 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Mon, 4 Jun 2007 23:45:05 +0000 (23:45 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r67162 | tilghman | 2007-06-04 18:43:01 -0500 (Mon, 04 Jun 2007) | 10 lines

Merged revisions 67161 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r67161 | tilghman | 2007-06-04 18:41:49 -0500 (Mon, 04 Jun 2007) | 2 lines

According to MATH, 0+1181000386 = 1181000448.  Oops.

........

................

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@67164 65c4cc65-6c06-0410-ace0-fbb531ad65f3

funcs/func_math.c

index bdcbb69..ad42d19 100644 (file)
@@ -70,9 +70,9 @@ enum TypeOfResult {
 static int math(struct ast_channel *chan, const char *cmd, char *parse,
                char *buf, size_t len)
 {
-       float fnum1;
-       float fnum2;
-       float ftmp = 0;
+       double fnum1;
+       double fnum2;
+       double ftmp = 0;
        char *op;
        int iaction = -1;
        int type_of_result = FLOAT_RESULT;
@@ -180,12 +180,12 @@ static int math(struct ast_channel *chan, const char *cmd, char *parse,
                return -1;
        }
 
-       if (sscanf(mvalue1, "%f", &fnum1) != 1) {
+       if (sscanf(mvalue1, "%lf", &fnum1) != 1) {
                ast_log(LOG_WARNING, "'%s' is not a valid number\n", mvalue1);
                return -1;
        }
 
-       if (sscanf(mvalue2, "%f", &fnum2) != 1) {
+       if (sscanf(mvalue2, "%lf", &fnum2) != 1) {
                ast_log(LOG_WARNING, "'%s' is not a valid number\n", mvalue2);
                return -1;
        }