summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwyhaines <wyhaines@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-14 15:05:27 +0000
committerwyhaines <wyhaines@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-07-14 15:05:27 +0000
commit63714e935a836313b16dce0e3036b747a1128d0e (patch)
treea08e35aba73c6348f68840431729e6a57aade718
parent919887813900fa61026f072a5cbcfd7ad873ea97 (diff)
Fixes to bignum/numeric so that infinity is always greater than any num.
configure.in fixes to earlier breakage regarding using $libdir for determining lib dirs, instead of $prefix/lib. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_6@24107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--bignum.c10
-rw-r--r--configure.in8
-rw-r--r--numeric.c4
-rw-r--r--version.h6
5 files changed, 26 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 555579993f..eab125d212 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Mon Jul 13 12:00:00 2009 Kirk Haines <khaines@ruby-lang.org>
+
+ * numeric.c, bignum.c: Applied changes from r23730. Infinity is > any bignum number in comparisons.
+
+ * configure.in: fixed problems with using $libdir instead of $prefix/lib for RUBY_LIB and friends.
+
Fri Jul 10 04:00:00 2009 Kirk Haines <khaines@ruby-lang.org>
* file.c: Added FCNTL inclusion to fix a compile error with solaris (backport from r22812)
diff --git a/bignum.c b/bignum.c
index c23b76b1fe..6e0da90c7e 100644
--- a/bignum.c
+++ b/bignum.c
@@ -987,7 +987,15 @@ rb_big_cmp(x, y)
break;
case T_FLOAT:
- return rb_dbl_cmp(rb_big2dbl(x), RFLOAT(y)->value);
+ {
+ double a = RFLOAT(y)->value;
+
+ if (isinf(a)) {
+ if (a > 0.0) return INT2FIX(-1);
+ else return INT2FIX(1);
+ }
+ return rb_dbl_cmp(rb_big2dbl(x), a);
+ }
default:
return rb_num_coerce_cmp(x, y);
diff --git a/configure.in b/configure.in
index bd0763831e..312a842a8a 100644
--- a/configure.in
+++ b/configure.in
@@ -1323,6 +1323,10 @@ if test "$prefix" = NONE; then
prefix=$ac_default_prefix
fi
+if test "$exec_prefix" = NONE; then
+ exec_prefix=$prefix
+fi
+
#if test "$fat_binary" != no ; then
# CFLAGS="$CFLAGS $ARCH_FLAG"
#fi
@@ -1614,7 +1618,7 @@ case "$target_os" in
RUBY_LIB_PREFIX="/lib/ruby"
;;
*)
- RUBY_LIB_PREFIX="${libdir}/ruby"
+ RUBY_LIB_PREFIX="`eval "echo ${libdir}"`/ruby"
;;
esac
RUBY_LIB_PATH="${RUBY_LIB_PREFIX}/${MAJOR}.${MINOR}"
@@ -1622,7 +1626,7 @@ RUBY_LIB_PATH="${RUBY_LIB_PREFIX}/${MAJOR}.${MINOR}"
AC_ARG_WITH(sitedir,
[ --with-sitedir=DIR site libraries in DIR [PREFIX/lib/ruby/site_ruby]],
[sitedir=$withval],
- [sitedir='${libdir}/ruby/site_ruby'])
+ [sitedir="`eval "echo ${libdir}"`/lib/ruby/site_ruby"])
SITE_DIR=`eval echo \\"${sitedir}\\"`
case "$target_os" in
cygwin*|mingw*|*djgpp*|os2-emx*)
diff --git a/numeric.c b/numeric.c
index 21a4f2af4c..c5e64c9b99 100644
--- a/numeric.c
+++ b/numeric.c
@@ -933,6 +933,10 @@ flo_cmp(x, y)
break;
case T_BIGNUM:
+ if (isinf(a)) {
+ if (a > 0.0) return INT2FIX(1);
+ else return INT2FIX(-1);
+ }
b = rb_big2dbl(y);
break;
diff --git a/version.h b/version.h
index 8e57c62b6d..3998543cdc 100644
--- a/version.h
+++ b/version.h
@@ -2,7 +2,7 @@
#define RUBY_RELEASE_DATE "2009-06-08"
#define RUBY_VERSION_CODE 186
#define RUBY_RELEASE_CODE 20090608
-#define RUBY_PATCHLEVEL 378
+#define RUBY_PATCHLEVEL 379
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8
@@ -18,7 +18,3 @@ RUBY_EXTERN const char ruby_platform[];
RUBY_EXTERN const int ruby_patchlevel;
#endif
-
-
-
-