[seed] [mpfr] Implement csc, sec, cot
- From: Tim Horton <hortont src gnome org>
- To: svn-commits-list gnome org
- Subject: [seed] [mpfr] Implement csc, sec, cot
- Date: Sun, 5 Jul 2009 06:53:49 +0000 (UTC)
commit f93379064725ad720b03e14b1b409edd2a5d6ddb
Author: Matt ARSENAULT <arsenm2 rpi edu>
Date: Sun Jul 5 02:05:47 2009 -0400
[mpfr] Implement csc, sec, cot
modules/mpfr/seed-mpfr-trig.c | 90 +++++++++++++++++++++++++++++++++++++++++
modules/mpfr/seed-mpfr.h | 4 ++
2 files changed, 94 insertions(+), 0 deletions(-)
---
diff --git a/modules/mpfr/seed-mpfr-trig.c b/modules/mpfr/seed-mpfr-trig.c
index f499737..5315caa 100644
--- a/modules/mpfr/seed-mpfr-trig.c
+++ b/modules/mpfr/seed-mpfr-trig.c
@@ -93,3 +93,93 @@ SeedValue seed_mpfr_tan (SeedContext ctx,
return seed_value_from_int(ctx, ret, exception);
}
+SeedValue seed_mpfr_csc (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.csc", 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.csc", "mpfr_t");
+ }
+
+ ret = mpfr_csc(rop, op, rnd);
+
+ return seed_value_from_int(ctx, ret, exception);
+}
+
+SeedValue seed_mpfr_sec (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.sec", 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.sec", "mpfr_t");
+ }
+
+ ret = mpfr_sec(rop, op, rnd);
+
+ return seed_value_from_int(ctx, ret, exception);
+}
+
+SeedValue seed_mpfr_cot (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.cot", 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.cot", "mpfr_t");
+ }
+
+ ret = mpfr_cot(rop, op, rnd);
+
+ return seed_value_from_int(ctx, ret, exception);
+}
+
diff --git a/modules/mpfr/seed-mpfr.h b/modules/mpfr/seed-mpfr.h
index 60fd55d..35776e2 100644
--- a/modules/mpfr/seed-mpfr.h
+++ b/modules/mpfr/seed-mpfr.h
@@ -59,5 +59,9 @@ DEF_SEED_MPFR_FUNC(seed_mpfr_sin);
DEF_SEED_MPFR_FUNC(seed_mpfr_cos);
DEF_SEED_MPFR_FUNC(seed_mpfr_tan);
+DEF_SEED_MPFR_FUNC(seed_mpfr_csc);
+DEF_SEED_MPFR_FUNC(seed_mpfr_sec);
+DEF_SEED_MPFR_FUNC(seed_mpfr_cot);
+
#endif /* _SEED_MFPR_H_ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]