diff --git a/C/arith1.c b/C/arith1.c index 7ebdf980a..154f3a321 100644 --- a/C/arith1.c +++ b/C/arith1.c @@ -1381,11 +1381,14 @@ p_round(Term t E_ARGS) RERROR(); } } - + if (yap_flags[LANGUAGE_MODE_FLAG] == 1) { /* iso */ - RBIG_FL(rint(dbl)); + double vl = rint(dbl); + RBIG_FL(vl); } else { - RFLOAT(rint(dbl)); + double vl = rint(dbl); + printf("vl is %d\n", vl); + RFLOAT(vl); } } diff --git a/H/eval.h b/H/eval.h index 85bcbf02d..992c300e6 100644 --- a/H/eval.h +++ b/H/eval.h @@ -18,7 +18,9 @@ #include /* C library used to implement floating point functions */ +#if HAVE_MATH_H #include +#endif #if HAVE_IEEEFP_H #include #endif diff --git a/config.h.in b/config.h.in index f017d0be7..882280535 100644 --- a/config.h.in +++ b/config.h.in @@ -59,6 +59,7 @@ #undef HAVE_IO_H #undef HAVE_LIMITS_H #undef HAVE_MALLOC_H +#undef HAVE_MATH_H #undef HAVE_MEMORY_H #undef HAVE_NETDB_H #undef HAVE_NETINET_IN_H @@ -238,9 +239,11 @@ #define USE_SOCKET 1 #endif +#if defined(__hpux) /* HP-UX requires extra definitions for X/Open networking */ #undef _XOPEN_SOURCE #define _XOPEN_SOURCE_EXTENDED 0 +#endif #if HAVE_GMP_H && HAVE_LIBGMP #define USE_GMP 1 diff --git a/configure b/configure index 05e7a22c5..63b4896d4 100755 --- a/configure +++ b/configure @@ -5168,7 +5168,8 @@ done -for ac_header in malloc.h memory.h + +for ac_header in malloc.h math.h memory.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if eval "test \"\${$as_ac_Header+set}\" = set"; then diff --git a/configure.in b/configure.in index c4469f36c..26fa59386 100644 --- a/configure.in +++ b/configure.in @@ -583,7 +583,7 @@ AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(arpa/inet.h ctype.h direct.h dirent.h dlfcn.h) AC_CHECK_HEADERS(errno.h fcntl.h) AC_CHECK_HEADERS(fenv.h fpu_control.h ieeefp.h io.h limits.h) -AC_CHECK_HEADERS(malloc.h memory.h) +AC_CHECK_HEADERS(malloc.h math.h memory.h) AC_CHECK_HEADERS(netdb.h netinet/in.h regex.h) AC_CHECK_HEADERS(siginfo.h signal.h stdarg.h string.h stropts.h) AC_CHECK_HEADERS(sys/conf.h sys/file.h)