summaryrefslogtreecommitdiff
path: root/Build/source/libs/mpfr/mpfr-src/src/exceptions.c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/mpfr/mpfr-src/src/exceptions.c')
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/exceptions.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/Build/source/libs/mpfr/mpfr-src/src/exceptions.c b/Build/source/libs/mpfr/mpfr-src/src/exceptions.c
index 76ca08752cb..d197bd2c1f9 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/exceptions.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/exceptions.c
@@ -1,6 +1,6 @@
/* Exception flags and utilities. Constructors and destructors (debug).
-Copyright 2001-2019 Free Software Foundation, Inc.
+Copyright 2001-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -470,3 +470,29 @@ predprint (void)
}
#endif
+
+#if MPFR_WANT_ASSERT >= 2
+
+/* Similar to flags_out in tests/tests.c */
+
+void
+flags_fout (FILE *stream, mpfr_flags_t flags)
+{
+ int none = 1;
+
+ if (flags & MPFR_FLAGS_UNDERFLOW)
+ none = 0, fprintf (stream, " underflow");
+ if (flags & MPFR_FLAGS_OVERFLOW)
+ none = 0, fprintf (stream, " overflow");
+ if (flags & MPFR_FLAGS_NAN)
+ none = 0, fprintf (stream, " nan");
+ if (flags & MPFR_FLAGS_INEXACT)
+ none = 0, fprintf (stream, " inexact");
+ if (flags & MPFR_FLAGS_ERANGE)
+ none = 0, fprintf (stream, " erange");
+ if (none)
+ fprintf (stream, " none");
+ fprintf (stream, " (%u)\n", flags);
+}
+
+#endif