Skip to content

Commit

Permalink
* gc.c (rb_gc): check odd alignment stack on m68k machines.
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
matz committed May 8, 2003
1 parent 698a246 commit 13230a3
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
9 changes: 6 additions & 3 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Thu May 8 18:44:09 2003 Yukihiro Matsumoto <[email protected]>

* gc.c (rb_gc): check odd alignment stack on m68k machines.

Thu May 8 12:56:04 2003 Nobuyoshi Nakada <[email protected]>

* compar.c (rb_cmperr): raise comparison failure.
Expand All @@ -11,10 +15,9 @@ Thu May 8 12:56:04 2003 Nobuyoshi Nakada <[email protected]>
* 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 <[email protected]>
Wed May 7 13:30:11 2003 Masahiro TANAKA <[email protected]>

* 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 <[email protected]>

Expand Down
13 changes: 4 additions & 9 deletions ToDo
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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 ????
Expand Down Expand Up @@ -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
Expand All @@ -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

Expand All @@ -116,16 +117,10 @@ Extension Libraries

Ruby Libraries

- add uri.rb
* urllib.rb, nttplib.rb, etc.
* format like perl's

Tools

* freeze or undump to bundle everything
* bundle using zlib

Misc

- publish Ruby books
- publish Ruby books in English
2 changes: 1 addition & 1 deletion gc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion numeric.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down

0 comments on commit 13230a3

Please sign in to comment.