Bug #1828

1/-20 == -1 ?

Added by Heesob Park over 2 years ago. Updated 10 months 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 Marcus Rückert over 2 years ago

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

sounds to me like an invalid bug report.

Updated by Nobuyoshi Nakada over 2 years ago

  • Status changed from Open to Rejected

Also available in: Atom PDF