[#20490] [BUG] evalがらみでSIGSEGV — "yamamoto madoka" <dan@...2.so-net.ne.jp>
こんにちは、山本 円と申します。
[#20495] 不正なバイト列とのマッチ — Kazuhiro NISHIYAMA <zn@...>
西山和広です。
[#20499] Re: [ruby-cvs] ruby/ext/curses: * string.c (rb_str_shared_replace): clear flags before copy. — nobu.nakada@...
なかだです。
まつもと ゆきひろです
わたなべです。
まつもと ゆきひろです
わたなべです。
[#20525] [BigDecimal] changing rule of coerce — "Tadashi Saito" <shiba@...2.accsnet.ne.jp>
斎藤です。
小林です。
まつもと ゆきひろです
小林です。
小林です。
前田です。
小林です。
小林です。
小林です。
小林です。
小林です。
[#20570] Marshal upgrade — matz@... (Yukihiro Matsumoto)
まつもと ゆきひろです
咳といいます。
まつもと ゆきひろです
まつもと ゆきひろです
新井です。
新井です。
まつもと ゆきひろです
咳といいます。
まつもと ゆきひろです
なかだです。
まつもと ゆきひろです
[#20580] add library(Re:ruby-dev:20570) — たむらけんいち <sgs02516@...>
たむらです。
なひです。
In message <038d01c349cb$eaad71d0$93222fc0@sarion.co.jp>,
まつもと ゆきひろです
In message <1058171960.400840.10041.nullmailer@picachu.netlab.jp>,
話をそらしてしまうかもしれませんが、
In message <20030714.183104.09092354.taca@back-street.net>,
In message <20030715.013655.424936247.gotoyuzo@kotetsu.does.notwork.org>
In message <20030715.025907.26217115.taca@back-street.net>,
In message <20030715.051853.968499478.gotoyuzo@kotetsu.does.notwork.org>
In message <20030721.163444.09092937.taca@back-street.net>,
In message <20030721.191306.60866533.gotoyuzo@kotetsu.does.notwork.org>
In message <20030721.211845.20473808.taca@back-street.net>,
In message <20030722.002037.774147317.gotoyuzo@kotetsu.does.notwork.org>
In message <20030722.003236.72433302.taca@back-street.net>,
[#20582] rexmlのuconv依存 — Kazuhiro NISHIYAMA <zn@...>
西山和広です。
まつもと ゆきひろです
In article <1057770842.878440.16422.nullmailer@picachu.netlab.jp>,
なかだです。
In article <200307100751.h6A7pLFs003667@sharui.nakada.kanuma.tochigi.jp>,
[#20606] ruby-1.8.0 on BSD/OS — OHARA Shigeki <os@...>
大原です。
[#20613] compiling Ruby on AIX (powerpc-ibm-aix4.3.3.0) and Alpha OSF/1 (alphaev67-dec-osf5.1) — NISHIMATSU Takeshi <t-nissie@...>
西松と申します.
なかだです。
西松です. お返事が遅くなり申し訳ありません.
[#20631] SOAP4R in 1.8.0? — matz@... (Yukihiro Matsumoto)
まつもと ゆきひろです
[#20655] frozen ThreadGroup — Hidetoshi NAGAI <nagai@...>
永井@知能.九工大です.
まつもと ゆきひろです
永井@知能.九工大です.
まつもと ゆきひろです
永井@知能.九工大です.
まつもと ゆきひろです
永井@知能.九工大です.
永井@知能.九工大です.
まつもと ゆきひろです
永井@知能.九工大です.
まつもと ゆきひろです
In article <1058719939.886480.22830.nullmailer@picachu.netlab.jp>,
[#20680] 1.8.0 on IA64 etc. — matz@... (Yukihiro Matsumoto)
まつもと ゆきひろです
[#20691] Re: [Oniguruma] explicit capture — kkosako@...
> -----Original Message-----
[#20716] Re: [Oniguruma] explicit capture — kkosako@...
> -----Original Message-----
[#20748] [BigDecimal] exception handling — "Tadashi Saito" <shiba@...2.accsnet.ne.jp>
斎藤です。
[#20765] Re: [ruby-cvs] ruby/lib: * lib/tmpdir.rb: new library to get temporary directory path, — WATANABE Hirofumi <eban@...>
わたなべです。
まつもと ゆきひろです
わたなべです。
まつもと ゆきひろです
わたなべです。
[#20780] complex.rb — Masahiro TANAKA <masa@...>
complex.rb についての修正案を[ruby-math:00543]で提案しましたが、その後
まつもと ゆきひろです
けいじゅ@いしつかです.
At Tue, 22 Jul 2003 17:30:31 +0900, Yukihiro Matsumoto wrote:
まつもと ゆきひろです
けいじゅ@いしつかです.
At Sat, 26 Jul 2003 06:52:21 +0900, 石塚圭樹 wrote:
[#20791] 1.8.0 preview4 schedule — matz@... (Yukihiro Matsumoto)
まつもと ゆきひろです
永井@知能.九工大です.
[#20795] warning: terminated thread — Masatoshi SEKI <m_seki@...>
咳といいます。
mput です。こんばんわ。
まつもと ゆきひろです
[#20800] 0**(-1) with rational — Tanaka Akira <akr@...17n.org>
そういえば思い出したのですが、rational を require しているときとしてい
At Wed, 23 Jul 2003 03:30:41 +0900, Tanaka Akira wrote:
[#20810] Rational 始めました。 — Shin-ichiro HARA <sinara@...>
原です。
けいじゅ@いしつかです.
In article <200307241940.EAA14225.keiju@ishitsuka.com>,
けいじゅ@いしつかです.
In article <200307271500.AAA04363.keiju@bc.mbn.or.jp>,
[#20818] ThreadGroup#wait — nobu.nakada@...
なかだです。
まつもと ゆきひろです
[#20868] ruby 1.8.0 preview4 — matz@... (Yukihiro Matsumoto)
まつもと ゆきひろです
[#20887] ext/openssl undefined BN_pseudo_rand_range — Kazuhiro Yoshida <moriq@...>
もりきゅうです。
[#20915] [BUG] errno == 0 — Kazuhiro Yoshida <moriq@...>
もりきゅうです。win32だけかもしれません。
まつもと ゆきひろです
もりきゅうです。
[#20932] move ChangeLog — Tanaka Akira <akr@...17n.org>
提案なんですが、1.8.0 が出たらそこまでのぶんの ChangeLog を移動しませ
[#20949] multiple Tk interpreter support — Hidetoshi NAGAI <nagai@...>
永井@知能.九工大です.
[#20954] ruby 1.8.0 preview5 — matz@... (Yukihiro Matsumoto)
まつもと ゆきひろです
もりきゅうです。
Siena. です。
[#20957] [BigDecimal] conflict between Numeric#div and BigDecimal#div — "Tadashi Saito" <shiba@...2.accsnet.ne.jp>
斎藤です。
At Mon, 28 Jul 2003 18:26:20 +0900, Tadashi Saito wrote:
まつもと ゆきひろです
At Mon, 28 Jul 2003 21:16:08 +0900, Yukihiro Matsumoto wrote:
まつもと ゆきひろです
At Tue, 29 Jul 2003 14:43:19 +0900, Yukihiro Matsumoto wrote:
原です。
[#20989] Re: [Oniguruma] explicit capture — kkosako@...
> -----Original Message-----
[#21027] -W option — WATANABE Hirofumi <eban@...>
わたなべです。
[ruby-dev:21020] Re: complex.rb
complex.rb の追加パッチです。
At Sat, 26 Jul 2003 19:11:07 +0900, Masahiro TANAKA wrote:
> Complex( Complex(1,1), 1 )
>
> みたいな、実部 and/or 虚部が複素数というへんてこりんな数ができてしまい
> ます。一方 Complex(a,b) メソッドはそのことが考慮されているのですが、
> まだ完全ではありません。
Complex(a,b) をシンプルにして、Complex(Complex(1,1),1) が Complex(1,2)
を返すようにしました。
その都合で、Numeric の定義を Complex の前に移動しました。
その他、逆三角/双曲関数で、実数の定義域外のとき、Complex の演算結果を
返すようにしました。これは sqrt や log の仕様に合わせたものです。
田中昌宏
Index: complex.rb
===================================================================
RCS file: /ruby/ruby/lib/complex.rb,v
retrieving revision 1.19
diff -w -u -r1.19 complex.rb
--- complex.rb 29 Jul 2003 07:52:52 -0000 1.19
+++ complex.rb 30 Jul 2003 09:32:29 -0000
@@ -27,22 +27,71 @@
#
+# Numeric is a built-in class on which Fixnum, Bignum, etc., are based. Here
+# some methods are added so that all number types can be treated to some extent
+# as Complex numbers.
+#
+class Numeric
+ #
+ # Returns a Complex number <tt>(0,<i>self</i>)</tt>.
+ #
+ def im
+ Complex(0, self)
+ end
+
+ #
+ # The real part of a complex number, i.e. <i>self</i>.
+ #
+ def real
+ self
+ end
+
+ #
+ # The imaginary part of a complex number, i.e. 0.
+ #
+ def image
+ 0
+ end
+ alias imag image
+
+ #
+ # See Complex#arg.
+ #
+ def arg
+ if self >= 0
+ return 0
+ else
+ return Math::PI
+ end
+ end
+ alias angle arg
+
+ #
+ # See Complex#polar.
+ #
+ def polar
+ return abs, arg
+ end
+
+ #
+ # See Complex#conjugate (short answer: returns <i>self</i>).
+ #
+ def conjugate
+ self
+ end
+ alias conj conjugate
+end
+
+
+#
# Creates a Complex number. +a+ and +b+ should be Numeric. The result will be
# <tt>a+bi</tt>.
#
def Complex(a, b = 0)
- if a.kind_of?(Complex) and b == 0
- a
- elsif b.kind_of?(Complex)
- if a.kind_of?(Complex)
- Complex(a.real-b.image, a.image + b.real)
- else
- Complex(a-b.image, b.real)
- end
- elsif b == 0 and defined? Complex::Unify
+ if b == 0 and (a.kind_of?(Complex) or defined? Complex::Unify)
a
else
- Complex.new!(a, b)
+ Complex.new( a.real-b.imag, a.imag+b.real )
end
end
@@ -361,61 +410,6 @@
end
-#
-# Numeric is a built-in class on which Fixnum, Bignum, etc., are based. Here
-# some methods are added so that all number types can be treated to some extent
-# as Complex numbers.
-#
-class Numeric
- #
- # Returns a Complex number <tt>(0,<i>self</i>)</tt>.
- #
- def im
- Complex(0, self)
- end
-
- #
- # The real part of a complex number, i.e. <i>self</i>.
- #
- def real
- self
- end
-
- #
- # The imaginary part of a complex number, i.e. 0.
- #
- def image
- 0
- end
- alias imag image
-
- #
- # See Complex#arg.
- #
- def arg
- if self >= 0
- return 0
- else
- return Math::PI
- end
- end
- alias angle arg
-
- #
- # See Complex#polar.
- #
- def polar
- return abs, arg
- end
-
- #
- # See Complex#conjugate (short answer: returns <i>self</i>).
- #
- def conjugate
- self
- end
- alias conj conjugate
-end
module Math
@@ -538,7 +532,7 @@
end
def acos(z)
- if Complex.generic?(z)
+ if Complex.generic?(z) and z >= -1 and z <= 1
acos!(z)
else
-1.0.im * log( z + 1.0.im * sqrt(1.0-z*z) )
@@ -546,7 +540,7 @@
end
def asin(z)
- if Complex.generic?(z)
+ if Complex.generic?(z) and z >= -1 and z <= 1
asin!(z)
else
-1.0.im * log( 1.0.im * z + sqrt(1.0-z*z) )
@@ -570,7 +564,7 @@
end
def acosh(z)
- if Complex.generic?(z)
+ if Complex.generic?(z) and z >= 1
acosh!(z)
else
log( z + sqrt(z*z-1.0) )
@@ -586,7 +580,7 @@
end
def atanh(z)
- if Complex.generic?(z)
+ if Complex.generic?(z) and z >= -1 and z <= 1
atanh!(z)
else
log( (1.0+z) / (1.0-z) ) / 2.0