summaryrefslogtreecommitdiff
path: root/lib/complex.rb
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-03-23 15:38:44 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-03-23 15:38:44 +0000
commit94f40186c0b576b4e4ead89d369712990285baa1 (patch)
tree598ab90f70379273988826959ec3399bb4bf41c2 /lib/complex.rb
parent5aadcd934937f0898fdd3d9bbec3550f65598b98 (diff)
* io.c (rb_io_fread): may lose data on nonblocking read.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/complex.rb')
-rw-r--r--lib/complex.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/complex.rb b/lib/complex.rb
index 98af310..dda2ad2 100644
--- a/lib/complex.rb
+++ b/lib/complex.rb
@@ -407,9 +407,7 @@ end
class Fixnum
- if not defined? Rational
- alias power! **
- end
+ alias power! **
# Redefined to handle a Complex argument.
def ** (other)
@@ -430,9 +428,7 @@ class Fixnum
end
class Bignum
- if not defined? Rational
- alias power! **
- end
+ alias power! **
end
class Float
@@ -459,7 +455,11 @@ module Math
Complex(0,sqrt!(-z))
end
else
- z**Rational(1,2)
+ if defined? Rational
+ z**Rational(1,2)
+ else
+ z**0.5
+ end
end
end