summaryrefslogtreecommitdiff
path: root/isnan.c
diff options
context:
space:
mode:
authorzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2001-01-11 16:21:43 +0000
committerzimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4>2001-01-11 16:21:43 +0000
commit068dd5f104c5e94fe031faba2508a937973c3ddc (patch)
tree2d5d39f9ba0b5f50d744fc8d355748378804c152 /isnan.c
parent70f860016b6259e53bca5e974201be8b913ae26c (diff)
downloadmpfr-068dd5f104c5e94fe031faba2508a937973c3ddc.tar.gz
functions to check for NaN and infinities
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@964 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'isnan.c')
-rw-r--r--isnan.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/isnan.c b/isnan.c
new file mode 100644
index 000000000..ae7cfb1af
--- /dev/null
+++ b/isnan.c
@@ -0,0 +1,37 @@
+/* mpfr_nan_d, mpfr_inf_d -- check for NaN or infinities
+
+Copyright (C) 2000 Free Software Foundation.
+
+This file is part of the MPFR Library.
+
+The MPFR Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU Library General Public License as published by
+the Free Software Foundation; either version 2 of the License, or (at your
+option) any later version.
+
+The MPFR Library is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
+License for more details.
+
+You should have received a copy of the GNU Library General Public License
+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 "gmp.h"
+#include "gmp-impl.h"
+#include "mpfr.h"
+#include "mpfr-impl.h"
+
+int
+mpfr_nan_d (mpfr_srcptr x)
+{
+ return MPFR_IS_NAN (x);
+}
+
+int
+mpfr_inf_d (mpfr_srcptr x)
+{
+ return (!MPFR_IS_NAN(x) && MPFR_IS_INF(x));
+}