diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2002-03-11 13:52:30 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2002-03-11 13:52:30 +0000 |
commit | 578a61bff22a65b2f2a9eeb92bce992b58ab3f92 (patch) | |
tree | 855030034abb4c8ca08e583660b3214e8d4424b5 | |
parent | 800604671a8051d05a503151b33524c9a3e16b09 (diff) | |
download | mpfr-578a61bff22a65b2f2a9eeb92bce992b58ab3f92.tar.gz |
Return a null pointer if rnd_mode is an invalid rounding mode.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@1731 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r-- | mpfr.texi | 3 | ||||
-rw-r--r-- | print_rnd_mode.c | 6 |
2 files changed, 3 insertions, 6 deletions
@@ -573,7 +573,8 @@ The precision @var{prec} can be any integer between @code{MPFR_PREC_MIN} and @deftypefun {char *} mpfr_print_rnd_mode (mp_rnd_t @var{rnd}) Returns the input string (GMP_RNDD, GMP_RNDU, GMP_RNDN, GMP_RNDZ) -corresponding to the rounding mode @var{rnd}. +corresponding to the rounding mode @var{rnd} or a null pointer if +@var{rnd} is an invalid rounding mode. @end deftypefun @node Exceptions, Initializing Floats, Rounding Modes, Floating-point Functions diff --git a/print_rnd_mode.c b/print_rnd_mode.c index 3be6b9691..199e8780c 100644 --- a/print_rnd_mode.c +++ b/print_rnd_mode.c @@ -1,6 +1,6 @@ /* mpfr_print_rnd_mode -- convert a given rounding mode to a string -Copyright 1999, 2001 Free Software Foundation. +Copyright 1999, 2001, 2002 Free Software Foundation. This file is part of the MPFR Library. @@ -19,7 +19,6 @@ along with the MPFR Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -#include <stdio.h> #include <stdlib.h> #include "gmp.h" #include "gmp-impl.h" @@ -38,9 +37,6 @@ mpfr_print_rnd_mode (mp_rnd_t rnd_mode) return ("GMP_RNDN"); case GMP_RNDZ: return ("GMP_RNDZ"); - default: - fprintf (stderr, "unknown rounding mode\n"); - exit (1); } return NULL; |