[#40917] テスト対象を 2 つ指定すると落ちる — "KISHIMOTO, Makoto" <ksmakoto@...4u.or.jp>
きしもとです
[#40951] [Bug #3123] uninitialized constant Object::C (NameError) — Kazuhiro NISHIYAMA <redmine@...>
Bug #3123: uninitialized constant Object::C (NameError)
[#40959] [Bug #3136] reuse of singleton method definition causes SEGV — Yusuke Endoh <redmine@...>
Bug #3136: reuse of singleton method definition causes SEGV
[#40961] [Bug #3137] complex.rb changes exceptions of Math — Yusuke Endoh <redmine@...>
Bug #3137: complex.rb changes exceptions of Math
けいじゅ@いしつかです.
まつもと ゆきひろです
けいじゅ@いしつかです.
まつもと ゆきひろです
けいじゅ@いしつかです.
まつもと ゆきひろです
遠藤です。
[#40973] [BUG: trunk]arm-linux向けクロスコンパイル時のエラー — Satoshi Shiba <shiba@...>
芝と申します.
[#41038] Windows と DL が使用条件の libffi — Aaron Patterson <aaron.patterson@...>
こんにちは!アーロンです。
こんにちは、なかむら(う)です。
成瀬です。
2010/4/21 NARUSE, Yui <naruse@airemix.jp>:
2010/4/26 Aaron Patterson <aaron.patterson@gmail.com>:
2010/4/26 Yugui <yugui@yugui.jp>:
Sorry for replying so late.
こんにちは、なかむら(う)です。
2010/5/5 U.Nakamura <usa@garbagecollect.jp>:
[#41054] [Bug #3198] O_APPEND for redirect fd is ignored on windows — _ wanabe <redmine@...>
Bug #3198: O_APPEND for redirect fd is ignored on windows
[#41061] why did #rationalize removed? — Yusuke ENDOH <mame@...>
ふなばさん
[#41067] [Feature #3203] LazySweepGC patch — Narihiro Nakamura <redmine@...>
Feature #3203: LazySweepGC patch
遠藤です。
成瀬です。
nariです。
nariです。
2010年5月28日5:15 Narihiro Nakamura <authornari@gmail.com>:
2010年5月29日18:28 Tanaka Akira <akr@fsij.org>:
[#41092] Re: [ruby-core:29863] [Bug #3216] #join in thwait.rb only waits for first thread — keiju@... (keiju ISHITSUKA)
けいじゅ@いしつかです.
なかだです。
[#41100] Re: [ruby-cvs:34762] Ruby:r27549 (trunk): * test/test_open3.rb (test_commandline): use dump instead of — Tanaka Akira <akr@...>
2010/4/29 <nobu@ruby-lang.org>:
[#41104] Rails3 M17N — Yukihiro Matsumoto <matz@...>
まつもと ゆきひろです
xibbarこと藤岡です。
Yukihiro Matsumoto =E3=81=95=E3=82=93=E3=81=AF=E6=9B=B8=E3=81=8D=E3=81=BE=
まつもと ゆきひろです
小川と言います。
MjAxMC80LzMwIFl1a2loaXJvIE1hdHN1bW90byA8bWF0ekBydWJ5LWxhbmcub3JnPjoKPiAbJEIw
[ruby-dev:40961] [Bug #3137] complex.rb changes exceptions of Math
Bug #3137: complex.rb changes exceptions of Math
http://redmine.ruby-lang.org/issues/show/3137
起票者: Yusuke Endoh
ステータス: Open, 優先度: Normal
担当者: Keiju Ishitsuka, カテゴリ: lib, Target version: 1.9.2
ruby -v: ruby 1.9.2dev (2010-04-12 trunk 27317) [i686-linux]
いしつかさん
遠藤です。
[ruby-core:28204] にて Brian Ford が「complex を require すると
Math.atan(nil) で投げられる例外が変わる」という報告をしています。
$ ./ruby -e 'p Math.atanh(nil)'
-e:1:in `atanh': can't convert nil into Float (TypeError)
from -e:1:in `<main>'
$ ./ruby -rcomplex -e 'p Math.atanh(nil)'
/home/mame/work/ruby-trunk-local/lib/ruby/1.9.1/cmath.rb:196:in `atanh': undefined method `real?' for nil:NilClass (NoMethodError)
from -e:1:in `<main>'
Ruby レベルのライブラリは duck typing のためにむやみに型チェック
すべきでないとはいえ、CMath は組み込みの Math クラスの置き換えを
前提としているので、なるべく Math クラスの挙動を尊重した方がよい
と思いました。
以下のパッチをコミットしてもいいでしょうか。
# ついでですが、[ruby-dev:40953] も見てください。
diff --git a/lib/cmath.rb b/lib/cmath.rb
index b23dac2..aa2d9bb 100644
--- a/lib/cmath.rb
+++ b/lib/cmath.rb
@@ -27,6 +27,7 @@ module CMath
alias atanh! atanh
def exp(z)
+ z = Float(z)
if z.real?
exp!(z)
else
@@ -36,9 +37,9 @@ module CMath
end
end
- def log(*args)
- z, b = args
- if z.real? and z >= 0 and (b.nil? or b >= 0)
+ def log(z, b = nil)
+ z = Float(z)
+ if z.real? and z >= 0 and (b.nil? or (b = Float(b); b >= 0))
log!(*args)
else
a = Complex(log!(z.abs), z.arg)
@@ -50,6 +51,7 @@ module CMath
end
def log2(z)
+ z = Float(z)
if z.real? and z >= 0
log2!(z)
else
@@ -58,6 +60,7 @@ module CMath
end
def log10(z)
+ z = Float(z)
if z.real? and z >= 0
log10!(z)
else
@@ -66,6 +69,7 @@ module CMath
end
def sqrt(z)
+ z = Float(z)
if z.real?
if z < 0
Complex(0, sqrt!(-z))
@@ -85,6 +89,7 @@ module CMath
end
def cbrt(z)
+ z = Float(z)
if z.real? and z >= 0
cbrt!(z)
else
@@ -93,6 +98,7 @@ module CMath
end
def sin(z)
+ z = Float(z)
if z.real?
sin!(z)
else
@@ -102,6 +108,7 @@ module CMath
end
def cos(z)
+ z = Float(z)
if z.real?
cos!(z)
else
@@ -111,6 +118,7 @@ module CMath
end
def tan(z)
+ z = Float(z)
if z.real?
tan!(z)
else
@@ -119,6 +127,7 @@ module CMath
end
def sinh(z)
+ z = Float(z)
if z.real?
sinh!(z)
else
@@ -128,6 +137,7 @@ module CMath
end
def cosh(z)
+ z = Float(z)
if z.real?
cosh!(z)
else
@@ -137,6 +147,7 @@ module CMath
end
def tanh(z)
+ z = Float(z)
if z.real?
tanh!(z)
else
@@ -145,6 +156,7 @@ module CMath
end
def asin(z)
+ z = Float(z)
if z.real? and z >= -1 and z <= 1
asin!(z)
else
@@ -153,6 +165,7 @@ module CMath
end
def acos(z)
+ z = Float(z)
if z.real? and z >= -1 and z <= 1
acos!(z)
else
@@ -161,6 +174,7 @@ module CMath
end
def atan(z)
+ z = Float(z)
if z.real?
atan!(z)
else
@@ -169,6 +183,7 @@ module CMath
end
def atan2(y,x)
+ x, y = Float(x), Float(y)
if y.real? and x.real?
atan2!(y,x)
else
@@ -177,6 +192,7 @@ module CMath
end
def asinh(z)
+ z = Float(z)
if z.real?
asinh!(z)
else
@@ -185,6 +201,7 @@ module CMath
end
def acosh(z)
+ z = Float(z)
if z.real? and z >= 1
acosh!(z)
else
@@ -193,6 +210,7 @@ module CMath
end
def atanh(z)
+ z = Float(z)
if z.real? and z >= -1 and z <= 1
atanh!(z)
else
--
Yusuke Endoh <mame@tsg.ne.jp>
----------------------------------------
http://redmine.ruby-lang.org