]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
According to MATH, 0+1181000386 = 1181000448. Oops.
authorTilghman Lesher <tilghman@meg.abyt.es>
Mon, 4 Jun 2007 23:41:49 +0000 (23:41 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Mon, 4 Jun 2007 23:41:49 +0000 (23:41 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@67161 65c4cc65-6c06-0410-ace0-fbb531ad65f3

funcs/func_math.c

index a838e4f998fe56ecb41669b4fbc22e27528c50c2..4795efcc626db4e26d9de69e3154a9eca6af94fb 100644 (file)
@@ -67,9 +67,9 @@ static char *builtin_function_math(struct ast_channel *chan, char *cmd, char *da
        int argc;
        char *argv[2];
        char *args;
-       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;
@@ -159,12 +159,12 @@ static char *builtin_function_math(struct ast_channel *chan, char *cmd, char *da
                return NULL;
        }
 
-       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 NULL;
        }
 
-       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 NULL;
        }