1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* prec.c (prec_prec_f): documentation patch from

<gerardo.santana at gmail.com>.  [ruby-core:07689]

* bignum.c (rb_big_pow): second operand may be too big even if
  it's a Fixnum.  [ruby-talk:187984]

* README.EXT: update symbol description.  [ruby-talk:188104]

* COPYING: explicitly note GPLv2.  [ruby-talk:187922]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@10088 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2006-04-09 16:10:40 +00:00
parent 468a0bd4fa
commit 234c47e9fb
6 changed files with 54 additions and 9 deletions

View file

@ -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

View file

@ -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]

View file

@ -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

View file

@ -380,7 +380,8 @@ C
その前にRubyインタプリタ内でメソッドや変数名を指定する
時に使われているIDについて説明しておきましょう
IDとは変数名メソッド名を表す整数ですRubyの中では
IDとは変数名メソッド名を表す整数ですRubyではIDに対応する
オブジェクトとしてシンボル(Symbol)があり,
:識別子
@ -393,6 +394,14 @@ ID
rb_to_id(VALUE symbol)
IDからシンボルを得るためには以下のマクロを使います
VALUE ID2SYM(ID id)
シンボルからIDを得るためには以下のマクロを使います
ID SYM2ID(VALUE symbol)
2.2.3 CからRubyのメソッドを呼び出す
Cから文字列を経由せずにRubyのメソッドを呼び出すためには以下

View file

@ -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;

4
prec.c
View file

@ -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>.
*/