aboutsummaryrefslogtreecommitdiff
path: root/gcc/real.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/real.c')
-rw-r--r--gcc/real.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc/real.c b/gcc/real.c
index bfb8462..0d239b3 100644
--- a/gcc/real.c
+++ b/gcc/real.c
@@ -4968,3 +4968,14 @@ real_from_mpfr (REAL_VALUE_TYPE *r, mpfr_srcptr m)
real_from_string (r, buf);
}
+
+/* Check whether the real constant value given is an integer. */
+
+bool
+real_isinteger (const REAL_VALUE_TYPE *c, enum machine_mode mode)
+{
+ REAL_VALUE_TYPE cint;
+
+ real_trunc (&cint, mode, c);
+ return real_identical (c, &cint);
+}