summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-05-08 09:45:52 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-05-08 09:45:52 +0000
commit13230a3417e37edaf5cdfaedafde5b7e19a34e6e (patch)
tree0342b349f479ee241fbf0b04d31b7f1acdef0d64
parent698a24674eb0707fdc8d934084932e845db955cd (diff)
* gc.c (rb_gc): check odd alignment stack on m68k machines.
* numeric.c (num_step): better error treatment of float values. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3769 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog9
-rw-r--r--ToDo13
-rw-r--r--gc.c2
-rw-r--r--numeric.c5
4 files changed, 15 insertions, 14 deletions
diff --git a/ChangeLog b/ChangeLog
index 55045bfb16..9510fffd3c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Thu May 8 18:44:09 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * gc.c (rb_gc): check odd alignment stack on m68k machines.
+
Thu May 8 12:56:04 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
* compar.c (rb_cmperr): raise comparison failure.
@@ -11,10 +15,9 @@ Thu May 8 12:56:04 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
* numeric.c (int_upto, int_downto): should fail unless the
argument is comparable. (ruby-bugs-ja:PR#454)
-Wed May 7 01:21:23 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
+Wed May 7 13:30:11 2003 Masahiro TANAKA <masa@ir.isas.ac.jp>
- * numeric.c (num_step): remove epsilon; add margin of 0.5, to make
- "1.1.step(1.5,0.1)" to work (third try).
+ * numeric.c (num_step): better error treatment of float values.
Tue May 6 17:51:54 2003 Minero Aoki <aamine@loveruby.net>
diff --git a/ToDo b/ToDo
index fa7f32daed..b55e399edf 100644
--- a/ToDo
+++ b/ToDo
@@ -1,6 +1,7 @@
Language Spec.
- Class#allocate - basicNew
+- class Foo::Bar<Baz .. end, module Boo::Bar .. end
* operator !! for rescue. ???
* objectify characters
* ../... outside condition invokes operator method too.
@@ -11,7 +12,6 @@ Language Spec.
* multiple return values, yield values. maybe incompatible ???
* cascading method invocation ???
* def Class#method .. end ??
-* class Foo::Bar<Baz .. end, module Boo::Bar .. end
* def Foo::Bar::baz() .. end ??
* I18N (or M17N) script/string/regexp
* Fixnum 0 as false ????
@@ -81,6 +81,8 @@ Standard Libraries
- hash etc. should handle self referenceing array/hash
- Array#select(n1,n2...) works like Array#indexes(n1,n2...)
- use Mersenne Twister RNG for random.
+- deprecate Array#indexes, and Array#indices.
+- remove dependency on MAXPATHLEN.
* String#scanf(?)
* Object#fmt(?)
* Time::strptime
@@ -101,11 +103,10 @@ Standard Libraries
* marshal should not depend on sprintf (works bad with locale).
* ternary arg pow: a.pow(b,c) == a**b%c
* new caller(), e.g. call_stack; needs better name.
-* remove dependency on MAXPATHLEN.
* pointer share mechanism similar to one in String for Array.
-* deprecate Array#indexes, and Array#indices.
* require "1.6" etc. by /usr/lib/ruby/1.6/1.6.rb ;-)
* save both "feature names" and "normalized path" in $"
+* implement Mutex_m (or MutexMixin) using Mutex.
Extension Libraries
@@ -116,7 +117,6 @@ Extension Libraries
Ruby Libraries
-- add uri.rb
* urllib.rb, nttplib.rb, etc.
* format like perl's
@@ -124,8 +124,3 @@ Tools
* freeze or undump to bundle everything
* bundle using zlib
-
-Misc
-
-- publish Ruby books
-- publish Ruby books in English
diff --git a/gc.c b/gc.c
index 17add7fc3f..8a71ece020 100644
--- a/gc.c
+++ b/gc.c
@@ -1228,7 +1228,7 @@ rb_gc()
setjmp(save_regs_gc_mark);
mark_locations_array((VALUE*)save_regs_gc_mark, sizeof(save_regs_gc_mark) / sizeof(VALUE *));
rb_gc_mark_locations(rb_gc_stack_start, (VALUE*)STACK_END);
-#if defined(__human68k__)
+#if defined(__human68k__) || defined(__mc68000__)
rb_gc_mark_locations((VALUE*)((char*)rb_gc_stack_start + 2),
(VALUE*)((char*)STACK_END + 2));
#endif
diff --git a/numeric.c b/numeric.c
index 186a2db901..d8041a54a6 100644
--- a/numeric.c
+++ b/numeric.c
@@ -919,13 +919,16 @@ num_step(argc, argv, from)
}
}
else if (TYPE(from) == T_FLOAT || TYPE(to) == T_FLOAT || TYPE(step) == T_FLOAT) {
+ const double epsilon = DBL_EPSILON;
double beg = NUM2DBL(from);
double end = NUM2DBL(to);
double unit = NUM2DBL(step);
double n = (end - beg)/unit;
+ double err = (fabs(beg) + fabs(end) + fabs(end-beg)) / fabs(unit) * epsilon;
long i;
- n = n + 0.5;
+ if (err>0.5) err=0.5;
+ n = floor(n + err) + 1;
for (i=0; i<n; i++) {
rb_yield(rb_float_new(i*unit+beg));
}