Project

General

Profile

Actions

Bug #8697

closed

Fixnum complement operator issue

Added by torimus (Torimus GL) over 10 years ago. Updated over 10 years ago.

Status:
Rejected
Assignee:
-
Target version:
ruby -v:
1.9.3p448
[ruby-core:56228]

Description

=begin
By the ((<documentation|URL:http://www.ruby-doc.org/core-2.0/Fixnum.html#method-i-7E>)), bitwise complement operator ((~)) to Fixnum instance should do ((one's complement)) with just flipping all bits. In fact, current implementation does ((two's complement)) due to or-ing with FIXNUM_FLAG, which is defined as 1.

Either fix the documentation or the fix_rev function implementation.
Affected versions: both 1.9.3 and 2.0.0
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0Like0Like0