diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2020-06-11 21:22:20 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2020-06-11 21:22:20 +0000 |
commit | 3a1ba696667522aefc77f7f53fa3c0b298f96795 (patch) | |
tree | 2b669d750c3b35d8a8a159a7b887794c3b952a87 | |
parent | 798552b1d672f5c3c8508e946ce18c7c54922fb6 (diff) | |
download | mpfr-3a1ba696667522aefc77f7f53fa3c0b298f96795.tar.gz |
Renamed mpfr_total_order to mpfr_total_order_p for consistency with the
other predicates (by convention, the function name should end with _p).
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@13989 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | doc/mpfr.texi | 12 | ||||
-rw-r--r-- | src/mpfr.h | 2 | ||||
-rw-r--r-- | src/total_order.c | 4 | ||||
-rw-r--r-- | tests/ttotal_order.c | 18 |
5 files changed, 19 insertions, 19 deletions
@@ -36,7 +36,7 @@ Changes from versions 4.0.* to version 4.1.0: - New functions mpfr_get_decimal128 and mpfr_set_decimal128 (available only when MPFR has been built with decimal float support). - New function mpfr_cmpabs_ui. -- New function mpfr_total_order for the IEEE 754 totalOrder predicate. +- New function mpfr_total_order_p for the IEEE 754 totalOrder predicate. - The mpfr_out_str function now accepts bases from -2 to -36, in order to follow mpfr_get_str and GMP's mpf_out_str functions (these cases gave an assertion failure, as with other invalid bases). diff --git a/doc/mpfr.texi b/doc/mpfr.texi index b81c5fdc6..d17323558 100644 --- a/doc/mpfr.texi +++ b/doc/mpfr.texi @@ -2144,17 +2144,17 @@ Return non-zero if @var{op1} or @var{op2} is a NaN (i.e., they cannot be compared), zero otherwise. @end deftypefun -@deftypefun int mpfr_total_order (mpfr_t @var{x}, mpfr_t @var{y}) +@deftypefun int mpfr_total_order_p (mpfr_t @var{x}, mpfr_t @var{y}) This function implements the totalOrder predicate from IEEE@tie{}754-2008, where @minus{}NaN < @minus{}Inf < negative finite numbers < @minus{}0 < +0 < positive finite numbers < +Inf < +NaN@. It returns a non-zero value (true) when @var{x} is smaller than or equal to @var{y} for this order relation, and zero (false) otherwise. Contrary to @code{mpfr_cmp (x, y)}, which returns a ternary value, -@code{mpfr_total_order} returns a binary value (zero or non-zero). -In particular, @code{mpfr_total_order (x, x)} returns true, -@code{mpfr_total_order (-0, +0)} returns true and -@code{mpfr_total_order (+0, -0)} returns false. +@code{mpfr_total_order_p} returns a binary value (zero or non-zero). +In particular, @code{mpfr_total_order_p (x, x)} returns true, +@code{mpfr_total_order_p (-0, +0)} returns true and +@code{mpfr_total_order_p (+0, -0)} returns false. The sign bit of NaN also matters. @end deftypefun @@ -4217,7 +4217,7 @@ use @code{mpfr_get_z_exp}. @item @code{mpfr_sub_d} in MPFR@tie{}2.4. -@item @code{mpfr_total_order} in MPFR@tie{}4.1. +@item @code{mpfr_total_order_p} in MPFR@tie{}4.1. @item @code{mpfr_urandom} in MPFR@tie{}3.0. diff --git a/src/mpfr.h b/src/mpfr.h index 1330dcbdc..d7f255903 100644 --- a/src/mpfr.h +++ b/src/mpfr.h @@ -794,7 +794,7 @@ __MPFR_DECLSPEC void mpfr_custom_init_set (mpfr_ptr, int, mpfr_exp_t, mpfr_prec_t, void *); __MPFR_DECLSPEC int mpfr_custom_get_kind (mpfr_srcptr); -__MPFR_DECLSPEC int mpfr_total_order (mpfr_srcptr, mpfr_srcptr); +__MPFR_DECLSPEC int mpfr_total_order_p (mpfr_srcptr, mpfr_srcptr); #if defined (__cplusplus) } diff --git a/src/total_order.c b/src/total_order.c index 7436638e8..c0999f2d1 100644 --- a/src/total_order.c +++ b/src/total_order.c @@ -1,4 +1,4 @@ -/* mpfr_total_order -- total order of two floating-point numbers +/* mpfr_total_order_p -- total order of two floating-point numbers Copyright 2018-2020 Free Software Foundation, Inc. Contributed by the AriC and Caramba projects, INRIA. @@ -24,7 +24,7 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., /* follows IEEE 754-2008, Section 5.10 */ int -mpfr_total_order (mpfr_srcptr x, mpfr_srcptr y) +mpfr_total_order_p (mpfr_srcptr x, mpfr_srcptr y) { if (MPFR_SIGN (x) != MPFR_SIGN (y)) return MPFR_IS_POS (y); diff --git a/tests/ttotal_order.c b/tests/ttotal_order.c index 9954f905c..125cc0e71 100644 --- a/tests/ttotal_order.c +++ b/tests/ttotal_order.c @@ -1,4 +1,4 @@ -/* Test file for mpfr_total_order. +/* Test file for mpfr_total_order_p. Copyright 2018-2020 Free Software Foundation, Inc. Contributed by the AriC and Caramba projects, INRIA. @@ -25,9 +25,9 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., static void check1 (mpfr_ptr x, mpfr_ptr y) { - if (! mpfr_total_order (x, x)) + if (! mpfr_total_order_p (x, x)) { - printf ("Error on mpfr_total_order (x, x) with\n"); + printf ("Error on mpfr_total_order_p (x, x) with\n"); printf ("x = "); mpfr_dump (x); exit (1); @@ -35,9 +35,9 @@ check1 (mpfr_ptr x, mpfr_ptr y) mpfr_set (y, x, MPFR_RNDN); - if (! mpfr_total_order (x, y)) + if (! mpfr_total_order_p (x, y)) { - printf ("Error on mpfr_total_order (x, y) with\n"); + printf ("Error on mpfr_total_order_p (x, y) with\n"); printf ("x = "); mpfr_dump (x); printf ("y = "); @@ -49,9 +49,9 @@ check1 (mpfr_ptr x, mpfr_ptr y) static void check2 (mpfr_ptr x, mpfr_ptr y) { - if (! mpfr_total_order (x, y)) + if (! mpfr_total_order_p (x, y)) { - printf ("Error on mpfr_total_order (x, y) with\n"); + printf ("Error on mpfr_total_order_p (x, y) with\n"); printf ("x = "); mpfr_dump (x); printf ("y = "); @@ -59,9 +59,9 @@ check2 (mpfr_ptr x, mpfr_ptr y) exit (1); } - if (mpfr_total_order (y, x)) + if (mpfr_total_order_p (y, x)) { - printf ("Error on mpfr_total_order (y, x) with\n"); + printf ("Error on mpfr_total_order_p (y, x) with\n"); printf ("x = "); mpfr_dump (x); printf ("y = "); |