[seed] [mpfr] Added sech, csch, coth
- From: Tim Horton <hortont src gnome org>
- To: svn-commits-list gnome org
- Subject: [seed] [mpfr] Added sech, csch, coth
- Date: Sun, 5 Jul 2009 06:54:14 +0000 (UTC)
commit a4d7e13b1fa4ccbd9e0396222c9a98ddadfcb933
Author: Matt ARSENAULT <arsenm2 rpi edu>
Date: Sun Jul 5 02:39:46 2009 -0400
[mpfr] Added sech, csch, coth
modules/mpfr/seed-mpfr-trig.c | 91 +++++++++++++++++++++++++++++++++++++++++
modules/mpfr/seed-mpfr.c | 3 +
modules/mpfr/seed-mpfr.h | 4 ++
3 files changed, 98 insertions(+), 0 deletions(-)
---
diff --git a/modules/mpfr/seed-mpfr-trig.c b/modules/mpfr/seed-mpfr-trig.c
index 1bc4425..509cb11 100644
--- a/modules/mpfr/seed-mpfr-trig.c
+++ b/modules/mpfr/seed-mpfr-trig.c
@@ -459,3 +459,94 @@ SeedValue seed_mpfr_tanh (SeedContext ctx,
return seed_value_from_int(ctx, ret, exception);
}
+
+SeedValue seed_mpfr_sech (SeedContext ctx,
+ SeedObject function,
+ SeedObject this_object,
+ gsize argument_count,
+ const SeedValue args[],
+ SeedException * exception)
+{
+ mpfr_rnd_t rnd;
+ mpfr_ptr rop, op;
+ gint ret;
+
+ CHECK_ARG_COUNT("mpfr.sech", 2);
+
+ rop = seed_object_get_private(this_object);
+ rnd = seed_value_to_mpfr_rnd_t(ctx, args[1], exception);
+
+ if ( seed_value_is_object_of_class(ctx, args[0], mpfr_class) )
+ {
+ op = seed_object_get_private(args[0]);
+ }
+ else
+ {
+ TYPE_EXCEPTION("mpfr.sech", "mpfr_t");
+ }
+
+ ret = mpfr_sech(rop, op, rnd);
+
+ return seed_value_from_int(ctx, ret, exception);
+}
+
+SeedValue seed_mpfr_csch (SeedContext ctx,
+ SeedObject function,
+ SeedObject this_object,
+ gsize argument_count,
+ const SeedValue args[],
+ SeedException * exception)
+{
+ mpfr_rnd_t rnd;
+ mpfr_ptr rop, op;
+ gint ret;
+
+ CHECK_ARG_COUNT("mpfr.csch", 2);
+
+ rop = seed_object_get_private(this_object);
+ rnd = seed_value_to_mpfr_rnd_t(ctx, args[1], exception);
+
+ if ( seed_value_is_object_of_class(ctx, args[0], mpfr_class) )
+ {
+ op = seed_object_get_private(args[0]);
+ }
+ else
+ {
+ TYPE_EXCEPTION("mpfr.csch", "mpfr_t");
+ }
+
+ ret = mpfr_csch(rop, op, rnd);
+
+ return seed_value_from_int(ctx, ret, exception);
+}
+
+SeedValue seed_mpfr_coth (SeedContext ctx,
+ SeedObject function,
+ SeedObject this_object,
+ gsize argument_count,
+ const SeedValue args[],
+ SeedException * exception)
+{
+ mpfr_rnd_t rnd;
+ mpfr_ptr rop, op;
+ gint ret;
+
+ CHECK_ARG_COUNT("mpfr.coth", 2);
+
+ rop = seed_object_get_private(this_object);
+ rnd = seed_value_to_mpfr_rnd_t(ctx, args[1], exception);
+
+ if ( seed_value_is_object_of_class(ctx, args[0], mpfr_class) )
+ {
+ op = seed_object_get_private(args[0]);
+ }
+ else
+ {
+ TYPE_EXCEPTION("mpfr.coth", "mpfr_t");
+ }
+
+ ret = mpfr_coth(rop, op, rnd);
+
+ return seed_value_from_int(ctx, ret, exception);
+}
+
diff --git a/modules/mpfr/seed-mpfr.c b/modules/mpfr/seed-mpfr.c
index c5cb8f2..ba33718 100644
--- a/modules/mpfr/seed-mpfr.c
+++ b/modules/mpfr/seed-mpfr.c
@@ -346,6 +346,9 @@ seed_static_function mpfr_funcs[] =
{"sinh", seed_mpfr_sinh, 0},
{"cosh", seed_mpfr_cosh, 0},
{"tanh", seed_mpfr_tanh, 0},
+ {"csch", seed_mpfr_csch, 0},
+ {"sech", seed_mpfr_sech, 0},
+ {"coth", seed_mpfr_coth, 0},
{"set", seed_mpfr_set, 0},
{"out_str", seed_mpfr_out_str, 0},
{"pi", seed_mpfr_const_pi, 0},
diff --git a/modules/mpfr/seed-mpfr.h b/modules/mpfr/seed-mpfr.h
index e68b6e7..47cc5a9 100644
--- a/modules/mpfr/seed-mpfr.h
+++ b/modules/mpfr/seed-mpfr.h
@@ -75,5 +75,9 @@ DEF_SEED_MPFR_FUNC(seed_mpfr_sinh);
DEF_SEED_MPFR_FUNC(seed_mpfr_cosh);
DEF_SEED_MPFR_FUNC(seed_mpfr_tanh);
+DEF_SEED_MPFR_FUNC(seed_mpfr_csch);
+DEF_SEED_MPFR_FUNC(seed_mpfr_sech);
+DEF_SEED_MPFR_FUNC(seed_mpfr_coth);
+
#endif /* _SEED_MFPR_H_ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]