Commit 1180a48e authored by Morten Welinder's avatar Morten Welinder Committed by Morten Welinder
Browse files

Correct error code.

Thu Jan 20 16:52:14 2000  Morten Welinder  <welinder@rentec.com>

	* src/functions/fn-stat.c (gnumeric_stdev): Correct error code.

	* src/functions/fn-math.c (gnumeric_log): Correct error code and
 	protect from crash.
parent 2ab0a35d
Thu Jan 20 16:52:14 2000 Morten Welinder <welinder@rentec.com>
* src/functions/fn-stat.c (gnumeric_stdev): Correct error code.
* src/functions/fn-math.c (gnumeric_log): Correct error code and
protect from crash.
2000-01-20 Morten Welinder <terra@diku.dk>
* src/functions/fn-math.c (gnumeric_mod): Correct error code; fix
......
Thu Jan 20 16:52:14 2000 Morten Welinder <welinder@rentec.com>
* src/functions/fn-stat.c (gnumeric_stdev): Correct error code.
* src/functions/fn-math.c (gnumeric_log): Correct error code and
protect from crash.
2000-01-20 Morten Welinder <terra@diku.dk>
* src/functions/fn-math.c (gnumeric_mod): Correct error code; fix
......
......@@ -1050,11 +1050,14 @@ gnumeric_log (FunctionEvalInfo *ei, Value **argv)
if (argv[1] == NULL)
base = 10;
else
else {
base = value_get_as_float (argv[1]);
if (base <= 1)
return value_new_error (ei->pos, gnumeric_err_NUM);
}
if (t <= 0.0)
return value_new_error (ei->pos, gnumeric_err_VALUE);
return value_new_error (ei->pos, gnumeric_err_NUM);
return value_new_float (log (t) / log (base));
}
......
......@@ -199,7 +199,7 @@ gnumeric_stdev (FunctionEvalInfo *ei, GList *expr_node_list)
range_stddev_est,
COLLECT_IGNORE_STRINGS |
COLLECT_IGNORE_BOOLS,
gnumeric_err_VALUE);
gnumeric_err_DIV0);
}
/***************************************************************************/
......@@ -228,7 +228,7 @@ gnumeric_stdevp (FunctionEvalInfo *ei, GList *expr_node_list)
range_stddev_pop,
COLLECT_IGNORE_STRINGS |
COLLECT_IGNORE_BOOLS,
gnumeric_err_VALUE);
gnumeric_err_DIV0);
}
/***************************************************************************/
......
......@@ -1050,11 +1050,14 @@ gnumeric_log (FunctionEvalInfo *ei, Value **argv)
if (argv[1] == NULL)
base = 10;
else
else {
base = value_get_as_float (argv[1]);
if (base <= 1)
return value_new_error (ei->pos, gnumeric_err_NUM);
}
if (t <= 0.0)
return value_new_error (ei->pos, gnumeric_err_VALUE);
return value_new_error (ei->pos, gnumeric_err_NUM);
return value_new_float (log (t) / log (base));
}
......
......@@ -199,7 +199,7 @@ gnumeric_stdev (FunctionEvalInfo *ei, GList *expr_node_list)
range_stddev_est,
COLLECT_IGNORE_STRINGS |
COLLECT_IGNORE_BOOLS,
gnumeric_err_VALUE);
gnumeric_err_DIV0);
}
/***************************************************************************/
......@@ -228,7 +228,7 @@ gnumeric_stdevp (FunctionEvalInfo *ei, GList *expr_node_list)
range_stddev_pop,
COLLECT_IGNORE_STRINGS |
COLLECT_IGNORE_BOOLS,
gnumeric_err_VALUE);
gnumeric_err_DIV0);
}
/***************************************************************************/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment