Detect and use the nan function.
This commit is contained in:
parent
8ec6d9983d
commit
e24e77660f
|
|
@ -19,7 +19,7 @@
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
#ifdef HAVE_CVS_IDENT
|
#ifdef HAVE_CVS_IDENT
|
||||||
#ident "$Id: config.h.in,v 1.23 2007/02/02 04:33:01 steve Exp $"
|
#ident "$Id: config.h.in,v 1.24 2007/06/13 01:03:57 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__cplusplus)
|
#if defined(__cplusplus)
|
||||||
|
|
@ -50,6 +50,7 @@
|
||||||
# undef HAVE_READLINE_HISTORY_H
|
# undef HAVE_READLINE_HISTORY_H
|
||||||
# undef HAVE_INTTYPES_H
|
# undef HAVE_INTTYPES_H
|
||||||
# undef HAVE_LROUND
|
# undef HAVE_LROUND
|
||||||
|
# undef HAVE_NAN
|
||||||
|
|
||||||
/* Figure if I can use readline. */
|
/* Figure if I can use readline. */
|
||||||
#undef USE_READLINE
|
#undef USE_READLINE
|
||||||
|
|
@ -85,6 +86,8 @@ typedef unsigned long vvp_time64_t;
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
# include <math.h>
|
||||||
|
|
||||||
/* getrusage, /proc/self/statm */
|
/* getrusage, /proc/self/statm */
|
||||||
|
|
||||||
# undef HAVE_SYS_RESOURCE_H
|
# undef HAVE_SYS_RESOURCE_H
|
||||||
|
|
@ -98,6 +101,13 @@ extern long lround(double x);
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if !defined(HAVE_NAN)
|
||||||
|
# define nan(x) (NAN)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(INFINITY)
|
||||||
|
# define INFINITY HUGE_VAL
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* When doing dynamic linking, we need a uniform way to identify the
|
* When doing dynamic linking, we need a uniform way to identify the
|
||||||
|
|
@ -119,6 +129,9 @@ extern long lround(double x);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: config.h.in,v $
|
* $Log: config.h.in,v $
|
||||||
|
* Revision 1.24 2007/06/13 01:03:57 steve
|
||||||
|
* Detect and use the nan function.
|
||||||
|
*
|
||||||
* Revision 1.23 2007/02/02 04:33:01 steve
|
* Revision 1.23 2007/02/02 04:33:01 steve
|
||||||
* Use inttypes.h instead of stdint.h for portability.
|
* Use inttypes.h instead of stdint.h for portability.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ esac
|
||||||
|
|
||||||
# Check that these functions exist. They are mostly C99
|
# Check that these functions exist. They are mostly C99
|
||||||
# functions that older compilers may not yet support.
|
# functions that older compilers may not yet support.
|
||||||
AC_CHECK_FUNCS(lround)
|
AC_CHECK_FUNCS(lround nan)
|
||||||
|
|
||||||
# see how we can give some resource usage stats with -v
|
# see how we can give some resource usage stats with -v
|
||||||
# Linux does not provide mem stats in rusage, use /proc/self/statm.
|
# Linux does not provide mem stats in rusage, use /proc/self/statm.
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
|
||||||
*/
|
*/
|
||||||
#ifdef HAVE_CVS_IDENT
|
#ifdef HAVE_CVS_IDENT
|
||||||
#ident "$Id: vthread.cc,v 1.165 2007/06/12 02:36:58 steve Exp $"
|
#ident "$Id: vthread.cc,v 1.166 2007/06/13 01:03:57 steve Exp $"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
# include "config.h"
|
# include "config.h"
|
||||||
|
|
@ -2207,7 +2207,7 @@ bool of_LOADI_WR(vthread_t thr, vvp_code_t cp)
|
||||||
}
|
}
|
||||||
// Detect NaN
|
// Detect NaN
|
||||||
if ( (exp&0x3fff) == 0x3fff ) {
|
if ( (exp&0x3fff) == 0x3fff ) {
|
||||||
thr->words[idx].w_real = NAN;
|
thr->words[idx].w_real = nan("");
|
||||||
}
|
}
|
||||||
|
|
||||||
double sign = (exp & 0x4000)? -1.0 : 1.0;
|
double sign = (exp & 0x4000)? -1.0 : 1.0;
|
||||||
|
|
@ -3489,6 +3489,9 @@ bool of_JOIN_UFUNC(vthread_t thr, vvp_code_t cp)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* $Log: vthread.cc,v $
|
* $Log: vthread.cc,v $
|
||||||
|
* Revision 1.166 2007/06/13 01:03:57 steve
|
||||||
|
* Detect and use the nan function.
|
||||||
|
*
|
||||||
* Revision 1.165 2007/06/12 02:36:58 steve
|
* Revision 1.165 2007/06/12 02:36:58 steve
|
||||||
* handle constant inf values.
|
* handle constant inf values.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue