Project

General

Profile

Actions

Bug #5775

closed

BitVector.longValue returns incorrect values

Added by Andrei Tatarnikov almost 10 years ago. Updated over 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Andrei Tatarnikov
Category:
Bit Vector
Target version:
Start date:
03/27/2015
Due date:
% Done:

100%

Estimated time:
Detected in build:
svn
Platform:
Published in build:
150421

Description

Subject. The code blow fails:

final BitVector bv1 = BitVector.valueOf(0x00000000000A0000L, 64);
System.out.println(bv1.toHexString());
System.out.println(Long.toHexString(bv1.longValue()));
assertEquals(0x00000000000A0000L, bv1.longValue());

final BitVector bv2 = BitVector.valueOf(0xFFFFFFFFFFF5FFFFL, 64);
System.out.println(bv2.toHexString());
System.out.println(Long.toHexString(bv2.longValue()));
assertEquals(0xFFFFFFFFFFF5FFFFL, bv2.longValue());

final BitVector bv3 = BitVector.valueOf(0xDEADBEEFBAADF00DL, 64);
System.out.println(bv3.toHexString());
System.out.println(Long.toHexString(bv3.longValue()));
assertEquals(0xDEADBEEFBAADF00DL, bv3.longValue());
Actions #1

Updated by Andrei Tatarnikov almost 10 years ago

I meant test 2 and 3. Test 1 is successful.

Actions #2

Updated by Andrei Tatarnikov almost 10 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Fixed in r852.

Actions #3

Updated by Andrei Tatarnikov over 9 years ago

  • Status changed from Resolved to Closed
  • Target version set to 0.4
  • Published in build set to 150421
Actions

Also available in: Atom PDF