diff options
-rw-r--r-- | configure.in | 4 | ||||
-rw-r--r-- | include/ruby/missing.h | 12 | ||||
-rw-r--r-- | math.c | 31 | ||||
-rw-r--r-- | numeric.c | 10 | ||||
-rw-r--r-- | win32/Makefile.sub | 6 |
5 files changed, 1 insertions, 62 deletions
diff --git a/configure.in b/configure.in index 95f43824b4..bdf26b9799 100644 --- a/configure.in +++ b/configure.in @@ -2322,7 +2322,6 @@ AC_CHECK_FUNCS(atan2l atan2f) AC_CHECK_FUNCS(chroot) AC_CHECK_FUNCS(chsize) AC_CHECK_FUNCS(clock_gettime) -AC_CHECK_FUNCS(cosh) AC_CHECK_FUNCS(crypt_r) AC_CHECK_FUNCS(daemon) AC_CHECK_FUNCS(dirfd) @@ -2339,7 +2338,6 @@ AC_CHECK_FUNCS(fcntl) AC_CHECK_FUNCS(fdatasync) AC_CHECK_FUNCS(fdopendir) AC_CHECK_FUNCS(fgetattrlist) -AC_CHECK_FUNCS(fmod) AC_CHECK_FUNCS(fstatat) AC_CHECK_FUNCS(fsync) AC_CHECK_FUNCS(ftruncate) @@ -2420,12 +2418,10 @@ AC_CHECK_FUNCS(shutdown) AC_CHECK_FUNCS(sigaction) AC_CHECK_FUNCS(sigaltstack) AC_CHECK_FUNCS(sigprocmask) -AC_CHECK_FUNCS(sinh) AC_CHECK_FUNCS(spawnv) AC_CHECK_FUNCS(symlink) AC_CHECK_FUNCS(syscall) AC_CHECK_FUNCS(sysconf) -AC_CHECK_FUNCS(tanh) AC_CHECK_FUNCS(telldir) AC_CHECK_FUNCS(timegm) AC_CHECK_FUNCS(times) diff --git a/include/ruby/missing.h b/include/ruby/missing.h index fb5c3130c9..f70a7e64d9 100644 --- a/include/ruby/missing.h +++ b/include/ruby/missing.h @@ -107,12 +107,6 @@ RUBY_EXTERN int finite(double); RUBY_EXTERN int flock(int, int); #endif -/* -#ifndef HAVE_FREXP -RUBY_EXTERN double frexp(double, int *); -#endif -*/ - #ifndef HAVE_HYPOT RUBY_EXTERN double hypot(double, double); #endif @@ -193,12 +187,6 @@ RUBY_EXTERN int memcmp(const void *, const void *, size_t); RUBY_EXTERN void *memmove(void *, const void *, size_t); #endif -/* -#ifndef HAVE_MODF -RUBY_EXTERN double modf(double, double *); -#endif -*/ - #ifndef HAVE_STRCHR RUBY_EXTERN char *strchr(const char *, int); RUBY_EXTERN char *strrchr(const char *, int); @@ -223,14 +223,6 @@ math_atan(VALUE unused_obj, VALUE x) return DBL2NUM(atan(Get_Double(x))); } -#ifndef HAVE_COSH -double -cosh(double x) -{ - return (exp(x) + exp(-x)) / 2; -} -#endif - /* * call-seq: * Math.cosh(x) -> Float @@ -251,14 +243,6 @@ math_cosh(VALUE unused_obj, VALUE x) return DBL2NUM(cosh(Get_Double(x))); } -#ifndef HAVE_SINH -double -sinh(double x) -{ - return (exp(x) - exp(-x)) / 2; -} -#endif - /* * call-seq: * Math.sinh(x) -> Float @@ -279,21 +263,6 @@ math_sinh(VALUE unused_obj, VALUE x) return DBL2NUM(sinh(Get_Double(x))); } -#ifndef HAVE_TANH -double -tanh(double x) -{ -# if defined(HAVE_SINH) && defined(HAVE_COSH) - const double c = cosh(x); - if (!isinf(c)) return sinh(x) / c; -# else - const double e = exp(x+x); - if (!isinf(e)) return (e - 1) / (e + 1); -# endif - return x > 0 ? 1.0 : -1.0; -} -#endif - /* * call-seq: * Math.tanh(x) -> Float @@ -1166,16 +1166,8 @@ flodivmod(double x, double y, double *divp, double *modp) if (y == 0.0) rb_num_zerodiv(); if ((x == 0.0) || (isinf(y) && !isinf(x))) mod = x; - else { -#ifdef HAVE_FMOD + else mod = fmod(x, y); -#else - double z; - - modf(x/y, &z); - mod = x - z * y; -#endif - } if (isinf(x) && !isinf(y)) div = x; else { diff --git a/win32/Makefile.sub b/win32/Makefile.sub index 7aab81deb4..68ca137bec 100644 --- a/win32/Makefile.sub +++ b/win32/Makefile.sub @@ -728,9 +728,6 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/win32/Makefile.sub $(win_srcdir)/Makefile.sub #define HAVE_ISNAN 1 #define HAVE_FINITE 1 #define HAVE_HYPOT 1 -#define HAVE_FMOD 1 -#define HAVE_FREXP 1 -#define HAVE_MODF 1 #define HAVE_WAITPID 1 #define HAVE_FSYNC 1 #define HAVE_GETCWD 1 @@ -747,9 +744,6 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/win32/Makefile.sub $(win_srcdir)/Makefile.sub #define HAVE_TELLDIR 1 #define HAVE_SEEKDIR 1 #define HAVE_MKTIME 1 -#define HAVE_COSH 1 -#define HAVE_SINH 1 -#define HAVE_TANH 1 #define HAVE_SIGNBIT 1 #define HAVE_TZNAME 1 #define HAVE_DAYLIGHT 1 |