Commit 45b1c801 authored by Arturo Espinosa's avatar Arturo Espinosa

Even more functions -mig

parent 832857df
1998-08-04 <miguel@nuclecu.unam.mx>
* src/func.c (gnumeric_cosh): More functions.
1998-08-05 <miguel@nuclecu.unam.mx>
* src/item-edit.c (item_edit_set_arg):
* src/gnumeric-sheet.c (cancel_pending_input): Cancel changes
made.
(start_editing_at_cursor): Make a copy of the original text, and
......
1998-08-04 <miguel@nuclecu.unam.mx>
* src/func.c (gnumeric_cosh): More functions.
1998-08-05 <miguel@nuclecu.unam.mx>
* src/item-edit.c (item_edit_set_arg):
* src/gnumeric-sheet.c (cancel_pending_input): Cancel changes
made.
(start_editing_at_cursor): Make a copy of the original text, and
......
1998-08-04 <miguel@nuclecu.unam.mx>
* src/func.c (gnumeric_cosh): More functions.
1998-08-05 <miguel@nuclecu.unam.mx>
* src/item-edit.c (item_edit_set_arg):
* src/gnumeric-sheet.c (cancel_pending_input): Cancel changes
made.
(start_editing_at_cursor): Make a copy of the original text, and
......
1998-08-04 <miguel@nuclecu.unam.mx>
* src/func.c (gnumeric_cosh): More functions.
1998-08-05 <miguel@nuclecu.unam.mx>
* src/item-edit.c (item_edit_set_arg):
* src/gnumeric-sheet.c (cancel_pending_input): Cancel changes
made.
(start_editing_at_cursor): Make a copy of the original text, and
......
......@@ -42,6 +42,24 @@ gnumeric_acos (int argc, Value *argv [], char **error_string)
return v;
}
static Value *
gnumeric_acosh (int argc, Value *argv [], char **error_string)
{
Value *v;
float_t t;
t = value_get_as_double (argv [0]);
if (t < 1.0){
*error_string = _("acosh - domain error");
return NULL;
}
v = g_new (Value, 1);
v->type = VALUE_FLOAT;
v->v.v_float = acosh (t);
return v;
}
static Value *
gnumeric_asin (int argc, Value *argv [], char **error_string)
{
......@@ -60,6 +78,18 @@ gnumeric_asin (int argc, Value *argv [], char **error_string)
return v;
}
static Value *
gnumeric_asinh (int argc, Value *argv [], char **error_string)
{
Value *v;
v = g_new (Value, 1);
v->type = VALUE_FLOAT;
v->v.v_float = asinh (value_get_as_double (argv [0]));
return v;
}
static Value *
gnumeric_atan (int argc, Value *argv [], char **error_string)
{
......@@ -71,6 +101,23 @@ gnumeric_atan (int argc, Value *argv [], char **error_string)
return v;
}
static Value *
gnumeric_atanh (int argc, Value *argv [], char **error_string)
{
Value *v = g_new (Value, 1);
float_t t;
t = value_get_as_double (argv [0]);
if ((t <= -1.0) || (t >= 1.0)){
*error_string = _("atanh: domain error");
return NULL;
}
v->type = VALUE_FLOAT;
v->v.v_float = atanh (value_get_as_double (argv [0]));
return v;
}
static Value *
gnumeric_atan2 (int argc, Value *argv [], char **error_string)
{
......@@ -105,6 +152,17 @@ gnumeric_cos (int argc, Value *argv [], char **error_string)
return v;
}
static Value *
gnumeric_cosh (int argc, Value *argv [], char **error_string)
{
Value *v = g_new (Value, 1);
v->type = VALUE_FLOAT;
v->v.v_float = cos (value_get_as_double (argv [0]));
return v;
}
static Value *
gnumeric_exp (int argc, Value *argv [], char **error_string)
{
......@@ -173,7 +231,18 @@ gnumeric_sin (int argc, Value *argv [], char **error_string)
return v;
}
static Value *
gnumeric_sinh (int argc, Value *argv [], char **error_string)
{
Value *v = g_new (Value, 1);
v->type = VALUE_FLOAT;
v->v.v_float = sinh (value_get_as_double (argv [0]));
return v;
}
static Value *
gnumeric_tan (int argc, Value *argv [], char **error_string)
{
......@@ -185,6 +254,17 @@ gnumeric_tan (int argc, Value *argv [], char **error_string)
return v;
}
static Value *
gnumeric_tanh (int argc, Value *argv [], char **error_string)
{
Value *v = g_new (Value, 1);
v->type = VALUE_FLOAT;
v->v.v_float = tanh (value_get_as_double (argv [0]));
return v;
}
static Value *
gnumeric_pi (int argc, Value *argv [], char *error_string)
{
......@@ -199,10 +279,14 @@ gnumeric_pi (int argc, Value *argv [], char *error_string)
FunctionDefinition internal_functions [] = {
{ "abs", "f", VALUE_FLOAT, NULL, gnumeric_abs },
{ "acos", "f", VALUE_FLOAT, NULL, gnumeric_acos },
{ "acosh", "f", VALUE_FLOAT, NULL, gnumeric_acosh },
{ "asin", "f", VALUE_FLOAT, NULL, gnumeric_asin },
{ "asinh", "f", VALUE_FLOAT, NULL, gnumeric_asinh },
{ "atan", "f", VALUE_FLOAT, NULL, gnumeric_atan },
{ "atanh", "f", VALUE_FLOAT, NULL, gnumeric_atanh },
{ "atan2", "ff", VALUE_FLOAT, NULL, gnumeric_atan2 },
{ "cos", "f", VALUE_FLOAT, NULL, gnumeric_cos },
{ "cosh", "f", VALUE_FLOAT, NULL, gnumeric_cosh },
{ "ceil", "f", VALUE_FLOAT, NULL, gnumeric_ceil },
{ "exp", "f", VALUE_FLOAT, NULL, gnumeric_exp },
{ "floor", "f", VALUE_FLOAT, NULL, gnumeric_floor },
......@@ -210,7 +294,9 @@ FunctionDefinition internal_functions [] = {
{ "log", "f", VALUE_FLOAT, NULL, gnumeric_log },
{ "log10", "f", VALUE_FLOAT, NULL, gnumeric_log10 },
{ "sin", "f", VALUE_FLOAT, NULL, gnumeric_sin },
{ "sinh", "f", VALUE_FLOAT, NULL, gnumeric_sinh },
{ "tan", "f", VALUE_FLOAT, NULL, gnumeric_tan },
{ "tanh", "f", VALUE_FLOAT, NULL, gnumeric_tanh },
{ "pi", "", VALUE_FLOAT, NULL, gnumeric_pi },
{ NULL, NULL },
};
......
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