[seed] [mpfr] Added mpfr.mul_2si
- From: Tim Horton <hortont src gnome org>
- To: svn-commits-list gnome org
- Subject: [seed] [mpfr] Added mpfr.mul_2si
- Date: Thu, 9 Jul 2009 01:48:58 +0000 (UTC)
commit ebfee4e5c63cfd8be80e3a1f1f1048a0c9e30421
Author: Matt ARSENAULT <arsenm2 rpi edu>
Date: Wed Jul 8 19:00:15 2009 -0400
[mpfr] Added mpfr.mul_2si
modules/mpfr/seed-mpfr-arithmetic.c | 40 +++++++++++++++++++++++++++++++++++
modules/mpfr/seed-mpfr.c | 1 +
modules/mpfr/seed-mpfr.h | 1 +
3 files changed, 42 insertions(+), 0 deletions(-)
---
diff --git a/modules/mpfr/seed-mpfr-arithmetic.c b/modules/mpfr/seed-mpfr-arithmetic.c
index f06758c..f874bd7 100644
--- a/modules/mpfr/seed-mpfr-arithmetic.c
+++ b/modules/mpfr/seed-mpfr-arithmetic.c
@@ -1170,3 +1170,43 @@ SeedValue seed_mpfr_copysign (SeedContext ctx,
return seed_value_from_int(ctx, ret, exception);
}
+SeedValue seed_mpfr_mul_2si (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;
+ gulong k;
+
+ CHECK_ARG_COUNT("mpfr.mul_2si", 3);
+
+ rop = seed_object_get_private(this_object);
+ rnd = seed_value_to_mpfr_rnd_t(ctx, args[2], exception);
+
+ if ( seed_value_is_object_of_class(ctx, args[0], mpfr_class) )
+ {
+ op = seed_object_get_private(args[0]);
+ }
+ else
+ {
+ TYPE_EXCEPTION("mpfr.mul_2si", "mpfr_t");
+ }
+
+ if ( seed_value_is_number(ctx, args[1]) )
+ {
+ k = seed_value_to_ulong(ctx, args[1], exception);
+ }
+ else
+ {
+ TYPE_EXCEPTION("mpfr.mul_2si", "long int");
+ }
+
+ ret = mpfr_mul_2si(rop, op, k, rnd);
+
+ return seed_value_from_int(ctx, ret, exception);
+}
+
diff --git a/modules/mpfr/seed-mpfr.c b/modules/mpfr/seed-mpfr.c
index 02adc97..e092a60 100644
--- a/modules/mpfr/seed-mpfr.c
+++ b/modules/mpfr/seed-mpfr.c
@@ -993,6 +993,7 @@ seed_static_function mpfr_funcs[] =
{"sqrt", seed_mpfr_sqrt, 0},
{"sqr", seed_mpfr_sqr, 0},
{"pow", seed_mpfr_pow, 0},
+ {"mul_2si", seed_mpfr_mul_2si, 0},
{"root", seed_mpfr_root, 0},
{"rec_sqrt", seed_mpfr_rec_sqrt, 0},
{"cbrt", seed_mpfr_cbrt, 0},
diff --git a/modules/mpfr/seed-mpfr.h b/modules/mpfr/seed-mpfr.h
index b66a3ef..33e1ffc 100644
--- a/modules/mpfr/seed-mpfr.h
+++ b/modules/mpfr/seed-mpfr.h
@@ -125,6 +125,7 @@ DEF_SEED_MPFR_FUNC(seed_mpfr_pow);
DEF_SEED_MPFR_FUNC(seed_mpfr_root);
DEF_SEED_MPFR_FUNC(seed_mpfr_rec_sqrt);
DEF_SEED_MPFR_FUNC(seed_mpfr_cbrt);
+DEF_SEED_MPFR_FUNC(seed_mpfr_mul_2si);
DEF_SEED_MPFR_FUNC(seed_mpfr_cmp);
DEF_SEED_MPFR_FUNC(seed_mpfr_cmpabs);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]