Commit e0a418db authored by Morten Welinder's avatar Morten Welinder Committed by Morten Welinder

For integer 0^0, return #NUM!. (eval_expr_real): Adjust float power error

1999-09-18  Morten Welinder  <terra@diku.dk>

	* src/expr.c (eval_expr_real): For integer 0^0, return #NUM!.
	(eval_expr_real): Adjust float power error check to match the
 	integer one.
parent 6fa0600e
1999-09-18 Morten Welinder <terra@diku.dk>
* src/expr.c (eval_expr_real): For integer 0^0, return #NUM!.
(eval_expr_real): Adjust float power error check to match the
integer one.
* src/style.c (style_new): Silence.
* src/sheet.c (sheet_update_controls): Initialize all closure
......
1999-09-18 Morten Welinder <terra@diku.dk>
* src/expr.c (eval_expr_real): For integer 0^0, return #NUM!.
(eval_expr_real): Adjust float power error check to match the
integer one.
* src/style.c (style_new): Silence.
* src/sheet.c (sheet_update_controls): Initialize all closure
......
......@@ -950,7 +950,7 @@ eval_expr_real (FunctionEvalInfo *s, ExprTree const *tree)
return value_new_float ((float_t) dres);
case OPER_EXP:
if (ia == 0 && ib < 0)
if (ia == 0 && ib <= 0)
return value_new_error (&s->pos, gnumeric_err_NUM);
dres = pow ((double)ia, (double)ib);
ires = (int)dres;
......@@ -985,9 +985,8 @@ eval_expr_real (FunctionEvalInfo *s, ExprTree const *tree)
: value_new_float(va / vb);
case OPER_EXP:
if (va == 0.)
return value_new_error (&s->pos,
gnumeric_err_NUM);
if (va == 0 && vb <= 0)
return value_new_error (&s->pos, gnumeric_err_NUM);
return value_new_float(pow(va, vb));
default:
......
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