зеркало из https://github.com/github/ruby.git
* lib/mathn.rb: removed commented-out code.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47280 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
d4bee0dc37
Коммит
daa90738c4
|
@ -1,3 +1,7 @@
|
|||
Tue Aug 26 09:25:03 2014 SHIBATA Hiroshi <shibata.hiroshi@gmail.com>
|
||||
|
||||
* lib/mathn.rb: removed commented-out code.
|
||||
|
||||
Mon Aug 25 20:15:50 2014 Masaki Suketa <masaki.suketa@nifty.ne.jp>
|
||||
|
||||
* ext/win32ole/win32ole.c(fole_s_connect, fole_initialize): raise a
|
||||
|
|
|
@ -226,14 +226,8 @@ module Math
|
|||
def sqrt(a)
|
||||
if a.kind_of?(Complex)
|
||||
abs = sqrt(a.real*a.real + a.imag*a.imag)
|
||||
# if not abs.kind_of?(Rational)
|
||||
# return a**Rational(1,2)
|
||||
# end
|
||||
x = sqrt((a.real + abs)/Rational(2))
|
||||
y = sqrt((-a.real + abs)/Rational(2))
|
||||
# if !(x.kind_of?(Rational) and y.kind_of?(Rational))
|
||||
# return a**Rational(1,2)
|
||||
# end
|
||||
if a.imag >= 0
|
||||
Complex(x, y)
|
||||
else
|
||||
|
|
Загрузка…
Ссылка в новой задаче