diff options
-rw-r--r-- | COPYING | 2 | ||||
-rw-r--r-- | ChangeLog | 18 | ||||
-rw-r--r-- | README.EXT | 23 | ||||
-rw-r--r-- | README.EXT.ja | 11 | ||||
-rw-r--r-- | bignum.c | 5 | ||||
-rw-r--r-- | prec.c | 4 |
6 files changed, 54 insertions, 9 deletions
@@ -1,6 +1,6 @@ Ruby is copyrighted free software by Yukihiro Matsumoto <matz@netlab.jp>. You can redistribute it and/or modify it under either the terms of the GPL -(see the file GPL), or the conditions below: +version 2 (see the file GPL), or the conditions below: 1. You may make and give away verbatim copies of the source form of the software without restriction, provided that you duplicate all of the @@ -1,3 +1,21 @@ +Mon Apr 10 01:03:10 2006 Yukihiro Matsumoto <matz@ruby-lang.org> + + * prec.c (prec_prec_f): documentation patch from + <gerardo.santana at gmail.com>. [ruby-core:07689] + +Sat Apr 8 02:34:34 2006 Yukihiro Matsumoto <matz@ruby-lang.org> + + * bignum.c (rb_big_pow): second operand may be too big even if + it's a Fixnum. [ruby-talk:187984] + +Sat Apr 8 02:12:38 2006 Yukihiro Matsumoto <matz@ruby-lang.org> + + * README.EXT: update symbol description. [ruby-talk:188104] + +Thu Apr 6 23:28:47 2006 Yukihiro Matsumoto <matz@ruby-lang.org> + + * COPYING: explicitly note GPLv2. [ruby-talk:187922] + Thu Apr 6 11:18:37 2006 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp> * ext/tk/lib/tk/panedwindow.rb: lack of arguments. [ruby-core:7681] diff --git a/README.EXT b/README.EXT index 4cfe80bd82..e5d39911ca 100644 --- a/README.EXT +++ b/README.EXT @@ -330,17 +330,30 @@ of the innermost method (which is defined by Ruby) can be accessed. 2.2.2 ID or Symbol -You can invoke methods directly, without parsing the string. First I -need to explain about symbols (whose data type is ID). ID is the -integer number to represent Ruby's identifiers such as variable names. -It can be accessed from Ruby in the form: +You can invoke methods directly, without parsing the string. First I need +to explain about ID. ID is the integer number to represent Ruby's +identifiers such as variable names. The Ruby data type corresponding to ID +is Symbol. It can be accessed from Ruby in the form: :Identifier -You can get the symbol value from a string within C code by using +You can get the ID value from a string within C code by using rb_intern(const char *name) +You can retrieve ID from Ruby object (Symbol or String) given as an +argument by using + + rb_to_id(VALUE symbol) + +You can convert C ID to Ruby Symbol by using + + VALUE ID2SYM(ID id) + +and to convert Ruby Symbol object to ID, use + + ID SYM2ID(VALUE symbol) + 2.2.3 Invoke Ruby method from C To invoke methods directly, you can use the function below diff --git a/README.EXT.ja b/README.EXT.ja index f8b625e7ef..30c4d520ba 100644 --- a/README.EXT.ja +++ b/README.EXT.ja @@ -380,7 +380,8 @@ Cから文字列を経由せずにRubyのメソッドを呼び出すこともできま す.その前に,Rubyインタプリタ内でメソッドや変数名を指定する 時に使われているIDについて説明しておきましょう. -IDとは変数名,メソッド名を表す整数です.Rubyの中では +IDとは変数名,メソッド名を表す整数です.RubyではIDに対応する +オブジェクトとしてシンボル(Symbol)があり, :識別子 @@ -393,6 +394,14 @@ IDとは変数名,メソッド名を表す整数です.Rubyの中では rb_to_id(VALUE symbol) +IDからシンボルを得るためには以下のマクロを使います. + + VALUE ID2SYM(ID id) + +シンボルからIDを得るためには以下のマクロを使います. + + ID SYM2ID(VALUE symbol) + 2.2.3 CからRubyのメソッドを呼び出す Cから文字列を経由せずにRubyのメソッドを呼び出すためには以下 @@ -1606,6 +1606,11 @@ rb_big_pow(x, y) if (yy > 0) { VALUE z = x; + if (RBIGNUM(x)->len * SIZEOF_BDIGITS * yy > 1024*1024) { + rb_warn("in a**b, b may be too big"); + d = (double)yy; + break; + } for (;;) { yy -= 1; if (yy == 0) break; @@ -57,9 +57,9 @@ prec_prec_i(x) /* * call-seq: - * num.prec_f => Integer + * num.prec_f => Float * - * Returns an +Float+ converted from _num_. It is equivalent + * Returns a +Float+ converted from _num_. It is equivalent * to <code>prec(Float)</code>. */ |