[seed] [mpfr] get/set default rounding mode
- From: Tim Horton <hortont src gnome org>
- To: svn-commits-list gnome org
- Subject: [seed] [mpfr] get/set default rounding mode
- Date: Mon, 6 Jul 2009 03:11:24 +0000 (UTC)
commit dd843896e1a3ba40e61790121fe8613d984034e8
Author: Matt ARSENAULT <arsenm2 rpi edu>
Date: Sun Jul 5 20:01:37 2009 -0400
[mpfr] get/set default rounding mode
modules/mpfr/seed-mpfr.c | 24 ++++++++++++++++++++++++
1 files changed, 24 insertions(+), 0 deletions(-)
---
diff --git a/modules/mpfr/seed-mpfr.c b/modules/mpfr/seed-mpfr.c
index f78ce36..408ec5d 100644
--- a/modules/mpfr/seed-mpfr.c
+++ b/modules/mpfr/seed-mpfr.c
@@ -361,6 +361,28 @@ seed_mpfr_set_exp (SeedContext ctx,
return TRUE;
}
+static gboolean
+seed_mpfr_set_default_rounding_mode (SeedContext ctx,
+ SeedObject this_object,
+ SeedString property_name,
+ SeedValue value,
+ SeedException *exception)
+{
+ mpfr_ptr ptr = seed_object_get_private(this_object);
+ mpfr_set_default_rounding_mode(ptr, seed_value_to_mp_rnd_t(ctx, value, exception));
+ return TRUE;
+}
+
+static SeedValue
+seed_mpfr_get_default_rounding_mode (SeedContext ctx,
+ SeedObject this_object,
+ SeedString property_name,
+ SeedException *exception)
+{
+ mpfr_ptr ptr = seed_object_get_private(this_object);
+ return seed_value_from_mpfr_rnd_t(ctx, mpfr_get_default_rounding_mode(ptr), exception);
+}
+
static SeedValue
seed_mpfr_get_prec (SeedContext ctx,
SeedObject this_object,
@@ -726,10 +748,12 @@ seed_static_function mpfr_funcs[] =
{NULL, NULL, 0}
};
+/* CHECKME: thing that doesn't belong here */
seed_static_value mpfr_values[] =
{
{"prec", seed_mpfr_get_prec, seed_mpfr_set_prec, SEED_PROPERTY_ATTRIBUTE_DONT_DELETE},
{"exp", seed_mpfr_get_exp, seed_mpfr_set_exp, SEED_PROPERTY_ATTRIBUTE_DONT_DELETE},
+ {"default_rounding_mode", seed_mpfr_get_default_rounding_mode, seed_mpfr_set_default_rounding_mode, SEED_PROPERTY_ATTRIBUTE_DONT_DELETE},
{NULL, 0, NULL, 0}
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]