summaryrefslogtreecommitdiff
path: root/lib/complex.rb
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-07-29 07:52:55 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-07-29 07:52:55 +0000
commit37b2487c7097aa72775f0f3f17f058cfc820dabd (patch)
tree35cc22bf84d65b4ec02bf15cb22df6fab7e1b813 /lib/complex.rb
parent847bac1daf8d1ea2209c5dfb589e88e6db34c57b (diff)
* lib/net/smtp.rb (Net::SMTP::send0): add taint check.
* ruby.h (LLONG_MIN): wrong value. * io.c (rb_f_getc): $stdin may not be IO. [ruby-dev:20973] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4206 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/complex.rb')
-rw-r--r--lib/complex.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/complex.rb b/lib/complex.rb
index 3d761beb6b..9b5419ba61 100644
--- a/lib/complex.rb
+++ b/lib/complex.rb
@@ -75,14 +75,14 @@ class Complex < Numeric
end
def initialize(a, b)
- raise "non numeric 1st arg `#{a.inspect}'" if !a.kind_of? Numeric
- raise "`#{a.inspect}' for 1st arg" if a.kind_of? Complex
- raise "non numeric 2nd arg `#{b.inspect}'" if !b.kind_of? Numeric
- raise "`#{b.inspect}' for 2nd arg" if b.kind_of? Complex
+ raise TypeError, "non numeric 1st arg `#{a.inspect}'" if !a.kind_of? Numeric
+ raise TypeError, "`#{a.inspect}' for 1st arg" if a.kind_of? Complex
+ raise TypeError, "non numeric 2nd arg `#{b.inspect}'" if !b.kind_of? Numeric
+ raise TypeError, "`#{b.inspect}' for 2nd arg" if b.kind_of? Complex
@real = a
@image = b
end
-
+
#
# Addition with real or complex number.
#