Bug #1828

1/-20 == -1 ?

Added by phasis68 (Heesob Park) almost 3 years ago. Updated about 1 year ago.

[ruby-core:24586]
Status:Rejected Start date:07/28/2009
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:core
Target version:1.9.1
ruby -v:ruby 1.9.1p243 (2009-07-16 revision 24175) [i686-linux]

Description

Dividing positive number by negative number returns incorrect value.

irb(main):001:0> 1/-20
=> -1
irb(main):002:0> 30/-20
=> -2
irb(main):003:0> 20/-30
=> -1

History

Updated by darix (Marcus Rückert) almost 3 years ago

100/-20 => -5
1/-20.0 => -0.05

sounds to me like an invalid bug report.

Updated by nobu (Nobuyoshi Nakada) almost 3 years ago

  • Status changed from Open to Rejected

Also available in: Atom PDF