JDK-4967876 : provide bit-count method for int/long
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 5.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2003-12-12
  • Updated: 2003-12-12
  • Resolved: 2003-12-12
Related Reports
Duplicate :  
Description

Name: rmT116609			Date: 12/12/2003


A DESCRIPTION OF THE REQUEST :
There is a nice bit-count method in BigInteger.bitCnt(). It seems to be influenced by 'Hackers delight'. An average programmer would just code a simple loop for this. The classes (Short?), Integer, Long (maybe Math) should be extended to provide a public static method like bitCnt.


JUSTIFICATION :
Make nifty, rare known algorithms available for general use - it's already there - but package-local in BigInteger. The current implementation calls for (avoidable) cut-and-paste - if someone finds it...
(Incident Review ID: 230602) 
======================================================================

Comments
EVALUATION This functionality is already provided by the Tiger refe 4495754. Closing as a dup. ###@###.### 2003-12-12
12-12-2003