mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/mathn.rb (Rational::inspect): should preserve original
operand. [ruby-core:05806] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
ffe2293998
commit
48dcf7ad36
3 changed files with 11 additions and 3 deletions
|
@ -1,5 +1,13 @@
|
||||||
|
Sat Sep 17 23:25:04 2005 sheepman <sheepman@sheepman.sakura.ne.jp>
|
||||||
|
|
||||||
|
* lib/mathn.rb (Rational::inspect): should preserve original
|
||||||
|
operand. [ruby-core:05806]
|
||||||
|
|
||||||
Sat Sep 17 23:20:27 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
|
Sat Sep 17 23:20:27 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||||
|
|
||||||
|
* lib/cgi.rb (CGI::Cookie): should handle multiple values for a
|
||||||
|
cookie name. [ruby-talk:156140]
|
||||||
|
|
||||||
* test/socket/test_tcp.rb (TestTCPSocket::test_recvfrom): typo
|
* test/socket/test_tcp.rb (TestTCPSocket::test_recvfrom): typo
|
||||||
fixed. [ruby-dev:27123]
|
fixed. [ruby-dev:27123]
|
||||||
|
|
||||||
|
|
|
@ -883,7 +883,6 @@ class CGI
|
||||||
raw_cookie.split(/[;,] /).each do |pairs|
|
raw_cookie.split(/[;,] /).each do |pairs|
|
||||||
name, values = pairs.split('=',2)
|
name, values = pairs.split('=',2)
|
||||||
next unless name and values
|
next unless name and values
|
||||||
p [name, values]
|
|
||||||
name = CGI::unescape(name)
|
name = CGI::unescape(name)
|
||||||
values ||= ""
|
values ||= ""
|
||||||
values = values.split('&').collect{|v| CGI::unescape(v) }
|
values = values.split('&').collect{|v| CGI::unescape(v) }
|
||||||
|
|
|
@ -135,6 +135,7 @@ class Rational
|
||||||
|
|
||||||
def ** (other)
|
def ** (other)
|
||||||
if other.kind_of?(Rational)
|
if other.kind_of?(Rational)
|
||||||
|
other2 = other
|
||||||
if self < 0
|
if self < 0
|
||||||
return Complex.new!(self, 0) ** other
|
return Complex.new!(self, 0) ** other
|
||||||
elsif other == 0
|
elsif other == 0
|
||||||
|
@ -155,7 +156,7 @@ class Rational
|
||||||
for elm in npd
|
for elm in npd
|
||||||
elm[1] = elm[1] * other
|
elm[1] = elm[1] * other
|
||||||
if !elm[1].kind_of?(Integer) and elm[1].denominator != 1
|
if !elm[1].kind_of?(Integer) and elm[1].denominator != 1
|
||||||
return Float(self) ** other
|
return Float(self) ** other2
|
||||||
end
|
end
|
||||||
elm[1] = elm[1].to_i
|
elm[1] = elm[1].to_i
|
||||||
end
|
end
|
||||||
|
@ -163,7 +164,7 @@ class Rational
|
||||||
for elm in dpd
|
for elm in dpd
|
||||||
elm[1] = elm[1] * other
|
elm[1] = elm[1] * other
|
||||||
if !elm[1].kind_of?(Integer) and elm[1].denominator != 1
|
if !elm[1].kind_of?(Integer) and elm[1].denominator != 1
|
||||||
return Float(self) ** other
|
return Float(self) ** other2
|
||||||
end
|
end
|
||||||
elm[1] = elm[1].to_i
|
elm[1] = elm[1].to_i
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue