[seed] [mpfr] Added asinh, acosh, atanh
- From: Tim Horton <hortont src gnome org>
- To: svn-commits-list gnome org
- Subject: [seed] [mpfr] Added asinh, acosh, atanh
- Date: Sun, 5 Jul 2009 06:54:19 +0000 (UTC)
commit ee44ad8fc38e04d2302340304a25d497359fa7aa
Author: Matt ARSENAULT <arsenm2 rpi edu>
Date: Sun Jul 5 02:45:50 2009 -0400
[mpfr] Added asinh, acosh, atanh
modules/mpfr/seed-mpfr-trig.c | 92 +++++++++++++++++++++++++++++++++++++++++
modules/mpfr/seed-mpfr.c | 3 +
modules/mpfr/seed-mpfr.h | 4 ++
3 files changed, 99 insertions(+), 0 deletions(-)
---
diff --git a/modules/mpfr/seed-mpfr-trig.c b/modules/mpfr/seed-mpfr-trig.c
index 509cb11..1ae4e9d 100644
--- a/modules/mpfr/seed-mpfr-trig.c
+++ b/modules/mpfr/seed-mpfr-trig.c
@@ -550,3 +550,95 @@ SeedValue seed_mpfr_coth (SeedContext ctx,
return seed_value_from_int(ctx, ret, exception);
}
+/* inverse hyperbolic trig */
+
+SeedValue seed_mpfr_asinh (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.asinh", 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.asinh", "mpfr_t");
+ }
+
+ ret = mpfr_asinh(rop, op, rnd);
+
+ return seed_value_from_int(ctx, ret, exception);
+}
+
+SeedValue seed_mpfr_acosh (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.acosh", 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.acosh", "mpfr_t");
+ }
+
+ ret = mpfr_acosh(rop, op, rnd);
+
+ return seed_value_from_int(ctx, ret, exception);
+}
+
+SeedValue seed_mpfr_atanh (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.atanh", 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.atanh", "mpfr_t");
+ }
+
+ ret = mpfr_atanh(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 ba33718..d70fb9d 100644
--- a/modules/mpfr/seed-mpfr.c
+++ b/modules/mpfr/seed-mpfr.c
@@ -349,6 +349,9 @@ seed_static_function mpfr_funcs[] =
{"csch", seed_mpfr_csch, 0},
{"sech", seed_mpfr_sech, 0},
{"coth", seed_mpfr_coth, 0},
+ {"asinh", seed_mpfr_asinh, 0},
+ {"acosh", seed_mpfr_acosh, 0},
+ {"atanh", seed_mpfr_atanh, 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 47cc5a9..b691c75 100644
--- a/modules/mpfr/seed-mpfr.h
+++ b/modules/mpfr/seed-mpfr.h
@@ -79,5 +79,9 @@ DEF_SEED_MPFR_FUNC(seed_mpfr_csch);
DEF_SEED_MPFR_FUNC(seed_mpfr_sech);
DEF_SEED_MPFR_FUNC(seed_mpfr_coth);
+DEF_SEED_MPFR_FUNC(seed_mpfr_asinh);
+DEF_SEED_MPFR_FUNC(seed_mpfr_acosh);
+DEF_SEED_MPFR_FUNC(seed_mpfr_atanh);
+
#endif /* _SEED_MFPR_H_ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]