diff options
| author | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-11 14:49:54 +0000 |
|---|---|---|
| committer | tadf <tadf@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-12-11 14:49:54 +0000 |
| commit | 88d2dbd47b1b06b4f5d0c6d10706b5822d7686b2 (patch) | |
| tree | 009e861b466aa21127445ee598e8400093ce883b | |
| parent | e6eb9e35f17930fa6cf49d823a52fc4e8e3774c0 (diff) | |
| download | ruby-88d2dbd47b1b06b4f5d0c6d10706b5822d7686b2.tar.gz ruby-88d2dbd47b1b06b4f5d0c6d10706b5822d7686b2.tar.xz ruby-88d2dbd47b1b06b4f5d0c6d10706b5822d7686b2.zip | |
* lib/cmath.rb (sqrt): should pass nan or infinity to the original
method.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20646 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | lib/cmath.rb | 2 |
2 files changed, 6 insertions, 1 deletions
@@ -1,3 +1,8 @@ +Thu Dec 11 23:48:00 2008 Tadayoshi Funaba <tadf@dotrb.org> + + * lib/cmath.rb (sqrt): should pass nan or infinity to the original + method. + Thu Dec 11 21:04:04 2008 Kouhei Sutou <kou@cozmixng.org> * lib/rss/maker.rb, lib/rss/maker/0.9.rb, lib/rss/maker/base.rb: diff --git a/lib/cmath.rb b/lib/cmath.rb index 00bcc9087..9705b277b 100644 --- a/lib/cmath.rb +++ b/lib/cmath.rb @@ -57,7 +57,7 @@ module CMath def sqrt(z) if z.real? - if z >= 0 + if z >= 0 || (Float === z && (z.nan? || z.infinite?)) sqrt!(z) else Complex(0, sqrt!(-z)) |
