Project

General

Profile

Actions

Bug #13986

closed

Integer#fdiv with Complex returns unexpected value

Added by 5.5 (5 5) over 6 years ago. Updated over 5 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 2.4.2p198 (2017-09-14 revision 59899) [x86_64-darwin15]
[ruby-dev:50281]

Description

Ruby 2.4 では,Integer#fdivComplex オブジェクトを与えると,期待と違う値が得られる場合があります。

p 1.fdiv(1+0i) #=> -1.404447761611185e+306
p 1.fdiv(1i) #=> -1.0e-323

期待は,それぞれ

Complex(1.0, 0.0)
Complex(0.0, -1.0)

でした。

Ruby 2.3.3 では期待のとおりでした。


Related issues 1 (0 open1 closed)

Related to Ruby master - Bug #13928: Calling Integer.fdiv with BigDecimal returns unexpected resultClosedActions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0