[seed] [mpfr] Added nexttoward, nextabove, nextbelow
- From: Tim Horton <hortont src gnome org>
- To: svn-commits-list gnome org
- Subject: [seed] [mpfr] Added nexttoward, nextabove, nextbelow
- Date: Mon, 6 Jul 2009 03:11:09 +0000 (UTC)
commit ceefddab9e23f237c3f25f4a79cd1a0fdc5556e1
Author: Matt ARSENAULT <arsenm2 rpi edu>
Date: Sun Jul 5 19:28:31 2009 -0400
[mpfr] Added nexttoward, nextabove, nextbelow
modules/mpfr/seed-mpfr-arithmetic.c | 61 +++++++++++++++++++++++++++++++++++
modules/mpfr/seed-mpfr.c | 3 ++
modules/mpfr/seed-mpfr.h | 4 ++
3 files changed, 68 insertions(+), 0 deletions(-)
---
diff --git a/modules/mpfr/seed-mpfr-arithmetic.c b/modules/mpfr/seed-mpfr-arithmetic.c
index 38b1bc7..7428805 100644
--- a/modules/mpfr/seed-mpfr-arithmetic.c
+++ b/modules/mpfr/seed-mpfr-arithmetic.c
@@ -623,3 +623,64 @@ SeedValue seed_mpfr_remainder (SeedContext ctx,
return seed_value_from_int(ctx, ret, exception);
}
+SeedValue seed_mpfr_nexttoward (SeedContext ctx,
+ SeedObject function,
+ SeedObject this_object,
+ gsize argument_count,
+ const SeedValue args[],
+ SeedException * exception)
+{
+ mpfr_ptr rop, op;
+
+ CHECK_ARG_COUNT("mpfr.nexttoward", 1);
+
+ rop = seed_object_get_private(this_object);
+
+ if ( seed_value_is_object_of_class(ctx, args[0], mpfr_class) )
+ {
+ op = seed_object_get_private(args[0]);
+ }
+ else
+ {
+ TYPE_EXCEPTION("mpfr.nexttoward", "mpfr_t");
+ }
+
+ mpfr_nexttoward(rop, op);
+
+ return seed_make_null(ctx);
+}
+
+SeedValue seed_mpfr_nextabove (SeedContext ctx,
+ SeedObject function,
+ SeedObject this_object,
+ gsize argument_count,
+ const SeedValue args[],
+ SeedException * exception)
+{
+ mpfr_ptr rop;
+
+ CHECK_ARG_COUNT("mpfr.nextabove", 0);
+
+ rop = seed_object_get_private(this_object);
+
+ mpfr_nextabove(rop);
+ return seed_make_null(ctx);
+}
+
+SeedValue seed_mpfr_nextbelow (SeedContext ctx,
+ SeedObject function,
+ SeedObject this_object,
+ gsize argument_count,
+ const SeedValue args[],
+ SeedException * exception)
+{
+ mpfr_ptr rop;
+
+ CHECK_ARG_COUNT("mpfr.nextbelow", 0);
+
+ rop = seed_object_get_private(this_object);
+
+ mpfr_nextbelow(rop);
+ return seed_make_null(ctx);
+}
+
diff --git a/modules/mpfr/seed-mpfr.c b/modules/mpfr/seed-mpfr.c
index b2ecec1..10e9f8c 100644
--- a/modules/mpfr/seed-mpfr.c
+++ b/modules/mpfr/seed-mpfr.c
@@ -636,6 +636,9 @@ seed_static_function mpfr_funcs[] =
{"floor", seed_mpfr_floor, 0},
{"round", seed_mpfr_round, 0},
{"trunc", seed_mpfr_trunc, 0},
+ {"nexttoward", seed_mpfr_nexttoward, 0},
+ {"nextabove", seed_mpfr_nextabove, 0},
+ {"nextbelow", seed_mpfr_nextbelow, 0},
{"rint_ceil", seed_mpfr_rint_ceil, 0},
{"rint_floor", seed_mpfr_rint_floor, 0},
{"rint_round", seed_mpfr_rint_round, 0},
diff --git a/modules/mpfr/seed-mpfr.h b/modules/mpfr/seed-mpfr.h
index 3f40ad1..7affb7c 100644
--- a/modules/mpfr/seed-mpfr.h
+++ b/modules/mpfr/seed-mpfr.h
@@ -65,6 +65,10 @@ DEF_SEED_MPFR_FUNC(seed_mpfr_round);
DEF_SEED_MPFR_FUNC(seed_mpfr_trunc);
DEF_SEED_MPFR_FUNC(seed_mpfr_frac);
+DEF_SEED_MPFR_FUNC(seed_mpfr_nexttoward);
+DEF_SEED_MPFR_FUNC(seed_mpfr_nextabove);
+DEF_SEED_MPFR_FUNC(seed_mpfr_nextbelow);
+
DEF_SEED_MPFR_FUNC(seed_mpfr_fmod);
DEF_SEED_MPFR_FUNC(seed_mpfr_remainder);
DEF_SEED_MPFR_FUNC(seed_mpfr_integer_p);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]