[seed] [mpfr] Added mpfr.nan_p, inf_p, number_p, zero_p
- From: Tim Horton <hortont src gnome org>
- To: svn-commits-list gnome org
- Subject: [seed] [mpfr] Added mpfr.nan_p, inf_p, number_p, zero_p
- Date: Sun, 5 Jul 2009 19:09:14 +0000 (UTC)
commit cb57e058f41fb89052f94cb98a2eb15999117a70
Author: Matt ARSENAULT <arsenm2 rpi edu>
Date: Sun Jul 5 12:04:13 2009 -0400
[mpfr] Added mpfr.nan_p, inf_p, number_p, zero_p
modules/mpfr/seed-mpfr-cmp.c | 80 ++++++++++++++++++++++++++++++++++++++++++
modules/mpfr/seed-mpfr.c | 4 ++
modules/mpfr/seed-mpfr.h | 5 +++
3 files changed, 89 insertions(+), 0 deletions(-)
---
diff --git a/modules/mpfr/seed-mpfr-cmp.c b/modules/mpfr/seed-mpfr-cmp.c
index 23ae99e..970f843 100644
--- a/modules/mpfr/seed-mpfr-cmp.c
+++ b/modules/mpfr/seed-mpfr-cmp.c
@@ -58,3 +58,83 @@ SeedValue seed_mpfr_cmpabs (SeedContext ctx,
return seed_value_from_int(ctx, ret, exception);
}
+SeedValue
+seed_mpfr_nan_p (SeedContext ctx,
+ SeedObject function,
+ SeedObject this_object,
+ gsize argument_count,
+ const SeedValue args[],
+ SeedException * exception)
+{
+ mpfr_ptr rop;
+ gboolean ret;
+
+ CHECK_ARG_COUNT("mpfr.nan_p", 0);
+
+ rop = seed_object_get_private(this_object);
+
+ ret = mpfr_nan_p(rop);
+
+ return seed_value_from_boolean(ctx, ret, exception);
+}
+
+SeedValue
+seed_mpfr_inf_p (SeedContext ctx,
+ SeedObject function,
+ SeedObject this_object,
+ gsize argument_count,
+ const SeedValue args[],
+ SeedException * exception)
+{
+ mpfr_ptr rop;
+ gboolean ret;
+
+ CHECK_ARG_COUNT("mpfr.inf_p", 0);
+
+ rop = seed_object_get_private(this_object);
+
+ ret = mpfr_inf_p(rop);
+
+ return seed_value_from_boolean(ctx, ret, exception);
+}
+
+SeedValue
+seed_mpfr_number_p (SeedContext ctx,
+ SeedObject function,
+ SeedObject this_object,
+ gsize argument_count,
+ const SeedValue args[],
+ SeedException * exception)
+{
+ mpfr_ptr rop;
+ gboolean ret;
+
+ CHECK_ARG_COUNT("mpfr.number_p", 0);
+
+ rop = seed_object_get_private(this_object);
+
+ ret = mpfr_number_p(rop);
+
+ return seed_value_from_boolean(ctx, ret, exception);
+}
+
+SeedValue
+seed_mpfr_zero_p (SeedContext ctx,
+ SeedObject function,
+ SeedObject this_object,
+ gsize argument_count,
+ const SeedValue args[],
+ SeedException * exception)
+{
+ mpfr_ptr rop;
+ gboolean ret;
+
+ CHECK_ARG_COUNT("mpfr.zero_p", 0);
+
+ rop = seed_object_get_private(this_object);
+
+ ret = mpfr_zero_p(rop);
+
+ return seed_value_from_boolean(ctx, ret, exception);
+}
+
diff --git a/modules/mpfr/seed-mpfr.c b/modules/mpfr/seed-mpfr.c
index c53154d..854959a 100644
--- a/modules/mpfr/seed-mpfr.c
+++ b/modules/mpfr/seed-mpfr.c
@@ -632,6 +632,10 @@ seed_static_function mpfr_funcs[] =
{"swap", seed_mpfr_swap, 0},
{"cmp", seed_mpfr_cmp, 0},
{"cmpabs", seed_mpfr_cmpabs, 0},
+ {"nan_p", seed_mpfr_nan_p, 0},
+ {"inf_p", seed_mpfr_inf_p, 0},
+ {"number_p", seed_mpfr_number_p, 0},
+ {"zero_p", seed_mpfr_zero_p, 0},
{"get_d", seed_mpfr_get_d, 0},
{"fits_ulong_p", seed_mpfr_fits_ulong_p, 0},
{"fits_slong_p", seed_mpfr_fits_slong_p, 0},
diff --git a/modules/mpfr/seed-mpfr.h b/modules/mpfr/seed-mpfr.h
index b7a8bd4..8212ae4 100644
--- a/modules/mpfr/seed-mpfr.h
+++ b/modules/mpfr/seed-mpfr.h
@@ -90,5 +90,10 @@ DEF_SEED_MPFR_FUNC(seed_mpfr_cbrt);
DEF_SEED_MPFR_FUNC(seed_mpfr_cmp);
DEF_SEED_MPFR_FUNC(seed_mpfr_cmpabs);
+DEF_SEED_MPFR_FUNC(seed_mpfr_nan_p);
+DEF_SEED_MPFR_FUNC(seed_mpfr_inf_p);
+DEF_SEED_MPFR_FUNC(seed_mpfr_number_p);
+DEF_SEED_MPFR_FUNC(seed_mpfr_zero_p);
+
#endif /* _SEED_MFPR_H_ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]