зеркало из https://github.com/github/ruby.git
* 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
This commit is contained in:
Родитель
698a24674e
Коммит
13230a3417
|
@ -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>
|
Thu May 8 12:56:04 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
|
||||||
|
|
||||||
* compar.c (rb_cmperr): raise comparison failure.
|
* 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
|
* numeric.c (int_upto, int_downto): should fail unless the
|
||||||
argument is comparable. (ruby-bugs-ja:PR#454)
|
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
|
* numeric.c (num_step): better error treatment of float values.
|
||||||
"1.1.step(1.5,0.1)" to work (third try).
|
|
||||||
|
|
||||||
Tue May 6 17:51:54 2003 Minero Aoki <aamine@loveruby.net>
|
Tue May 6 17:51:54 2003 Minero Aoki <aamine@loveruby.net>
|
||||||
|
|
||||||
|
|
13
ToDo
13
ToDo
|
@ -1,6 +1,7 @@
|
||||||
Language Spec.
|
Language Spec.
|
||||||
|
|
||||||
- Class#allocate - basicNew
|
- Class#allocate - basicNew
|
||||||
|
- class Foo::Bar<Baz .. end, module Boo::Bar .. end
|
||||||
* operator !! for rescue. ???
|
* operator !! for rescue. ???
|
||||||
* objectify characters
|
* objectify characters
|
||||||
* ../... outside condition invokes operator method too.
|
* ../... outside condition invokes operator method too.
|
||||||
|
@ -11,7 +12,6 @@ Language Spec.
|
||||||
* multiple return values, yield values. maybe incompatible ???
|
* multiple return values, yield values. maybe incompatible ???
|
||||||
* cascading method invocation ???
|
* cascading method invocation ???
|
||||||
* def Class#method .. end ??
|
* def Class#method .. end ??
|
||||||
* class Foo::Bar<Baz .. end, module Boo::Bar .. end
|
|
||||||
* def Foo::Bar::baz() .. end ??
|
* def Foo::Bar::baz() .. end ??
|
||||||
* I18N (or M17N) script/string/regexp
|
* I18N (or M17N) script/string/regexp
|
||||||
* Fixnum 0 as false ????
|
* Fixnum 0 as false ????
|
||||||
|
@ -81,6 +81,8 @@ Standard Libraries
|
||||||
- hash etc. should handle self referenceing array/hash
|
- hash etc. should handle self referenceing array/hash
|
||||||
- Array#select(n1,n2...) works like Array#indexes(n1,n2...)
|
- Array#select(n1,n2...) works like Array#indexes(n1,n2...)
|
||||||
- use Mersenne Twister RNG for random.
|
- use Mersenne Twister RNG for random.
|
||||||
|
- deprecate Array#indexes, and Array#indices.
|
||||||
|
- remove dependency on MAXPATHLEN.
|
||||||
* String#scanf(?)
|
* String#scanf(?)
|
||||||
* Object#fmt(?)
|
* Object#fmt(?)
|
||||||
* Time::strptime
|
* Time::strptime
|
||||||
|
@ -101,11 +103,10 @@ Standard Libraries
|
||||||
* marshal should not depend on sprintf (works bad with locale).
|
* marshal should not depend on sprintf (works bad with locale).
|
||||||
* ternary arg pow: a.pow(b,c) == a**b%c
|
* ternary arg pow: a.pow(b,c) == a**b%c
|
||||||
* new caller(), e.g. call_stack; needs better name.
|
* new caller(), e.g. call_stack; needs better name.
|
||||||
* remove dependency on MAXPATHLEN.
|
|
||||||
* pointer share mechanism similar to one in String for Array.
|
* 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 ;-)
|
* require "1.6" etc. by /usr/lib/ruby/1.6/1.6.rb ;-)
|
||||||
* save both "feature names" and "normalized path" in $"
|
* save both "feature names" and "normalized path" in $"
|
||||||
|
* implement Mutex_m (or MutexMixin) using Mutex.
|
||||||
|
|
||||||
Extension Libraries
|
Extension Libraries
|
||||||
|
|
||||||
|
@ -116,7 +117,6 @@ Extension Libraries
|
||||||
|
|
||||||
Ruby Libraries
|
Ruby Libraries
|
||||||
|
|
||||||
- add uri.rb
|
|
||||||
* urllib.rb, nttplib.rb, etc.
|
* urllib.rb, nttplib.rb, etc.
|
||||||
* format like perl's
|
* format like perl's
|
||||||
|
|
||||||
|
@ -124,8 +124,3 @@ Tools
|
||||||
|
|
||||||
* freeze or undump to bundle everything
|
* freeze or undump to bundle everything
|
||||||
* bundle using zlib
|
* bundle using zlib
|
||||||
|
|
||||||
Misc
|
|
||||||
|
|
||||||
- publish Ruby books
|
|
||||||
- publish Ruby books in English
|
|
||||||
|
|
2
gc.c
2
gc.c
|
@ -1228,7 +1228,7 @@ rb_gc()
|
||||||
setjmp(save_regs_gc_mark);
|
setjmp(save_regs_gc_mark);
|
||||||
mark_locations_array((VALUE*)save_regs_gc_mark, sizeof(save_regs_gc_mark) / sizeof(VALUE *));
|
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);
|
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),
|
rb_gc_mark_locations((VALUE*)((char*)rb_gc_stack_start + 2),
|
||||||
(VALUE*)((char*)STACK_END + 2));
|
(VALUE*)((char*)STACK_END + 2));
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -919,13 +919,16 @@ num_step(argc, argv, from)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (TYPE(from) == T_FLOAT || TYPE(to) == T_FLOAT || TYPE(step) == T_FLOAT) {
|
else if (TYPE(from) == T_FLOAT || TYPE(to) == T_FLOAT || TYPE(step) == T_FLOAT) {
|
||||||
|
const double epsilon = DBL_EPSILON;
|
||||||
double beg = NUM2DBL(from);
|
double beg = NUM2DBL(from);
|
||||||
double end = NUM2DBL(to);
|
double end = NUM2DBL(to);
|
||||||
double unit = NUM2DBL(step);
|
double unit = NUM2DBL(step);
|
||||||
double n = (end - beg)/unit;
|
double n = (end - beg)/unit;
|
||||||
|
double err = (fabs(beg) + fabs(end) + fabs(end-beg)) / fabs(unit) * epsilon;
|
||||||
long i;
|
long i;
|
||||||
|
|
||||||
n = n + 0.5;
|
if (err>0.5) err=0.5;
|
||||||
|
n = floor(n + err) + 1;
|
||||||
for (i=0; i<n; i++) {
|
for (i=0; i<n; i++) {
|
||||||
rb_yield(rb_float_new(i*unit+beg));
|
rb_yield(rb_float_new(i*unit+beg));
|
||||||
}
|
}
|
||||||
|
|
Загрузка…
Ссылка в новой задаче