Commit c07b5790 authored by Morten Welinder's avatar Morten Welinder

Deriv: fix ln.

parent be4528ee
......@@ -1315,7 +1315,8 @@ gnumeric_ln (GnmFuncEvalInfo *ei, GnmValue const * const *argv)
}
static GnmExpr const *
gnumeric_ln_deriv (GnmExpr const *expr, GnmEvalPos const *ep,
gnumeric_ln_deriv (GnmFunc *func,
GnmExpr const *expr, GnmEvalPos const *ep,
GnmExprDeriv *info, gpointer data)
{
GnmExpr const *deriv =
......
......@@ -89,12 +89,12 @@ gnm_expr_deriv_info_get_type (void)
return t;
}
void
/**
* gnm_expr_deriv_info_set_var:
* @deriv: #GnmExprDeriv
* @var: (transfer none): location of variable
*/
void
gnm_expr_deriv_info_set_var (GnmExprDeriv *deriv, GnmEvalPos const *var)
{
deriv->var = *var;
......@@ -567,8 +567,11 @@ gnm_expr_deriv (GnmExpr const *expr,
gnm_expr_new_funcall1 (fln, gnm_expr_copy (a)), 0);
GnmExpr const *s = madd (t1, 0, t2, 0);
return mmul (expr, 1, s, 0);
} else
} else {
gnm_expr_free (da);
gnm_expr_free (db);
return NULL;
}
COMMON_BINARY_END
}
......
......@@ -89,6 +89,14 @@ gnm_expr_new_constant (GnmValue *v)
/***************************************************************************/
/**
* gnm_expr_new_funcallv: (skip)
* @func: #GnmFunc
* @argc: argument count
* @argv: (array length=argc): transfers everything
*
* Returns: (transfer full): function call expression.
*/
static GnmExpr const *
gnm_expr_new_funcallv (GnmFunc *func, int argc, GnmExprConstPtr *argv)
{
......@@ -106,6 +114,13 @@ gnm_expr_new_funcallv (GnmFunc *func, int argc, GnmExprConstPtr *argv)
return (GnmExpr *)ans;
}
/**
* gnm_expr_new_funcall: (skip)
* @func: #GnmFunc
* @args: argument list -- transfers content, not container
*
* Returns: (transfer full): function call expression.
*/
GnmExpr const *
gnm_expr_new_funcall (GnmFunc *func, GnmExprList *arg_list)
{
......@@ -121,6 +136,13 @@ gnm_expr_new_funcall (GnmFunc *func, GnmExprList *arg_list)
return gnm_expr_new_funcallv (func, argc, argv);
}
/**
* gnm_expr_new_funcall1:
* @func: #GnmFunc
* @arg0: (transfer full): argument
*
* Returns: (transfer full): function call expression.
*/
GnmExpr const *
gnm_expr_new_funcall1 (GnmFunc *func,
GnmExpr const *arg0)
......@@ -130,6 +152,14 @@ gnm_expr_new_funcall1 (GnmFunc *func,
return gnm_expr_new_funcallv (func, 1, argv);
}
/**
* gnm_expr_new_funcall2:
* @func: #GnmFunc
* @arg0: (transfer full): argument
* @arg1: (transfer full): argument
*
* Returns: (transfer full): function call expression.
*/
GnmExpr const *
gnm_expr_new_funcall2 (GnmFunc *func,
GnmExpr const *arg0,
......@@ -141,6 +171,15 @@ gnm_expr_new_funcall2 (GnmFunc *func,
return gnm_expr_new_funcallv (func, 2, argv);
}
/**
* gnm_expr_new_funcall3:
* @func: #GnmFunc
* @arg0: (transfer full): argument
* @arg1: (transfer full): argument
* @arg2: (transfer full): argument
*
* Returns: (transfer full): function call expression.
*/
GnmExpr const *
gnm_expr_new_funcall3 (GnmFunc *func,
GnmExpr const *arg0,
......@@ -154,6 +193,16 @@ gnm_expr_new_funcall3 (GnmFunc *func,
return gnm_expr_new_funcallv (func, 3, argv);
}
/**
* gnm_expr_new_funcall4:
* @func: #GnmFunc
* @arg0: (transfer full): argument
* @arg1: (transfer full): argument
* @arg2: (transfer full): argument
* @arg3: (transfer full): argument
*
* Returns: (transfer full): function call expression.
*/
GnmExpr const *
gnm_expr_new_funcall4 (GnmFunc *func,
GnmExpr const *arg0,
......@@ -169,6 +218,17 @@ gnm_expr_new_funcall4 (GnmFunc *func,
return gnm_expr_new_funcallv (func, 4, argv);
}
/**
* gnm_expr_new_funcall5:
* @func: #GnmFunc
* @arg0: (transfer full): argument
* @arg1: (transfer full): argument
* @arg2: (transfer full): argument
* @arg3: (transfer full): argument
* @arg4: (transfer full): argument
*
* Returns: (transfer full): function call expression.
*/
GnmExpr const *
gnm_expr_new_funcall5 (GnmFunc *func,
GnmExpr const *arg0,
......
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